bootupd
bootupd copied to clipboard
Support updating multiple EFIs in mirrored setups
Follow-up to https://github.com/coreos/bootupd/pull/127 (specifically https://github.com/coreos/bootupd/pull/127#discussion_r546995248). We need to update the EFI in all the devices matching the appropriate GUID, not just the one which wins the /dev/disk/by-partlabel/EFI-SYSTEM
race.
One small correction: in the mirrored boot disk case, no partitions are labeled EFI-SYSTEM
.
Note that just dumbly doing a type GUID match will not work for things like multipath. We solved this in rdcore
by looking for ESPs only on the same devices which back the boot partition: https://github.com/coreos/coreos-installer/blob/78e2a7a4bf8d9ddb90b5e4fb5729a2550999ad11/src/blockdev.rs#L880-L945
Would probably make sense for bootupd to use the same heuristic (or if it finds a better heuristic to use, update coreos-installer to match).
Notes for implementing this for Fedora CoreOS:
- https://github.com/coreos/fedora-coreos-tracker/issues/1485#issuecomment-1533350911
- https://github.com/coreos/fedora-coreos-tracker/issues/1752#issuecomment-2194950462
But unfortunately we might have to add more heuristics to support Anaconda installations.
As far as I could see when trying various RAID setups in Anaconda (https://docs.fedoraproject.org/en-US/fedora/f36/install-guide/install/Installing_Using_Anaconda/#sect-installation-gui-manual-partitioning-swraid), they only create a single EFI system partition.
So Fedora CoreOS should be the only case with one per disk, unless someone use manual partitioning and explicitly set up two.
See also: https://gitlab.com/fedora/ostree/sig/-/issues/1#note_2086744541
Test failed with multiple EFIs in mirrored setups (using latest bootupd in copr build):
$ cosa run --add-disk 10G -B ../ign/mirror.bu --qemu-firmware uefi -m 4096
[root@cosa-devsh ~]# mount -o remount,rw /boot
[root@cosa-devsh ~]# mv /boot/bootupd-state.json .
[root@cosa-devsh ~]# bootupctl adopt-and-update
Running as unit: bootupd.service
lsblk: : not a block device
error: Failed to run lsblk
mirror.bu is refered to doc
variant: fcos
version: 1.5.0
boot_device:
mirror:
devices:
- /dev/vda
- /dev/vdb