Page MenuHomeFreeBSD

Fix scripted installations on EFI systems for 13.0
ClosedPublic

Authored by nwhitehorn on Mon, Mar 22, 6:18 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
R10 FreeBSD src repository
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

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.Mon, Mar 22, 7:52 PM
usr.sbin/bsdinstall/scripts/script
128

Was this supposed to be two separate lines?

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

I'm having trouble parsing that comment...