Skip to content

composefs: Write Type 1 boot entries in one place - #2645

Merged
cgwalters merged 1 commit into
bootc-dev:mainfrom
krissedout:composefs-type1-entries
Nov 13, 2026
Merged

cgwalters merged 1 commit into
bootc-dev:mainfrom
krissedout:composefs-type1-entries

Conversation

@krissedout

Copy link
Copy Markdown
Contributor

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 earlier staged entries in #2630, long after the BLS one did in #1861, which is how that bug happened.

This moves it into write_type1_entries(), which both call now. The one behaviour change is that for UKIs it fsyncs the entries directory it wrote to, instead of the ESP's root.

Follow-up to the review on #2630. cargo fmt, clippy and cargo test -p bootc-lib pass, and test-composefs-gc-uki.nu covers the staging path.

Assisted-by: AI

@bootc-bot
bootc-bot Bot requested a review from gursewak1997 November 11, 2026 14:35
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 <kristof@lanth.me>
@krissedout
krissedout force-pushed the composefs-type1-entries branch from 64352af to 3a51d2f Compare November 11, 2026 17:13

@Johan-Liebert1 Johan-Liebert1 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@krissedout

Copy link
Copy Markdown
Contributor Author

@Johan-Liebert1 could you merge this when you get the chance? Thanks!

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues block approval of the consolidated Type 1 boot-entry writing change.

No open issues 🎉

What changed in this PR

Centralizes composefs Type 1 boot-entry writing so kernel/initrd and UKI deployments share the same installation and staging logic, reducing the risk of fixes diverging between them.

Changes:

  • Extracts write_type1_entries() and uses it from both boot-configuration paths.
  • Preserves replacement of earlier staged entries alongside the booted deployment’s entry.
  • Changes UKI synchronization to fsync the entries directory rather than the ESP root.
File Description
crates/​lib/​src/​bootc_composefs/​boot.rs Consolidates Type 1 entry writing and updates UKI directory synchronization.

Review effort: Balanced

@cgwalters cgwalters left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks like a really nice cleanup!

@cgwalters
cgwalters merged commit e15221d into bootc-dev:main Nov 13, 2026
95 of 105 checks passed
@krissedout
krissedout deleted the composefs-type1-entries branch November 13, 2026 22:45
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.

4 participants