Repository navigation
composefs/upgrade: Remove existing staged entries - #1861
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Code Review
This pull request adds logic to remove an existing staged bootloader entries directory during an upgrade. The change is correct in principle, but I've identified a potential race condition and suggested a more robust implementation that also improves code clarity.
Collaborator
|
|
Member
Author
|
Thanks, I'll rebase and push again |
Johan-Liebert1
force-pushed
the
upgrade-staged-fix
branch
from
December 17, 2025 08:45
43533bb to
7284a43
Compare
cgwalters
approved these changes
Dec 17, 2025
cgwalters
left a comment
Member
There was a problem hiding this comment.
OK as is but gemini's suggestion would be nice to apply
Johan-Liebert1
force-pushed
the
upgrade-staged-fix
branch
from
December 18, 2025 04:35
7284a43 to
600277a
Compare
Johan-Liebert1
enabled auto-merge (rebase)
December 18, 2025 04:35
Member
Author
|
Applied Gemini's suggested change |
Johan-Liebert1
force-pushed
the
upgrade-staged-fix
branch
from
December 18, 2025 05:24
600277a to
b94ec71
Compare
Collaborator
|
Failure has been fixed by PR #1867. This PR needs a rebase. Thanks. |
When upgrading, switching if there is already a staged directory for bootloader entries, then delete it as we would overwrite it anyway Fixes: bootc-dev#1857 Signed-off-by: Pragyan Poudyal <[email protected]>
Johan-Liebert1
force-pushed
the
upgrade-staged-fix
branch
from
December 18, 2025 10:03
b94ec71 to
2de254a
Compare
krissedout
added a commit
to krissedout/bootc
that referenced
this pull request
Nov 10, 2026
Staging a UKI wrote its entries into loader/entries.staged next to whatever an earlier staged deployment left there. An entry's file name carries the version from the UKI's os-release, so staging an image of another version over a staged one kept the earlier entry. Status then found a deployment that was neither staged nor rollback, garbage collection removed its image while its entry and state directory stayed, and from then on status failed to open the manifest. Upgrade, switch and finalization all go through status, so the system was stuck on the booted deployment, and rebooting didn't help. Remove the staged entries before writing the new ones, as setup_composefs_bls_boot() has done since bootc-dev#1861. Assisted-by: AI Signed-off-by: Kristof Imeri <[email protected]>
Johan-Liebert1
pushed a commit
that referenced
this pull request
Nov 11, 2026
Staging a UKI wrote its entries into loader/entries.staged next to whatever an earlier staged deployment left there. An entry's file name carries the version from the UKI's os-release, so staging an image of another version over a staged one kept the earlier entry. Status then found a deployment that was neither staged nor rollback, garbage collection removed its image while its entry and state directory stayed, and from then on status failed to open the manifest. Upgrade, switch and finalization all go through status, so the system was stuck on the booted deployment, and rebooting didn't help. Remove the staged entries before writing the new ones, as setup_composefs_bls_boot() has done since #1861. Assisted-by: AI Signed-off-by: Kristof Imeri <[email protected]>
krissedout
added a commit
to krissedout/bootc
that referenced
this pull request
Nov 11, 2026
setup_composefs_bls_boot() and write_systemd_uki_config() each had their own copy of writing a deployment's Type 1 entry: into loader/entries on install, or, when staging, into a fresh loader/entries.staged next to the booted deployment's entry. The UKI copy only started clearing the earlier staged entries in bootc-dev#2630, after the BLS one had done so since bootc-dev#1861. Move it into write_type1_entries(), which both now call, so the two can't drift apart again. It also fsyncs the entries directory it wrote to for UKIs too, where it used to fsync the ESP's root. Assisted-by: AI Signed-off-by: Kristof Imeri <[email protected]>
cgwalters
pushed a commit
that referenced
this pull request
Nov 13, 2026
setup_composefs_bls_boot() and write_systemd_uki_config() each had their own copy of writing a deployment's Type 1 entry: into loader/entries on install, or, when staging, into a fresh loader/entries.staged next to the booted deployment's entry. The UKI copy only started clearing the earlier staged entries in #2630, after the BLS one had done so since #1861. Move it into write_type1_entries(), which both now call, so the two can't drift apart again. It also fsyncs the entries directory it wrote to for UKIs too, where it used to fsync the ESP's root. Assisted-by: AI Signed-off-by: Kristof Imeri <[email protected]>
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.
When upgrading, switching if there is already a staged directory for bootloader entries, then delete it as we would overwrite it anyway
Fixes: #1857