varlink: add varlink interface for syncing fwupd capsule updates across ESPs - #1138
varlink: add varlink interface for syncing fwupd capsule updates across ESPs#1138Rolv-Apneseth wants to merge 1 commit into
Conversation
|
CI failures related to coreos/fedora-coreos-config#4261 |
|
I'll include a quick note on why we even need this: Typical RAID setups only have a single ESP, but CoreOS duplicates the ESP as plain vfat partitions across all disks, which are all updated by |
| %{_prefix}/lib/bootupd/grub2-static/ | ||
| %{_unitdir}/bootloader-update.service | ||
| %{_unitdir}/bootupd-varlink.socket | ||
| %{_unitdir}/bootupd-varlink.service |
There was a problem hiding this comment.
I think it'd be nice to have systemd units enforce locking.
So we have a single bootupd.service and change bootloader-update.service to actually call into the varlink API too, which would activate that service in the same way.
Alternatively, do we actually need a .socket unit? What we did in e.g. varlink for https://github.com/bootc-dev/bcvk/ is that it remains a CLI that has an interface one forks that enables varlink.
There was a problem hiding this comment.
Current state should work without a socket unit actually, so just bootupd varlink will run it's own daemon. I don't quite understand the suggestion for a single bootupd.service though, would you mind clarifying? If we're gonna have a service anyway why not let systemd handle the socket? I don't have a strong opinion on this and initially leaned towards a simple service at first but the PR over on fwupd assumed it was socket-activated so I shifted that direction.
There was a problem hiding this comment.
Thanks for taking a look by the way @cgwalters
| bootupd::list_dev_current_root, efi::Efi, freezethaw::fsfreeze_thaw_cycle, model::SavedState, | ||
| }; | ||
|
|
||
| const SOCKET_PATH: &str = "/run/bootupd/org.coreos.bootupd1"; |
|
|
||
| #[zlink::service(interface = "org.coreos.bootupd1")] | ||
| impl BootupdVarlinkService { | ||
| /// Sync capsule update files from a "primary" ESP to all colocated ESPs. |
There was a problem hiding this comment.
Should this really be specific to capsules? Isn't the general use case here "I am some software that touched one of the ESPs, please sync the others"?
There was a problem hiding this comment.
That's what I assumed at first, but @travier wanted just the "fwupd folder" in coreos/fedora-coreos-tracker#1623 (comment)
| Type=simple | ||
| # It doesn't make sense to sync ESP updates in "Live" environments. | ||
| # https://github.com/coreos/fedora-coreos-tracker/issues/2136 | ||
| ExecCondition=/bin/bash -c '[[ ! $(findmnt -n -o FSTYPE /sysroot) =~ ^(erofs|squashfs)$ ]]' |
There was a problem hiding this comment.
See above, if we changed bootloader-update.service then we could avoid copy-pasta this
This is related to coreos/fedora-coreos-tracker#1623, and adds a varlink interface that
fwupdcan use to tellbootupdto sync firmware capsule updates to other co-located ESPs for our RAID setups (redundant ESPs).There is already a related
fwupdPR, which @hughsie built against a copr project I created. The tests included here should confirm we're working as intended though.The way it works is it accepts a
partuuidof the device the update was written to, and acapsule_dirwith the relative path to the update dir on the device, and syncs those updates across co-located ESPs by mounting each in turn. On my system, I can interact with the interface like this:Couple notes:
varlinksubcommand underbootupdsince it shouldn't be user-facingfedora-coreos-config. We'll also need to haveudisks2forfwupdto work as intended.zlinkrequired an async runtime, I chosesmolas a lightweight option