Skip to content

varlink: add varlink interface for syncing fwupd capsule updates across ESPs - #1138

Open
Rolv-Apneseth wants to merge 1 commit into
coreos:mainfrom
Rolv-Apneseth:varlink
Open

varlink: add varlink interface for syncing fwupd capsule updates across ESPs#1138
Rolv-Apneseth wants to merge 1 commit into
coreos:mainfrom
Rolv-Apneseth:varlink

Conversation

@Rolv-Apneseth

Copy link
Copy Markdown
Member

This is related to coreos/fedora-coreos-tracker#1623, and adds a varlink interface that fwupd can use to tell bootupd to sync firmware capsule updates to other co-located ESPs for our RAID setups (redundant ESPs).

There is already a related fwupd PR, 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 partuuid of the device the update was written to, and a capsule_dir with 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:

sudo dnf copr enable rapneset/bootupd-varlink
sudo dnf install bootupd-0.3d32bdb --repo 'copr:copr.fedorainfracloud.org:rapneset:bootupd-varlink'
sudo systemctl start bootupd-varlink.socket
sudo varlinkctl call /run/bootupd/org.coreos.bootupd1 \
  org.coreos.bootupd1.SyncFwupdUpdates \
  '{"partuuid": "2e126947-2730-49df-af3f-012de73bccfd", "capsule_dir": "EFI/fedora/fw"}'

Couple notes:

  • Put the varlink subcommand under bootupd since it shouldn't be user-facing
  • Implemented a simple service first, but now I'm leaning mostly towards socket-activated (both currently implemented)
  • Socket will need to be enabled in fedora-coreos-config. We'll also need to have udisks2 for fwupd to work as intended.
  • I haven't made any updates to the readme just yet - waiting to see if we want to make any changes to the approach here
  • RAID tests are divided by architecture just like the raid1-boot tests
  • Since zlink required an async runtime, I chose smol as a lightweight option

@Rolv-Apneseth

Copy link
Copy Markdown
Member Author

CI failures related to coreos/fedora-coreos-config#4261

@Rolv-Apneseth

Copy link
Copy Markdown
Member Author

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 bootupd (and hence kept in "sync"). If fwupd places capsule updates on one ESP, the firmware will only process them from the ESP on the boot disk. By syncing capsules to all co-located ESPs, we ensure the firmware update applies regardless of which disk the system boots from.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant