Repository navigation
composefs: Keep the legacy composefs= karg in BLS entries - #28
Closed
cgwalters-bot wants to merge 2 commits into
Closed
cgwalters-bot wants to merge 2 commits into
cgwalters-bot wants to merge 2 commits into
Conversation
Since ba10fb1 ("composefs: Generate both V1 and V2 EROFS images on install"), BLS entries carry only `composefs.digest=v1-sha512-12:<digest>`. The initramfs of bootc 1.16 and earlier only starts bootc-root-setup.service when a karg named `composefs` is present (and before 1.16.3 only parses `composefs=`), so a BLS entry written by current bootc for an image that still carries such an initramfs fails switch-root and drops to the emergency shell. Unlike a UKI, whose kargs come from the image's own bootc, a BLS entry is written by the host's bootc, e.g. on `bootc switch` to an image that still ships bootc 1.16. No release has this yet (1.16.14 predates it). Write the legacy `composefs=` karg after `composefs.digest=`, with the same V1 digest. It has to be the deployment's own digest rather than the V2 one the dual-format UKI uses, because the old initramfs also derives the `state/deploy/<digest>` directory from it. Current parsers prefer `composefs.digest=`, and 1.16.4 through 1.16.14 already wrote V1 digests under `composefs=`, so this adds no new meaning to the bare karg. Generated-by: AI
Nothing covered a host bootc writing the boot entry for an image whose initramfs predates `composefs.digest=`, which is how the previous commit's bug went unnoticed until bootupd's e2e test (which updates bootc without regenerating the initramfs) stopped booting. Simulate that initramfs by restoring the 1.16 unit condition and regenerating it, then switch to it and reboot. Generated-by: AI
cgwalters-bot
force-pushed
the
bot/composefs-legacy-karg
branch
from
September 26, 2026 04:14
9afbabc to
4fc7ede
Compare
Yes, this for now. |
Collaborator
Author
|
Done: bootupd CI now regenerates the initramfs after installing bootc from copr, in cgwalters-forge/bootupd#2 (composefs UEFI boot on stream10 passes there and fails on bootupd main). Closing this one as superseded. Generated-by: https://github.com/cgwalters/#llms |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Since ba10fb1 made V1 the default, BLS entries carry only
composefs.digest=v1-sha512-12:<digest>. The initramfs from bootc 1.16.x (e.g. the currentcentos-bootc:stream10, bootc 1.16.13) hasConditionKernelCommandLine=composefson bootc-root-setup.service, so with that entry the unit never starts and switch-root fails into the emergency shell. That broke coreos/bootupd's composefs e2e job, which updates bootc in the stream10 image without regenerating the initramfs (job); the same happens onbootc switchfrom a current host to any image that still ships bootc 1.16, which is a consistent image, not a stale initramfs. No release is affected yet (1.16.14 predates ba10fb1).This writes
composefs=<digest>aftercomposefs.digest=in BLS entries, with the same V1 digest. That differs from the dual-format UKI (V2 digest under barecomposefs=) and from composefs-rs's docs, which call barecomposefs=the V2 alias; the docs now say so. The reason is that an initramfs reading onlycomposefs=also derivesstate/deploy/<digest>from it. Current parsers trycomposefs.digest=first, and 1.16.4 through 1.16.14 already put V1 digests undercomposefs=. UKIs are unchanged: their kargs come from the image's own bootc. The legacy karg can go once 1.16.x images are out of support.Alternatives, if you'd rather not keep the legacy karg:
composefs.digestcondition (probe the unit vialsinitrd, or key off the image's bootc version). That turns the brick into an error, but the switch still doesn't work.bootc switchto a 1.16 image.composefs=, matchingukify. That should work for 1.16.3+ initramfs (which prefercomposefs.digest=). For 1.16.0-1.16.2, which only readcomposefs=, reading the source suggests they would look forstate/deploy/<v2 digest>and fail; I haven't tested those versions, with either choice.Tested on a 16-core devspace (composefs, grub, ext4, BLS):
centos-bootc:stream10(bootc 1.16.13 initramfs) with/usr/bin/bootcreplaced, installed withbcvk libvirt run --composefs-backend. With main (8f348ae) bootc the cmdline has onlycomposefs.digest=...and boot ends in "Failed to start initrd-switch-root.service" / emergency mode; with this PR's bootc it boots with composefs root. Unmodified main image boots (control).test-56-composefs-legacy-initramfs(switch to an image whose initramfs has the 1.16 unit condition, reboot): passes on this PR; against the main image it fails with a guest reboot timeout, the console showing the same switch-root failure.just validateandjust unit-testspassed on the current head; tmt readonly, rollback, soft-reboot, soft-reboot-selinux-policy, composefs-gc and composefs-gc-uki passed on the previous revision (code unchanged since, only docs, comments and the test number).Related: bootc-dev#2248
Generated-by: https://github.com/cgwalters/#llms
Review draft in cgwalters-forge, not upstream yet. This section is removed when the PR is opened upstream.
bootc-dev/bootc, basemainPVTI_lAHOAQ_SPs4Bj2Gizg825vkTo review:
/promoteon a line of its own, to open it upstream, ready for review. Either covers only the commits pushed so far.Signed-off-by: Colin Walters <walters@verbum.org>to the commits lacking it (the bot's and yours; anyone else's only if you ask), with you as committer./draftline (in the same comment or before) to open it upstream as a draft (/readyundoes that).Bot run: session 929c7a64, agent ab54e08b · claude-opus-5-5 22.8M in (90% cached) / 77k out · ~$16.77 inference + ~$5.21 compute (est., list prices) · 3h 15m wall · 33.1 core-h, Actions runs 36215352573, 36206873173