Page MenuHomeFreeBSD

Fix scripted installations on EFI systems for 13.0

Authored by nwhitehorn on Mar 22 2021, 6:18 PM.



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

The patch here fixes this using a combination of options 3 and 4 from 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:

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

rG FreeBSD src repository
Automatic diff as part of commit; lint not applicable.
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.Mar 22 2021, 7:52 PM

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.

I'm having trouble parsing that comment...