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

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
Signed-off-by: Colin Walters <walters@verbum.org>
@cgwalters-bot

Copy link
Copy Markdown
Contributor Author

Rebased onto main; 2 commits, no content change.

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