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)
Fri, Apr 12, 11:07 AM
Unknown Object (File)
Wed, Apr 10, 3:37 PM
Unknown Object (File)
Wed, Mar 27, 8:41 PM
Unknown Object (File)
Mar 7 2024, 5:23 PM
Unknown Object (File)
Jan 31 2024, 3:27 PM
Unknown Object (File)
Jan 12 2024, 11:44 AM
Unknown Object (File)
Dec 22 2023, 11:05 PM
Unknown Object (File)
Dec 12 2023, 2:05 PM

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...