Skip to content

Conversation

Johan-Liebert1
Copy link
Collaborator

@Johan-Liebert1 Johan-Liebert1 commented Sep 2, 2025

If we find UKI addons in the boot entries list, write them to ESP along with the UKI

Right now if a UKI Addon also has the composefs= cmdline param, it's ignored.

Supporting: containers/composefs-rs#126

Needs containers/composefs-rs#178

@Johan-Liebert1
Copy link
Collaborator Author

I thought needs-ok-to-test skipped CI as the CI won't currently pass anyway

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 refactors the UKI boot setup to handle UKI addons by processing a list of boot entries instead of a single one. A new helper function, write_pe_to_esp, is introduced to encapsulate writing PE files to the ESP, which is a good separation of concerns. The changes are generally well-structured and address the goal of handling UKI addons. I've identified a couple of areas for improvement regarding code consistency and robustness. My detailed feedback is in the comments below.

@Johan-Liebert1 Johan-Liebert1 marked this pull request as draft September 2, 2025 10:28
@Johan-Liebert1 Johan-Liebert1 added area/composefs Issues related to composefs and removed needs-ok-to-test labels Sep 10, 2025
@Johan-Liebert1 Johan-Liebert1 marked this pull request as ready for review September 10, 2025 07:13
If we find UKI addons in the boot entries list, write them to ESP along
with the UKI

Signed-off-by: Pragyan Poudyal <pragyanpoudyal41999@gmail.com>
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 <pragyanpoudyal41999@gmail.com>
@Johan-Liebert1
Copy link
Collaborator Author

Rebased and fix conflicts. @cgwalters could I have a review?

Copy link
Collaborator

@cgwalters cgwalters left a comment

Choose a reason for hiding this comment

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

Looks ok to me, though there's some pre-existing things we could change as a followup.


for entry in entries {
match entry {
ComposefsBootEntry::Type1(..) => tracing::debug!("Skipping Type1 Entry"),
Copy link
Collaborator

Choose a reason for hiding this comment

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

FWIW I basically don't think bootc should support this. The main use case is kernel arguments which we already cover with bootc kargs.

So my preference going forward is a hard error, not just a debug.

match entry {
ComposefsBootEntry::Type1(..) => tracing::debug!("Skipping Type1 Entry"),
ComposefsBootEntry::UsrLibModulesVmLinuz(..) => {
tracing::debug!("Skipping vmlinuz in /usr/lib/modules")
Copy link
Collaborator

Choose a reason for hiding this comment

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

Shouldn't this one also be an error?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Currently, using existing images to create UKIs also has kernel+initrd in /usr/lib/modules. But, yes, makes sense for these to be errors as we only ever want one type of boot entry. But, let's say, if an image does have both type of entries, as users could be using the same image, should we still throw an error?

@cgwalters cgwalters merged commit ab51fe7 into bootc-dev:composefs-backend Sep 12, 2025
21 checks passed
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.

2 participants