Skip to content

feat(uki): activate correct verity addon for target A/B usr partition (ACL only)#669

Closed
bfjelds wants to merge 6 commits into
mainfrom
user/bfjelds/acl-cosi-with-partuuid-addons
Closed

feat(uki): activate correct verity addon for target A/B usr partition (ACL only)#669
bfjelds wants to merge 6 commits into
mainfrom
user/bfjelds/acl-cosi-with-partuuid-addons

Conversation

@bfjelds
Copy link
Copy Markdown
Member

@bfjelds bfjelds commented Jun 1, 2026

ACL images ship with PARTUUID-based verity addons — for both A and B partitions stored in acl/uki-addons/ on the ESP, with partition A active by default. During an A/B update, trident must swap the active addon to match the target partition so the new UKI boots with the correct verity partition identity.

Add activate_verity_addon_for_target_volume() which:

  • Checks for ACL verity addon templates on the image ESP
  • Copies the correct partition addon into the staged addon directory
  • Is a silent no-op for non-ACL images (no template dir)
  • Errors if template dir exists but the selected partition is missing

Called from copy_file_artifacts() after stage_uki_on_esp(), gated on ctx.image_distro().is_acl() to ensure only ACL images are affected.

bfjelds and others added 6 commits June 1, 2026 14:17
ACL images ship with PARTUUID-based verity addons — templates for both
A and B slots stored in acl/uki-addons/ on the ESP, with slot A active
by default. During an A/B update, trident must swap the active addon
to match the target slot so the new UKI boots with the correct verity
partition identity.

Add activate_verity_addon_for_target_volume() which:
- Checks for ACL verity addon templates on the image ESP
- Copies the correct slot template into the staged addon directory
- Is a silent no-op for non-ACL images (no template dir)
- Errors if template dir exists but the selected slot is missing

Called from copy_file_artifacts() after stage_uki_on_esp(), gated on
ctx.image_distro().is_acl() to ensure only ACL images are affected.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
ACL uses identical FS UUIDs across A/B slots by design — partitions
are distinguished by PARTUUID instead. The within-image uniqueness
check is unaffected.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Scan each UKI's .extra.d/ directory for *.addon.efi files and extract
their .cmdline PE sections. Addons are stored as a new field on the
boot entry so the COSI metadata captures the full effective cmdline
(main UKI + addons).

Both Go (mkcosi) and Rust (metadata deserialization) updated.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
With PARTUUID-based verity addons, usrhash= moved from the main UKI
cmdline to the verity addon cmdline. Update extractUsrhashFromUKIEntries
to also search addon cmdlines when looking for the root hash.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@bfjelds
Copy link
Copy Markdown
Member Author

bfjelds commented Jun 4, 2026

replaced with #673

@bfjelds bfjelds closed this Jun 4, 2026
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