From owner-svn-src-all@freebsd.org Tue Nov 10 08:33:46 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1FA202E7333; Tue, 10 Nov 2020 08:33:46 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CVh3G0Nm0z3JTC; Tue, 10 Nov 2020 08:33:46 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0007D20031; Tue, 10 Nov 2020 08:33:45 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0AA8Xj55063452; Tue, 10 Nov 2020 08:33:45 GMT (envelope-from 0mp@FreeBSD.org) Received: (from 0mp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0AA8XjNR063451; Tue, 10 Nov 2020 08:33:45 GMT (envelope-from 0mp@FreeBSD.org) Message-Id: <202011100833.0AA8XjNR063451@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: 0mp set sender to 0mp@FreeBSD.org using -f From: Mateusz Piotrowski <0mp@FreeBSD.org> Date: Tue, 10 Nov 2020 08:33:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r367547 - stable/12/tools/build X-SVN-Group: stable-12 X-SVN-Commit-Author: 0mp X-SVN-Commit-Paths: stable/12/tools/build X-SVN-Commit-Revision: 367547 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Nov 2020 08:33:46 -0000 Author: 0mp (doc,ports committer) Date: Tue Nov 10 08:33:45 2020 New Revision: 367547 URL: https://svnweb.freebsd.org/changeset/base/367547 Log: MFC r367072: Mount devfs inside a beinstall(8) chroot It turns out that without /dev/null beinstall is not able to complete and instead exits with messages similar to these: -------------------------------------------------------------- >>> Installing kernel GENERIC completed on Sun Oct 25 17:47:37 CET 2020 -------------------------------------------------------------- /tmp/beinstall.JleGoP/mnt: Inspecting dirs /usr/src /usr/obj/usr/src/amd64.amd64 --- installworld --- make[1]: "/usr/obj/usr/src/amd64.amd64/toolchain-metadata.mk" line 1: Using cached toolchain metadata from build at t480 on Sun Oct 25 15:53:28 CET 2020 make[2]: "/dev/null" line 2: Need an operator make[2]: Fatal errors encountered -- cannot continuemake[1]: "/usr/src/Makefile.inc1" line 593: CPUTYPE global should be set with ?=. Cleaning up ... umount -f /tmp/beinstall.JleGoP/mnt/usr/src /tmp/beinstall.JleGoP/mnt/usr/obj/usr/src/amd64.amd64 /tmp/beinstall.JleGoP/mnt Destroyed successfully error: Installworld failed! Upon a bit of debugging, it turns out that /dev/null inside the chroot environment is full random bytes, which cause "make -f /dev/null" to misbehave. Mounting a proper devfs inside the chroot seems to be the most appropriate way to fix it. will@ also noted that this change requires that whatever is needed in devfs must exist in the old kernel. Approved by: will Modified: stable/12/tools/build/beinstall.sh Directory Properties: stable/12/ (props changed) Modified: stable/12/tools/build/beinstall.sh ============================================================================== --- stable/12/tools/build/beinstall.sh Tue Nov 10 07:47:24 2020 (r367546) +++ stable/12/tools/build/beinstall.sh Tue Nov 10 08:33:45 2020 (r367547) @@ -216,6 +216,7 @@ fi create_be_dirs "${srcdir}" "${objdir}" || errx "Unable to create BE dirs" mount -t nullfs "${srcdir}" "${BE_MNTPT}${srcdir}" || errx "Unable to mount src" mount -t nullfs "${objdir}" "${BE_MNTPT}${objdir}" || errx "Unable to mount obj" +mount -t devfs devfs "${BE_MNTPT}/dev" || errx "Unable to mount devfs" chroot ${BE_MNTPT} make "$@" -C ${srcdir} installworld || \ errx "Installworld failed!"