Skip to content

Only do "booted BIOS with no update" check during actual update#1096

Merged
cgwalters merged 1 commit into
coreos:mainfrom
alexlarsson:fix-bios-check
May 21, 2026
Merged

Only do "booted BIOS with no update" check during actual update#1096
cgwalters merged 1 commit into
coreos:mainfrom
alexlarsson:fix-bios-check

Conversation

@alexlarsson
Copy link
Copy Markdown
Contributor

This fixes #1035 which introduced this check, but did so in every query_update(). However, that is called from non-update places too. In particular from install(), which causes bootc-image-builder to break if used on non-EFI systems.

Instead we break out the check to a separate component function query_requires_update() which is only called in the update-with-missing-component case.

@openshift-ci
Copy link
Copy Markdown

openshift-ci Bot commented May 19, 2026

Hi @alexlarsson. Thanks for your PR.

I'm waiting for a coreos member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work.

Tip

We noticed you've done this a few times! Consider joining the org to skip this step and gain /lgtm and other bot rights. We recommend asking approvers on your previous PRs to sponsor you.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

Copy link
Copy Markdown

@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 a new query_requires_update method to the Component trait, with specific implementations for BIOS and EFI components. This method is utilized to validate update requirements when no update metadata is found. A review comment correctly identified a typo in a code comment within the EFI implementation that incorrectly referenced BIOS instead of EFI.

Comment thread src/efi.rs Outdated
Copy link
Copy Markdown
Member

@Johan-Liebert1 Johan-Liebert1 left a comment

Choose a reason for hiding this comment

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

One nit, else lgtm

Comment thread src/component.rs
fn query_update(&self, sysroot: &openat::Dir) -> Result<Option<ContentMetadata>>;

/// Used on the client to query if the booted systems requires an update of this component
fn query_requires_update(&self, sysroot: &openat::Dir) -> Result<()>;
Copy link
Copy Markdown
Member

@Johan-Liebert1 Johan-Liebert1 May 20, 2026

Choose a reason for hiding this comment

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

imo we should accept Option<ContentMetadata> here so that we only return an error if the metadata is None. Otherwise just looking at the function, it's hard to figure out why we just error our if sys/firmware/efi doesn't exist for BIOS, when it not existing would always be true for BIOS booted systems

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.

Then the caller is quite weird if it always calls query_update() and then query_requires_update(). Right now it only calls query_requires_update() if metadata is None. If you want to do it like that, then I think having query_requires_update() call query_update() and then do the check is better than having to call both and passing the metadata forward.

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.

Right now it only calls query_requires_update() if metadata is None

right, and this is a little weird to me as it's not documented. Maybe the best approach is to simply document this in the function comments? Something like This function assumes that metadata for the component was None. It then throws an error if the system was booted with "component"?

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.

I pushed a new version with the function comment having a bit more detail for when this is called and what it should do.

This fixes coreos#1035 which
introduced this check, but did so in every query_update(). However,
that is called from non-update places too. In particular from
install(), which causes bootc-image-builder to break if used on
non-EFI systems.

Instead we break out the check to a separate component function
query_requires_update() which is only called in the
update-with-missing-component case.
@travier
Copy link
Copy Markdown
Member

travier commented May 21, 2026

It feels to me that we are working around the fact that we added this as a quick workaround but what we really need is #1040 instead.

@cgwalters
Copy link
Copy Markdown
Member

It feels to me that we are working around the fact that we added this as a quick workaround but what we really need is #1040 instead.

We need both though right? Or at least we need something like this which removes the dynamic check.

@cgwalters cgwalters enabled auto-merge May 21, 2026 17:22
@cgwalters cgwalters disabled auto-merge May 21, 2026 17:39
@cgwalters cgwalters enabled auto-merge May 21, 2026 17:59
@cgwalters
Copy link
Copy Markdown
Member

/ok-to-test

@cgwalters cgwalters merged commit 969d7c2 into coreos:main May 21, 2026
11 of 12 checks passed
codelinaro-mirror-sync Bot pushed a commit to CodeLinaro-mirror/le_centos_automotive_src_automotive-image-builder that referenced this pull request May 25, 2026
This is a temporary fix for bootupd 0.2.34 until
coreos/bootupd#1096 is in the repo. It fixes
bootupd failing inside to-disk-image if there is no /sys/firmware/efi
on the build machine.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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

4 participants