Skip to content

composefs: Implement bootc edit - #2501

Open
cgwalters-bot wants to merge 2 commits into
bootc-dev:mainfrom
cgwalters-forge:bot/composefs-edit
Open

cgwalters-bot wants to merge 2 commits into
bootc-dev:mainfrom
cgwalters-forge:bot/composefs-edit

Conversation

@cgwalters-bot

Copy link
Copy Markdown
Contributor

bootc edit bailed on the composefs backend. It only supports two transitions, an image change and a boot order flip, and composefs already implements those as switch and rollback. This change shares the edited-spec parsing and validation between the two backends and dispatches to those. The first commit is a prep commit that splits up switch_composefs.

On composefs, editing the image back to one that is already deployed fails on the identical fs-verity digest, just as bootc switch does.

Testing: a new tmt test, plan-50-edit, covers a no-op edit, an image+rollback edit that must be rejected, an image change, and a boot order flip across reboots. It passed on composefs with GRUB and BLS (unsealed, ext4) and on ostree. Unit tests, including a new table-driven test_validate_edited_spec, and just validate also passed. Everything ran on a 16-core RHEL 10 devspace. Sealed UKI with systemd-boot is still unverified: there the guest times out on reboot, and the existing plan-36-rollback fails the same way, so it looks like an environment problem. It still needs a run in upstream CI (the composefs sealed matrix leg).

The Signed-off-by: Colin Walters <walters@verbum.org> on these commits was added on cgwalters's approval of the review draft: cgwalters-forge#20 (review)

Generated-by: https://github.com/cgwalters/#llms

@cgwalters-bot

Copy link
Copy Markdown
Contributor Author

Rebased onto main; 2 commits, no content change.

Generated-by: https://github.com/cgwalters/#llms

@cgwalters-bot

cgwalters-bot commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor Author

@cgwalters Rebased onto main (now d06478e). Main took tmt test number 50 (plan-50-switch-zstd-chunked), which this PR also used, so test-edit.nu is now number 59 (plan-59-edit/test-59-edit), reserved with bot-tmt-number; see cgwalters-forge/tracker#238.

  • b394e5e (composefs/switch: Split out switching to a given image) rebased cleanly and keeps your sign-off.
  • d06478e (composefs: Implement bootc edit) has the renumber and conflict resolution, so it lost your sign-off and needs your re-approval.

Tested on a 16-core devspace with BOOTC_base=quay.io/fedora/fedora-bootc:44: just validate passes, just unit-tests 469 passed. just test-tmt-nobuild plan-59 (composefs, grub, ext4, bls) passed.

Generated-by: https://github.com/cgwalters/#llms

Prep for implementing `bootc edit` on composefs, which needs the same
staging logic with a target image that comes from an edited spec rather
than from `SwitchOpts`.

The journal record drops `bootc.from_downloaded`, which was always false
there since that case returns earlier.

Generated-by: AI
Signed-off-by: Colin Walters <walters@verbum.org>
`bootc edit` bailed on the composefs backend, one of the gaps listed
for stabilizing it. The ostree logic maps over directly: the only
transitions `edit` supports are an image change or a boot order flip,
and composefs already has both as `switch` and `rollback`. So parse and
validate the edited spec in a helper shared by both backends, and
dispatch to the composefs switch or rollback code.

Like `bootc switch` on composefs, editing the image back to one that is
already deployed (e.g. the booted image while another is staged) errors
on the identical fs-verity digest, where ostree would stage it again.

The new tmt test runs on both backends, since the ostree path had no
integration coverage either.

Generated-by: AI
@cgwalters-bot

Copy link
Copy Markdown
Contributor Author

@cgwalters Rebased onto main (now 2b079cc); the only conflicts were in the generated tmt lists (plan-59-edit now sits between plan-57 and plan-60 from main), no code changes.

  • 219eba9 (composefs/switch: Split out switching to a given image) keeps your sign-off.
  • 2b079cc (composefs: Implement bootc edit) still lacks it (it lost it in the previous rebase), so DCO stays red until you approve this head.

Tested on a 16-core devspace with BOOTC_base=quay.io/fedora/fedora-bootc:44: just validate and just unit-tests pass; on composefs (grub, ext4, bls, unsealed) plan-36-rollback, plan-43-switch-same-digest, plan-47-download-only-switch, plan-57-composefs-separate-boot and plan-59-edit pass, and plan-59-edit passes on ostree.

Generated-by: https://github.com/cgwalters/#llms

This branch has not been deployed

No deployments
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