diff options
author | Mateusz Piotrowski <0mp@FreeBSD.org> | 2020-10-27 09:32:06 +0000 |
---|---|---|
committer | Mateusz Piotrowski <0mp@FreeBSD.org> | 2020-10-27 09:32:06 +0000 |
commit | 1655b2314e0e155ce1154b804f1abe05fceedc41 (patch) | |
tree | ee521fdb4412628aa1dfc2d726040bd92eb05a13 /tools | |
parent | a3f4217ec0d095f4e26030b4136f9925b939d186 (diff) | |
download | src-test2-1655b2314e0e155ce1154b804f1abe05fceedc41.tar.gz src-test2-1655b2314e0e155ce1154b804f1abe05fceedc41.zip |
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
MFC after: 2 week
Differential Revision: https://reviews.freebsd.org/D26944
Notes
Notes:
svn path=/head/; revision=367072
Diffstat (limited to 'tools')
-rwxr-xr-x | tools/build/beinstall.sh | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/tools/build/beinstall.sh b/tools/build/beinstall.sh index 3f34049baf50..388a3d9c7b5a 100755 --- a/tools/build/beinstall.sh +++ b/tools/build/beinstall.sh @@ -223,6 +223,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!" |