Skip to content

store: Treat SystemNotUEFI like a missing LoaderDevicePartUUID - #2602

Open
dustinkirkland wants to merge 2 commits into
bootc-dev:mainfrom
dustinkirkland:dustin.kirkland/composefs-esp-non-efi
Open

dustinkirkland wants to merge 2 commits into
bootc-dev:mainfrom
dustinkirkland:dustin.kirkland/composefs-esp-non-efi

Conversation

@dustinkirkland

@dustinkirkland dustinkirkland commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

Closes #2605.

find_booted_from_esp() (3b40e99, first in v1.17.2) falls back to searching the colocated ESPs when LoaderDevicePartUUID is missing, but treats SystemNotUEFI as fatal. So on a system that isn't booted via UEFI, every composefs bootc status, upgrade and rollback fails at storage init.

Two commits:

  1. Move the decision into a small pure function with a table-driven test. No functional change.
  2. Treat SystemNotUEFI like MissingVar, the way classify_bootloader() already does.

Verification: Raspberry Pi 5 (aarch64), kernel booted directly by the Pi firmware, composefs install with BLS entries on an ESP-typed FAT partition. With 1.17.3:

  • bootc status fails with SystemNotUEFI.
  • 1.17.3 with this patch: bootc status and bootc upgrade --check work on the same boot.

bootc-lib unit tests pass for each commit, and cargo fmt --check is clean.

The test-upgrade (centos-10, ostree) failure (and the required-checks jobs that aggregate it) also fails on other open PRs right now. Its error is the signature check on registry.access.redhat.com/ubi9/podman.

Assisted-by: AI
I reviewed all of this and it makes sense to me; I've tested it extensively.

cgwalters
cgwalters previously approved these changes Oct 30, 2026
@cgwalters
cgwalters marked this pull request as ready for review October 30, 2026 16:41
Copilot AI balanced review requested due to automatic review settings October 30, 2026 16:41
@cgwalters

Copy link
Copy Markdown
Member

Right, even though our CI matrix is huge, we are clearly missing a BIOS + composefs case. Could probably be a postsubmit.

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

There are no active review issues for the non-UEFI ESP-discovery fallback.

No open issues 🎉

What changed in this PR

This PR restores composefs operations on non-UEFI systems that store boot entries on an EFI System Partition (ESP), by allowing ESP discovery to fall back when EFI variables are unavailable.

Changes:

  • Treats SystemNotUEFI like MissingVar, searching the root disk’s ESPs instead of failing.
  • Extracts the EFI-result decision into a pure helper while preserving other error handling.
  • Adds unit coverage for successful reads, both fallback conditions, and propagation of other errors.
File Description
crates/​lib/​src/​store/​mod.rs Adds the non-UEFI ESP-discovery fallback, a decision helper, and unit tests.

Review effort: Balanced

…m_esp

Prep for treating SystemNotUEFI like MissingVar; splitting the decision
from the I/O makes it unit-testable.

No functional change.

Assisted-by: AI
Signed-off-by: Dustin Kirkland <dustin.kirkland@chainguard.dev>
find_booted_from_esp (3b40e99, "store: Select the booted ESP via
LoaderDevicePartUUID") falls back to searching the colocated ESPs when
the variable is missing, but treats SystemNotUEFI as fatal. On a system
not booted via UEFI, storage init fails, and with it every composefs
`bootc status`, `upgrade` and `rollback`:

  error: Status: Finding ESP used for booting: Reading
  LoaderDevicePartUUID-4a67b082-0a4c-41cf-b6c7-440b29bb8c4f: SystemNotUEFI

Seen on a Raspberry Pi 5 that boots its kernel directly from the Pi
firmware with the BLS entries on an ESP-typed FAT partition, after
moving from bootc 1.17.1 to 1.17.3. It has no EFI variables, but the
colocated-ESP fallback finds its ESP, as find_first_colocated_esp() did
before 3b40e99. classify_bootloader already treats SystemNotUEFI and
MissingVar alike for EFI_LOADER_INFO.

Closes: bootc-dev#2605

Assisted-by: AI
Signed-off-by: Dustin Kirkland <dustin.kirkland@chainguard.dev>
@dustinkirkland
dustinkirkland force-pushed the dustin.kirkland/composefs-esp-non-efi branch from 15078eb to 655a94f Compare October 30, 2026 18:11
@Johan-Liebert1

Copy link
Copy Markdown
Member

Right, even though our CI matrix is huge, we are clearly missing a BIOS + composefs case

we don't support composefs for BIOS at all right now. We have assumptions all over the code base that and EFI partition will be present

@dustinkirkland

Copy link
Copy Markdown
Contributor Author

I'm happy to help identify and work through the breakages / fixes. So far, this patch is what we need. I'm happy to keep sending fixes.

@dustinkirkland

Copy link
Copy Markdown
Contributor Author

Oh! And to clarify: this is not BIOS. The ESP is present on the Pi 5; its firmware just doesn't provide EFI variables.

@cgwalters

Copy link
Copy Markdown
Member

we don't support composefs for BIOS at all right now. We have assumptions all over the code base that and EFI partition will be present

OK right, my bad. I think we are going to need to support this though in the future so we can complete an ostree transition.

The ESP is present on the Pi 5; its firmware just doesn't provide EFI variables.

Got it.

fn booted_esp_partuuid(efi_var: Result<String, EfiError>) -> Result<Option<String>> {
match efi_var {
Ok(u) => Ok(Some(u)),
Err(EfiError::MissingVar) | Err(EfiError::SystemNotUEFI) => Ok(None),

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.

Doesn't EfiError::SystemNotUEFI imply there's no EFI? This was treated as fatal because, currently, for composefs we hard require an ESP

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.

Okay, my bad, read the issue about raspberry pi. I still think we should special case this and make EfiError::SystemNotUEFI fatal

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Thanks. The ESP is still required here: for SystemNotUEFI this doesn't skip the ESP, it searches the root device's ESPs and fails with "No ESP found" (or "Failed to find bootc owned ESP") if none is ours. So a BIOS install without an ESP still errors. It's also how classify_bootloader already treats SystemNotUEFI for this same Raspberry Pi case; this makes find_booted_from_esp agree with it. (1.17.2 through 1.17.4 fail every bootc command on these boards.)

If you'd still rather keep it explicit, I can either:

  • keep SystemNotUEFI fatal unless exactly one colocated ESP holding bootc's BLS entries is found, or
  • keep this, and make the no-ESP error say "not booted via UEFI and no ESP found; composefs requires an ESP".

Which would you prefer?

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.

composefs: bootc status/upgrade/rollback fail with SystemNotUEFI on non-UEFI systems since 1.17.2

4 participants