Page MenuHomeFreeBSD

Mount devfs inside a beinstall(8) chroot
ClosedPublic

Authored by 0mp on Oct 25 2020, 5:12 PM.
Tags
None
Referenced Files
F108118402: D26944.diff
Tue, Jan 21, 2:07 PM
Unknown Object (File)
Wed, Jan 8, 11:58 PM
Unknown Object (File)
Wed, Dec 25, 4:30 PM
Unknown Object (File)
Nov 21 2024, 6:13 PM
Unknown Object (File)
Nov 19 2024, 9:35 PM
Unknown Object (File)
Nov 8 2024, 11:40 PM
Unknown Object (File)
Nov 8 2024, 11:40 PM
Unknown Object (File)
Nov 8 2024, 11:40 PM
Subscribers

Details

Summary
Mount devfs inside a beinstall(8) chroot

It turns out that without /dev/null beinstall is not able to complete and
instead exits with the 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. Mounting a proper devfs inside the chroot
seems to be the most appropriate way to fix it.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

0mp requested review of this revision.Oct 25 2020, 5:12 PM
0mp added subscribers: olivier, kevans.

Worth noting this requires that whatever is needed in devfs exists in the old kernel.

This revision is now accepted and ready to land.Oct 25 2020, 6:13 PM
In D26944#601092, @will wrote:

Worth noting this requires that whatever is needed in devfs exists in the old kernel.

Hmmm, I'm sorry, but I'm not sure where you'd like to see this note :D in the manual page, script, or the commit message?

This revision was automatically updated to reflect the committed changes.