Page MenuHomeFreeBSD

Fix scripted installations on EFI systems for 13.0
ClosedPublic

Authored by nwhitehorn on Mar 22 2021, 6:18 PM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Nov 14, 1:17 AM
Unknown Object (File)
Thu, Nov 14, 1:13 AM
Unknown Object (File)
Apr 12 2024, 2:27 PM
Unknown Object (File)
Apr 12 2024, 8:36 AM
Unknown Object (File)
Apr 12 2024, 5:24 AM
Unknown Object (File)
Apr 12 2024, 3:32 AM
Unknown Object (File)
Apr 12 2024, 3:27 AM
Unknown Object (File)
Apr 12 2024, 1:39 AM

Details

Summary

This patch fixes scripted installation on systems with mounted ESPs, which were causing difficulties with tar. Tar tries to set the modification time of the ESP root directory, which FAT doesn't support, resulting in an error and the installation failing. For more backstory, see https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=254395

The patch here fixes this using a combination of options 3 and 4 from https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=254395. If the controlling console is a TTY, it uses distextract, like interactive installs, which works around the issue intelligently. Otherwise, it uses tar(1) but has it not extract the EFI mountpoint and instead makes it (unconditionally) by hand. This makes scripted installs with a console work across the board (presumably, almost all of them), and isolates remaining brokenness to powerpc64 and ARM systems installed with non-standard scripted installers where the controlling console is not a TTY (presumably, a vanishingly small number). A solution will come for those later, potentially involving this PR against tar: https://github.com/libarchive/libarchive/issues/1516.

With the tar issue fixed, a second issue involving umount(8) became apparent. While mount -a is smart enough to track dependencies in fstab and mount things in the right order, umount -a is not and will try to unmount root before the ESP on error, resulting in scripted installs still failing. This patch addresses that problem too by sorting fstab.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

nwhitehorn created this revision.
nwhitehorn edited the summary of this revision. (Show Details)

I cannot comment on the changes to partedit.c, but the sh(1) changes look sane to me.

This revision is now accepted and ready to land.Mar 22 2021, 7:52 PM
usr.sbin/bsdinstall/scripts/script
128

Was this supposed to be two separate lines?

This revision now requires review to proceed.Mar 22 2021, 7:56 PM
This revision is now accepted and ready to land.Mar 22 2021, 7:59 PM
rpokala added inline comments.
usr.sbin/bsdinstall/scripts/script
123

I'm having trouble parsing that comment...