Repository navigation
Fix(lifecycle): install dakota with the composefs backend so its upgrade and rollback reboots work - #1273
Fix(lifecycle): install dakota with the composefs backend so its upgrade and rollback reboots work#1273kylerankin wants to merge 2 commits into
Conversation
…ade and rollback reboots work The lifecycle suite reboots into staged deployments, which a direct kernel boot cannot reach (projectbluefin#1023). Firmware boot (OVMF) is the fix, but it is gated on `bootupctl` — and dakota is composefs-native with no bootupd, so it fell through to direct kernel boot and its upgrades/rollbacks could not reboot. Detect the composefs backend from the image's install config (`/usr/lib/bootc/install/*.toml`) and, when present, force the firmware-boot path and install with `--composefs-backend --bootloader systemd` (the ostree backend aborts on composefs: "bootupd is required for ostree-based installs", projectbluefin#1215). Deployment discovery was ostree-hardcoded to `/ostree/deploy/default/deploy`. Make it backend-aware: composefs deployments live under `/sysroot/state/deploy/<id>`. Guard the ostree-only direct-boot prep (kernel extraction, boot.N symlink, `ostree=` arg) behind `FIRMWARE_BOOT` so composefs deployments never get a bogus `/ostree/` tree and a missing initramfs.img can't abort the step under `set -e`. The utah/ostree GRUB path is untouched — this is an additive composefs branch. Closes projectbluefin#1215 Signed-off-by: kylerankin <kylerankin@users.noreply.github.com>
|
@kylerankin this PR is back in your court ( Review asks:
Reply here or push a new head to this branch (same sign-off); CI and the review swarm re-run automatically and the PR returns to the normal path. Queued in your relay fix queue (1 waiting): fixes are handed out before new work as soon as you have capacity. |
ad87e36
|
…cle test The composefs-first detection reordered the firmware-boot markers so a detected composefs backend set FIRMWARE_BOOT=true before the bootupctl probe. That broke test_lifecycle_install_keeps_the_images_own_loader_and_needs_it, which asserts lifecycle < probe < firmware < override, and renamed the systemd-boot override anchor to INSTALL_EXTRA. Keep the bootupctl probe as the primary firmware-boot trigger and add the composefs-backend grep as a fallback branch that also sets FIRMWARE_BOOT=true, so the ordering and the override anchor stay stable. Update the two tests that pinned the old marker order to the composefs-first structure. Closes projectbluefin#1215 Signed-off-by: kylerankin <kylerankin@users.noreply.github.com>
|
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
There was a problem hiding this comment.
Summary: This change tries to make the test suite install the "dakota" system image the way dakota installs itself, so that tests of upgrading and rolling back can actually reboot into the new version. As written, it would break that test run for dakota and also for "utah", the image whose upgrade tests work today. The install step looks for the installed system in the wrong folder, and two later lines fail because a file and a folder they expect are no longer created. The change also does not yet adjust the test scenarios themselves, which the issue asked for.
What I need from you: Apply the three fixes below, then link a passing manual lifecycle run on dakota and on utah, as the issue requires.
Reviewed head ad87e363. No CI job at this head runs the lifecycle suite. pytest and lint pass, but no CI run exercises the firmware-boot path this PR changes.
correctness (inline threads carry the fixes)
- Composefs paths are wrong (high). The root partition is mounted at
/mnt/root, so it is bootc's/sysroot. bootc's own constants areSTATE_DIR_RELATIVE = "state/deploy"("Relative to /sysroot") andSHARED_VAR_PATH = "state/os/default/var"(bootc-dev/bootccrates/lib/src/composefs_consts.rs:9,19)..github/workflows/e2e.yml:486-487looks under/mnt/root/sysroot/state/..., which does not exist. As a result,findat:526returns nothing, and the step exits with "bootc install wrote no deployment" (:546).VAR(:563) also points to a directory that does not exist. - Firmware boot (utah too) aborts on
/mnt/boot(high)./mnt/bootis only created at:599, and that line is inside the direct-boot block, which the new guard at:569now skips.:694then runsmount … /mnt/bootonto a missing directory, and the step fails under bash-e. Separately, nothing ever unmounts/mnt/bootbeforelosetup -d(:965-966). vmlinuzandinitramfs.imgare no longer produced on firmware boot (high). They are only copied at:595-596and:616-617, both inside the skipped block. However,:968still runsls -lh disk.raw vmlinuz initramfs.img, so the step fails for utah lifecycle as well. Before this PR, utah ran that prep unconditionally (basee2e.yml:907). Issue #1215 says "Keep utah's path … exactly as it is."
Fix for 3 (the ls line has no changed line to anchor to):
- ls -lh disk.raw vmlinuz initramfs.img
+ if [[ "${FIRMWARE_BOOT}" == "true" ]]; then ls -lh disk.raw; else ls -lh disk.raw vmlinuz initramfs.img; fiOpen question, not verified: selinux_qualify.py expected-mode "${D}" (:717) reads ${D}/etc/selinux/… (scripts/selinux_qualify.py:67-78). Please confirm that a composefs state/deploy/<id>/etc overlay contains the policy's file_contexts. If it does not, dakota silently drops to unsupported.
intent-alignment
- Issue item 2 is not done (medium). #1215 asks to make the lifecycle scenarios backend-aware: use
bootc statusJSON, and gateostree admin pin/ostree admin status(tests/lifecycle/features/bootc.feature:26-33,99-108,steps.py:579). The diff touches no lifecycle feature or step file. The PR says "Closes #1215", but the acceptance criteria also require linkedmanual.ymlruns on dakota and on utah, and none is linked. Either do item 2 in this PR and link both runs, or change "Closes" to "Part of #1215".
docs-currency
- Stale comment (low).
e2e.yml:431-436still says an image without bootupd "(dakota) keeps the direct-boot path below". That now contradicts the composefs branch added right after it. Delete those six lines, because the new block at:437-448replaces them.tests/unit/test_e2e_lifecycle_firmware_boot.pyhas a similar note ("an image without bootupd such as dakota"); update it as well.
No findings from: security, style.
Findings not on a changed line
.github/workflows/e2e.yml:432: docs-currency (low): Lines 431-436 still say dakota "keeps the direct-boot path below". That contradicts the composefs branch added at :437-461. Delete 431-436: the new block replaces them. The note intests/unit/test_e2e_lifecycle_firmware_boot.pysaying "an image without bootupd such as dakota" is stale in the same way.
Confidence: 0/5 (do not merge) — 3 high findings; 1 medium finding
-- hive: agent=reviewer backend=claude model=claude-opus-5-5 effort=medium claude=2.1.327
| DEPLOY_DIR="sysroot/state/deploy" | ||
| STATE_DIR="sysroot/state" |
There was a problem hiding this comment.
correctness (high): /mnt/root is the physical root, i.e. bootc's /sysroot. bootc's composefs layout is state/deploy and state/os/default/var relative to /sysroot (bootc-dev/bootc crates/lib/src/composefs_consts.rs:9,19). With sysroot/ prefixed, the deploy find at :526 returns nothing and the step exits with "bootc install wrote no deployment". VAR also lands on a directory that does not exist. Note that STATEROOT/deploy must stay valid for the later loops.
| DEPLOY_DIR="sysroot/state/deploy" | |
| STATE_DIR="sysroot/state" | |
| DEPLOY_DIR="state/deploy" | |
| STATE_DIR="state" |
Also set VAR per backend at :563: /mnt/root/state/os/default/var for composefs, keeping /mnt/root/${STATE_DIR}/var for ostree.
| # systemd-boot reads BLS entries from the boot partition (xbootldr / | ||
| # p2). Some images also mirror them in the root's /boot (p3). Search | ||
| # both so composefs (p2) and ostree (p2 or p3) both get CI kargs. | ||
| mountpoint -q /mnt/boot || sudo mount "${LOOP}p2" /mnt/boot |
There was a problem hiding this comment.
correctness (high): /mnt/boot is only created at :599, inside the direct-boot block that :569 now skips when FIRMWARE_BOOT=true. Because of that, this mount targets a directory that does not exist, and the step fails under bash -e for utah as well as dakota. The mount is also never undone before losetup -d at :966.
| mountpoint -q /mnt/boot || sudo mount "${LOOP}p2" /mnt/boot | |
| sudo mkdir -p /mnt/boot | |
| mountpoint -q /mnt/boot || sudo mount "${LOOP}p2" /mnt/boot |
Then add sudo umount /mnt/boot after the entries loop, before fi.
|
Clearing
This clears only the safety flag. It isn't a review verdict or a merge approval, and the PR is still back with the author per the hive's review. |
|
@kylerankin the hive has adopted this PR ( |
|
The hive will not publish head Ask: a maintainer pushes the fix to this PR's branch and merges it, or cherry-picks the change onto a maintainer-owned branch. Moving to |
Summary
Fixes dakota's lifecycle upgrade/rollback reboots (#1215) by installing it with the composefs backend and enabling the OVMF firmware-boot path that the lifecycle suite already relies on for ostree images.
Why
The lifecycle suite reboots into staged deployments, which a direct
-kernelboot cannot reach (#1023). Firmware boot is the fix, but it is gated onbootupctlpresence — and dakota is composefs-native with no bootupd, so it fell through to direct kernel boot. Its upgrades and rollbacks therefore rebooted into the wrong deployment.What changes
FIRMWARE_BOOT=trueand install with--composefs-backend --bootloader systemd(the ostree backend aborts on composefs: "bootupd is required for ostree-based installs", fix(lifecycle): install dakota with the composefs backend so its upgrade and rollback reboots work #1215)./sysroot/state/deploy/<id>, not/ostree/deploy/default/deploy.boot.Nsymlink,ostree=arg) behindFIRMWARE_BOOTso composefs deployments never get a bogus/ostree/tree and a missing initramfs.img can't abort the step underset -e.The utah/ostree GRUB path is untouched — this is an additive composefs branch. Adds a unit test asserting the firmware-boot branch is taken when the composefs backend is detected.
Closes #1215
Hive-Run: #1215
-- hive: backend=pi model=lemonade/ornith-1.5-35b-a3b-gguf-q6_k