Skip to content

Conversation

@HuijingHei
Copy link
Member

Fixes #1035

Copy link

@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 correctly implements the desired behavior of failing an update when the metadata for the current boot type is missing. The changes in src/bios.rs and src/efi.rs are clear and effective. The test case in tests/kola/test-bootupd has also been updated to reflect this new behavior for BIOS-booted systems. I've added one suggestion to make the test more robust by making it boot-aware, so it can validate the behavior on both EFI and BIOS systems.

@HuijingHei HuijingHei force-pushed the fix-update branch 3 times, most recently from c83c64a to d1fa7ad Compare January 9, 2026 08:13
get_component_update(sysroot, self)
let content_metadata = get_component_update(sysroot, self)?;
// Failed as expected if booted with BIOS and no update metadata
if content_metadata.is_none() && !sysroot.exists("sys/firmware/efi")? {
Copy link
Member

Choose a reason for hiding this comment

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

why not !is_efi_booted instead of testing the /sys path?

Copy link
Member Author

Choose a reason for hiding this comment

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

I am concern that it might be not suitable for ppc, as is_efi_booted() is for x86_64, or maybe it is better to move is_efi_booted() out of efi.rs. WDYT?

@HuijingHei HuijingHei merged commit 02617b7 into coreos:main Jan 16, 2026
12 checks passed
@HuijingHei HuijingHei deleted the fix-update branch January 16, 2026 09:28
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.

Fail updates if metadata is missing in the image for current boot type

2 participants