Page MenuHomeFreeBSD

bsdinstall: Add loader.efi to all ESPs we create
ClosedPublic

Authored by imp on Sep 29 2025, 9:37 AM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Jan 10, 3:17 PM
Unknown Object (File)
Dec 21 2025, 5:16 AM
Unknown Object (File)
Dec 13 2025, 7:27 PM
Unknown Object (File)
Dec 13 2025, 3:57 AM
Unknown Object (File)
Nov 6 2025, 11:30 PM
Unknown Object (File)
Nov 4 2025, 7:23 AM
Unknown Object (File)
Nov 2 2025, 2:35 AM
Unknown Object (File)
Oct 27 2025, 11:39 PM

Details

Summary

Add the proper loader.efi to each of the ESPs we create. zfsboot creates
a list of extra ESPs to populate. For both UFS and ZFS, the first ESP is
mounted and we copy the files over (using the same heuristic for the
platform default file). zfsboot-noted ESPs will get copies as well. We
don't have to do anything for UFS since we don't support installing into
a gmirror, but if we ever do, we can use this mechanism.

Sponsored by: Netflix

Test Plan

This is a rewrite of what was submitted.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

imp requested review of this revision.Sep 29 2025, 9:37 AM
imp added reviewers: cperciva, ivy.
imp added inline comments.
usr.sbin/bsdinstall/scripts/zfsboot
1024

This was stray, it seems, from earlier revs.

Minor nits.

usr.sbin/bsdinstall/scripts/auto
182

Isn't this usually spelled : > ${TMPDIR:-"/tmp"}/bsdinstall-esps ?

(In particular, it avoids needing to open /dev/null. I can't imagine a scenario where /dev/ isn't mounted here, but why rely on it?)

usr.sbin/bsdinstall/scripts/bootconfig
149

appends ?

150

don't support installing ?

153

This could just be mktemp -d -t bsdinstall-esp since the use of TMPDIR (if set) or /tmp (otherwise) is implied.

imp edited the test plan for this revision. (Show Details)

update comments, some minor tweaking

This revision is now accepted and ready to land.Sep 29 2025, 11:31 PM
This revision was automatically updated to reflect the committed changes.

First of all many many thanks for this ! Perhaps not the right place for this question but how this would work during upgrade, have you tested that ? would the data being copied on all ESPs ? I have to comment the /dev/gpt/efiboot0 line on fstab, without that when the first drive fails I am dropped to single mode , so I am wondering if commenting is the right thing to do (as this would not being mounted would it be impacted by potential upgrades). Many thanks for the clarification

First of all many many thanks for this ! Perhaps not the right place for this question but how this would work during upgrade, have you tested that ? would the data being copied on all ESPs ? I have to comment the /dev/gpt/efiboot0 line on fstab, without that when the first drive fails I am dropped to single mode , so I am wondering if commenting is the right thing to do (as this would not being mounted would it be impacted by potential upgrades). Many thanks for the clarification

So I'm confused. Maybe send me email with the details and I'll go from there. Phab is a terrible tool for support questions..

usr.sbin/bsdinstall/scripts/auto
182

No idea. That's likely better though.

usr.sbin/bsdinstall/scripts/bootconfig
149

Yea, writes the extras to. It appends each one. I'll fix.

150

ok.

153

Hmmm, lemme check. Yes. Will update.