Skip to content

Conversation

cgwalters
Copy link
Collaborator

@cgwalters cgwalters commented Jul 24, 2025

This adds a new off-by default feature to enable
a new composefs-native backend for bootc. This
is all still a live work in progress, but
we're landing this first tranche of work to help
avoid continual issues with rebasing.

Thanks to everyone who worked on it!

xref #1190

Co-authored-by: John Eckersberg [email protected]
Co-authored-by: Robert Sturla [email protected]
Co-authored-by: Colin Walters [email protected]
Signed-off-by: Pragyan Poudyal [email protected]

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces composefs as a new backend, which is a significant and extensive change. The new code paths for installation, upgrades, switching, and rollbacks for composefs are well-structured.

My review has identified a few issues, including a potential bug with a hardcoded transport value and an assert! that could lead to a panic. I've also included some suggestions for improving code style and robustness. Given this is a work-in-progress, these findings are not unexpected. Overall, this is a solid foundation for the new composefs functionality.

@cgwalters cgwalters mentioned this pull request Aug 1, 2025
1 task
@cgwalters
Copy link
Collaborator Author

cgwalters commented Aug 4, 2025

I'm going to rebase this. In the interest of preserving history I've saved a copy of the branch as composefs-branch-20250804

@cgwalters cgwalters force-pushed the composefs-backend branch 2 times, most recently from 33e4511 to 7d596fe Compare August 4, 2025 19:56
@cgwalters
Copy link
Collaborator Author

OK at least this passes the existing tests.

@cgwalters
Copy link
Collaborator Author

I rebased 🏄 this again (and in the process reworked the composefs karg stuff to use the new kernel_cmdline &str APIs)

@cgwalters
Copy link
Collaborator Author

OK I'd like to land #1525 and then rebase again

@Johan-Liebert1 Johan-Liebert1 force-pushed the composefs-backend branch 2 times, most recently from 828d837 to 1a7ac13 Compare August 19, 2025 09:07
@Johan-Liebert1
Copy link
Collaborator

Rebasing on main ends up with a bunch of conflicts again. I was thinking about moving all composefs related code to separate files/crate to minimize conflicts

@cgwalters
Copy link
Collaborator Author

Notes from meeting

  • Need to rebase (should squash most commits again)
  • Considering merging mostly as is with lots of followups
  • Gate code based on feature flag
  • Trust in automated tests, but also do a lot of manual testing post-merge to be sure it doesn't break the ostree path

@cgwalters
Copy link
Collaborator Author

@jeckersb before rebasing this would you mind also saving the existing branch? We've done that for the last few rebases

@jeckersb
Copy link
Collaborator

Worth noting that I didn't do any of the squashing during the rebase, but at least with it clean we can easily decide which ones to squash out.

@Johan-Liebert1
Copy link
Collaborator

I'll be going ahead and rebasing again in prep for #1560

@jeckersb
Copy link
Collaborator

jeckersb commented Sep 3, 2025

rebased this again (saved the old one at composefs-backend-2025-09-03) to fix a conflict and pick up #1581

@cgwalters
Copy link
Collaborator Author

/gemini review

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces significant new functionality for composefs support, including installation, upgrades, switching, and rollbacks. The changes are extensive, touching many parts of the codebase to accommodate composefs as an alternative to the existing ostree backend. New modules, data structures, and logic have been added to handle composefs-native systems.

The review has identified a few important issues. There's a high-severity bug where a hardcoded "docker" transport is used, which will prevent switching to images from other transports. Another high-severity issue is that a crucial finalization step (install_finalize) is skipped for composefs installations, potentially leaving them in an inconsistent state. Additionally, there are some medium-severity concerns regarding robustness against non-UTF8 paths and inconsistent use of std::fs versus cap_std for filesystem operations.

Overall, this is a great step towards composefs integration, and addressing these points will improve the correctness and robustness of the new functionality.

@cgwalters cgwalters added the area/composefs Issues related to composefs label Sep 8, 2025
@Johan-Liebert1
Copy link
Collaborator

Needs another rebase. Maybe one after #1598 lands, which is required for #1573

@Johan-Liebert1
Copy link
Collaborator

Rebased again. Only one conflict found

<<<<<<< HEAD
etc-merge = { path = "../etc-merge" }
=======
bootc-initramfs-setup = { path = "../initramfs" }
>>>>>>> 023be101 (composefs/install: Copy /etc contents to state)

Accepted both, and saved previous branch to composefs-backend-10-09-2025

@cgwalters cgwalters changed the title WIP: composefs branch Add a composefs backend Sep 12, 2025
@cgwalters cgwalters marked this pull request as ready for review September 12, 2025 16:20
@bootc-bot bootc-bot bot requested a review from jeckersb September 12, 2025 16:20
@cgwalters
Copy link
Collaborator Author

OK I rebased this, the conflict was from #1603 mainly. The resolutions were pretty straightforward.

@cgwalters
Copy link
Collaborator Author

Previous branch is backed up at https://github.com/bootc-dev/bootc/tree/composefs-backend-2025-09-12

This adds a new off-by default feature to enable
a new composefs-native backend for bootc. This
is all still a live work in progress, but
we're landing this first tranche of work to help
avoid continual issues with rebasing.

Thanks to everyone who worked on it!

xref #1190

Co-authored-by: John Eckersberg <[email protected]>
Co-authored-by: Robert Sturla <[email protected]>
Co-authored-by: Colin Walters <[email protected]>
Signed-off-by: Pragyan Poudyal <[email protected]>
@Johan-Liebert1
Copy link
Collaborator

Rebased again. Saved the previous branch to composefs-backend-15-09-2025

Conflict found

<<<<<<< HEAD
=======
    #[clap(hide(true))]
    #[cfg(feature = "docgen")]
    Man(ManOpts),
    #[cfg(feature = "composefs-backend")]
    ComposefsFinalizeStaged,
>>>>>>> a7185978 (Add a composefs backend)

resolved to

    #[cfg(feature = "composefs-backend")]
    ComposefsFinalizeStaged,

@Johan-Liebert1
Copy link
Collaborator

Johan-Liebert1 commented Sep 15, 2025

Weird, the make-validate issue should've been fixed by #1606, but that change is neither present in the rebased branch nor in the branch before the rebase. It is present in https://github.com/bootc-dev/bootc/tree/composefs-backend-2025-09-12 though. Probably something went wrong during last Friday's rebase @cgwalters?

@cgwalters
Copy link
Collaborator Author

Hmm...ugh. Looking...

cgwalters and others added 3 commits September 15, 2025 14:57
I was hitting a compliation error which *looks*
like it was actaully an incremental compilation bug?
Or it might have been rust-analyzer and local builds
fighting over enabled features.

Anyways, this ensures that we're gating on the composefs
backend compiling.

Signed-off-by: Colin Walters <[email protected]>
If we find UKI addons in the boot entries list, write them to ESP along
with the UKI

Signed-off-by: Pragyan Poudyal <[email protected]>
We don't need to write Grub menuentries for systemd-boot. For now the
operation is a no-op, but later we would want to have .conf files in
`ESP/loader/entries` so we can control the order of entries.

Regarding that, we would also need to place the UKIs in a separate
directory and not inside `ESP/EFI/Linux`, if we don't want duplicate
entries, as systemd-boot will simply list all .efi files placed in
EFI/Linux unconditionally

Signed-off-by: Pragyan Poudyal <[email protected]>
@cgwalters
Copy link
Collaborator Author

OK after some auditing I think what happened is pretty simple, I probably forgot to git fetch and so rebased an old version of the branch. Pushed the 3 missing commits here.

@cgwalters cgwalters enabled auto-merge September 15, 2025 18:58
@cgwalters
Copy link
Collaborator Author

Since I created this PR, I can't approve it; @jeckersb can you do so?

Copy link
Collaborator

@jeckersb jeckersb left a comment

Choose a reason for hiding this comment

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

🥳

@cgwalters cgwalters merged commit 19e82be into main Sep 15, 2025
61 of 62 checks passed
@cgwalters cgwalters deleted the composefs-backend branch September 15, 2025 19:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/composefs Issues related to composefs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants