Skip to content

composefs: Keep BLS entries when a signed GRUB started the system - #2646

Open
krissedout wants to merge 1 commit into
bootc-dev:mainfrom
krissedout:composefs-signed-grub
Open

krissedout wants to merge 1 commit into
bootc-dev:mainfrom
krissedout:composefs-signed-grub

Conversation

@krissedout

@krissedout krissedout commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

A system set up for systemd-boot, with its UKIs and Type 1 entries, can also be started without systemd-boot: for example from a fallback firmware entry that goes through a distribution’s signed shim and GRUB, with GRUB booting the kernel and initramfs from its own configuration on the ESP, while shim doesn’t trust the system’s own key yet. GRUB is then the only loader that ran and names itself in LoaderInfo, and get_bootloader() takes any LoaderInfo other than systemd-boot’s or GRUB CC’s for a GRUB system, so bootc looks for a GRUB configuration under /boot that doesn’t exist, and bootc status fails on those starts, along with upgrade, switch and rollback.

For a generic GRUB it now probes the filesystem the way the non-EFI case already does, and treats the entries as BLS-compatible when /boot/loader/entries exists and there's no GRUB directory next to it. A GRUB with its own directory is still GRUB. The classifier's table test has both cases.

Assisted-by: AI

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 remain for the composefs bootloader-detection change.

No open issues 🎉

What changed in this PR

This PR fixes composefs bootloader detection when a distribution’s signed GRUB starts a systemd-boot installation, preserving BLS entry handling so bootc commands do not look for nonexistent GRUB configuration.

Changes:

  • Probe the filesystem for generic GRUB starts and use BLS-compatible handling when BLS entries exist without a GRUB directory.
  • Document the fallback and add table-driven tests covering GRUB starts with and without a GRUB directory.
File Description
crates/​lib/​src/​bootc_composefs/​status.rs Updates bootloader classification, filesystem probing, documentation, and regression tests.

Review effort: Balanced

@krissedout
krissedout force-pushed the composefs-signed-grub branch from 09af9ac to 6859d67 Compare November 11, 2026 17:13
@cgwalters

Copy link
Copy Markdown
Member

A systemd-boot install can also be started through a distribution's signed shim and GRUB,

Ugh. I agree we probably need to support it but holy cow is it confusing.

GRUB then names itself in LoaderInfo,

Wait I'm confused, shouldn't systemd-boot overwrite the LoaderInfo variable in this case?

@krissedout

Copy link
Copy Markdown
Contributor Author

A systemd-boot install can also be started through a distribution's signed shim and GRUB,

Ugh. I agree we probably need to support it but holy cow is it confusing.

Fair, I worded that badly. It's a system installed for systemd-boot, with its UKIs and Type 1 entries, but in our case there's a fallback firmware entry we use until shim trusts our key, and that start goes through Fedora's shim, GRUB and kernel instead. The GRUB config for it isn't under /boot and GRUB doesn't read the BLS entries, so bootc finds no GRUB directory and fails. The deployments and entries bootc manages are still the systemd-boot ones, which is why treating it as BLS-compatible is right there.

Wait I'm confused, shouldn't systemd-boot overwrite the LoaderInfo variable in this case?

systemd-boot doesn't run at all on that path. The firmware starts shim, shim starts GRUB, and GRUB boots the kernel and initramfs itself from its own config on the ESP. So LoaderInfo is GRUB's because GRUB is the only loader that ran.

I'll reword the description so it doesn't sound like GRUB chainloads systemd-boot.

A system set up for systemd-boot, with its UKIs and Type 1 entries, can
also be started without systemd-boot: for example from a fallback
firmware entry that goes through a distribution's signed shim and GRUB,
with GRUB booting the kernel and initramfs from its own configuration
on the ESP, while shim doesn't trust the system's own key yet. GRUB is
then the only loader that ran and names itself in LoaderInfo, and
get_bootloader() took any LoaderInfo other than systemd-boot's or GRUB
CC's for a GRUB system. bootc then looked for a GRUB configuration
under /boot that doesn't exist, so bootc status failed on those starts,
and with it upgrade, switch and rollback.

For a generic GRUB, also probe the filesystem as the non-EFI case does,
and treat the entries as BLS-compatible when /boot/loader/entries is a
directory and there's no GRUB directory next to it. A GRUB that has its
own directory is still classified as GRUB.

Assisted-by: AI
Signed-off-by: Kristof Imeri <kristof@lanth.me>
@krissedout
krissedout force-pushed the composefs-signed-grub branch from efdb62a to 5722c58 Compare November 13, 2026 23:47

This branch has not been deployed

No deployments
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