freebsd-dev/tools/build
Mateusz Piotrowski 1655b2314e 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
2020-10-27 09:32:06 +00:00
..
bootstrap-m4 Add necessary Makefile.inc1 infrastructure for building on non-FreeBSD 2020-08-25 13:29:57 +00:00
cross-build Fix more -Wundef warnings during bootstrap 2020-10-14 12:28:54 +00:00
libc-bootstrap Add missing FreeBSD functions to -legacy when building on macOS/Linux 2020-08-25 13:23:31 +00:00
make_check
mk libbe(3): install MLINKS for all of the functions provided 2020-10-18 23:58:40 +00:00
options Slightly modify wording to better match nearby entries. 2020-09-24 06:12:57 +00:00
beinstall.sh Mount devfs inside a beinstall(8) chroot 2020-10-27 09:32:06 +00:00
check-links.sh
depend-cleanup.sh build: provide a default WARNS for all in-tree builds 2020-09-18 17:17:46 +00:00
dummy.c
futimens.c
make.py When building on Ubuntu bootstrap bmake with bash as the default shell 2020-09-21 15:49:02 +00:00
Makefile Fix more -Wundef warnings during bootstrap 2020-10-14 12:28:54 +00:00
Makefile.depend
stat.h
stdlib.h
strings.h
utimensat.c