Page MenuHomeFreeBSD

bsdinstall: when installing UEFI, place the bootloader on all disks
Needs ReviewPublic

Authored by asomers on Oct 10 2023, 8:16 PM.
Tags
None
Referenced Files
F82259918: D42150.id.diff
Sat, Apr 27, 1:48 AM
F82259798: D42150.id128521.diff
Sat, Apr 27, 1:46 AM
F82255226: D42150.id129371.diff
Sat, Apr 27, 12:43 AM
F82253017: D42150.id137675.diff
Sat, Apr 27, 12:10 AM
Unknown Object (File)
Fri, Apr 26, 2:01 AM
Unknown Object (File)
Mar 4 2024, 5:34 PM
Unknown Object (File)
Mar 4 2024, 5:34 PM
Unknown Object (File)
Mar 4 2024, 5:34 PM

Details

Reviewers
dteske
brd
jrtc27
Summary

Previously, bsdinstall would partition all disks used by the zroot
pool, but would only format and install the boot partition on one.

Reported by: Julien Cigar <julien@perdition.city> and many others
MFC after: 1 week
Sponsored by: Axcient

Test Plan

Running in production with mirrored zroot pools

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 57364
Build 54252: arc lint + arc unit

Event Timeline

jrtc27 requested changes to this revision.Oct 10 2023, 8:26 PM
jrtc27 added inline comments.
usr.sbin/bsdinstall/scripts/bootconfig
182

UFS autopartitioning doesn't have a thing, so this glob will evaluate to a literal /dev/gpt/efiboot*. Encoding this ZFS specificity in here also seems a bit ugly.

This revision now requires changes to proceed.Oct 10 2023, 8:26 PM
usr.sbin/bsdinstall/scripts/bootconfig
182

UFS autopartitioning doesn't have a thing, so this glob will evaluate to a literal /dev/gpt/efiboot*. Encoding this ZFS specificity in here also seems a bit ugly.

Good point. We should check for a case like that. For that matter, is there anything to do here for UFS? Do we even support installing to gmirror+UFS ?

usr.sbin/bsdinstall/scripts/bootconfig
182

Only via manual partitioning as far as I know, at which point you'd need more infrastructure to mark any secondary ESPs which we just don't have an interface for.

I see that bootconfig used to have code for adding ESPs to all ZFS/UFS boot disks, but it was removed in https://reviews.freebsd.org/D28897. @imp reviewed that one, maybe you could share your opinion here if we should bring parts of that code back? I think all disks that are configured as boot disks by the installer should a working ESP after installation. If the wrong boot disks die then you are left with a system without any ESPs at all.

usr.sbin/bsdinstall/scripts/bootconfig
183

Where do we actually label things like this?
And isn't this super fragile?

190

This wins the award for the ugliest kludge to make this work.
I'd have been tempted to pass in mntpt at the very least and mount the alternatives on different mount points to avoid 'stacking' of the mount points which the cleanup routine wouldn't unwind.

usr.sbin/bsdinstall/scripts/bootconfig
183

See my comment above (zfsboot script)

  • Add ESP to all ZFS boot disks, pretty edition

This latest version fixes the script with UFS, and makes the bootconfig script less ZFS-specific.

ping @jrtc27 does the latest version look better to you?

linnemannr_gmail.com added inline comments.
usr.sbin/bsdinstall/scripts/bootconfig
148–152

This seems unnecessary to me. We're not concerned with the actual number of devices (which can be gotten without a shell loop using wc maybe?), just that we have a plurality of them. This can be determined just by looking for whitespace in $ESPS.

  • bsdinstall: all ESPs created by zfsboot should have a bootloader