Repository navigation
[composefs-backend]: install to-existing-root fixes - #2323
Johan-Liebert1 wants to merge 5 commits into
Conversation
install to-existing-root fixes
8117278 to
ffb79f7
Compare
|
Tests failing because I forgot we remove bootupd stuff when we install systemd-boot. I'll fixup the tests |
ffb79f7 to
96b2934
Compare
|
This turned out to be a bit more complicated than anticipated. Turning this into draft for now |
|
The issue is bootupd mounts ESP at |
|
Opened coreos/bootupd#1126 |
|
Yes, I think I worked around this in #2302 hackily too |
96b2934 to
7ca781e
Compare
|
This needs new bootupd release to include coreos/bootupd#1126 https://src.fedoraproject.org/rpms/rust-bootupd/pull-request/27# |
7ca781e to
fef75cb
Compare
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Target detection, bootloader selection, and separate /boot handling contain regressions that can break installations.
Review effort: Balanced
Findings: 2
Open (4)
What changed in this PR
Fixes composefs reinstall behavior, including boot mount handling and bootloader compatibility.
Changes:
- Propagates and safely remounts boot-related mounts.
- Detects the existing bootloader and adds composefs cleanup logic.
- Adds multi-reboot integration coverage.
| File | Description |
|---|---|
crates/lib/src/install.rs |
Adds composefs target and bootloader handling. |
crates/lib/src/utils.rs |
Avoids unnecessary read-write remounts. |
crates/lib/src/store/mod.rs |
Remounts composefs storage when needed. |
crates/lib/src/bootloader.rs |
Recognizes an ESP mounted at /boot. |
crates/system-reinstall-bootc/src/podman.rs |
Propagates host mount events. |
contrib/packaging/switch-to-sdboot |
Removes redundant bootupd cleanup. |
tmt/tests/booted/test-system-reinstall-composefs.nu |
Tests reinstall and bootloader fallback. |
tmt/tests/tests.fmf |
Registers the new test. |
tmt/plans/integration.fmf |
Adds the integration test plan. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| // Read efivars to get the bootloader | ||
| // Only if the operation is to replace the existing installation | ||
| let host_bootloader = match replace_mode { | ||
| Some(..) => { | ||
| let host_bootloader = get_bootloader().context("Determining existing bootloader")?; |
fef75cb to
1362a59
Compare
systemd gpt-auto-generator has automount for /boot which we need to propagate inside the container for the service to mount the ESP at /boot on access Also, before remounting `/boot` as rw, check if it's readonly so we don't fail the re-mount operation Signed-off-by: Pragyan Poudyal <pragyanpoudyal41999@gmail.com>
Fix a few issues with composefs path for `install to-existing-root`. 1. Composefs repository initialization Since we mount `/sysroot:ro` at `/target`, composefs repository initialization would fail with `Read only filesystem`. Fix it by remounting `/target/sysroot` read-write 2. Handle bootloader Get the current bootloader by reading `LoaderInfo` and try to install the same one Signed-off-by: Pragyan Poudyal <pragyanpoudyal41999@gmail.com>
To figure out which bootloader to install, get the host's bootloader (read from LoaderInfo from efivars) and store it in state. Before finalizing the bootloader, check if the detected bootloader is compatible with the current image (as the bootloader on host and the one in the new image might differ) Signed-off-by: Pragyan Poudyal <pragyanpoudyal41999@gmail.com>
Mostly generated by LLM with some tweaks by me Do not remove /usr/lib/bootupd/updates even when going down the systemd-boot installation path as we require the metadata for testing system reinstall Signed-off-by: Pragyan Poudyal <pragyanpoudyal41999@gmail.com>
For Grub booted compoesfs systems we have boot entries stored in `/sysroot/boot` which also needs cleaning whenever we clean up anything boot related Signed-off-by: Pragyan Poudyal <pragyanpoudyal41999@gmail.com>
1362a59 to
f998a69
Compare


system-reinstall: Propagate boot mount in container
systemd gpt-auto-generator has automount for /boot which we need to
propagate inside the container for the service to mount the ESP at
/boot on access
Also, before remounting
/bootas rw, check if it's readonly so wedon't fail the re-mount operation
composefs: Fix
install to-existing-rootFix a few issues with composefs path for
install to-existing-root.Composefs repository initialization
Since we mount
/sysroot:roat/target, composefs repositoryinitialization would fail with
Read only filesystem. Fix it byremounting
/target/sysrootread-writeHandle bootloader
Get the current bootloader by reading
LoaderInfoand try to installthe same one
cfs/to-existing-root: Bootloader support
To figure out which bootloader to install, get the host's bootloader
(read from LoaderInfo from efivars) and store it in state. Before
finalizing the bootloader, check if the detected bootloader is
compatible with the current image (as the bootloader on host and the one in
the new image might differ)