Skip to content

efi: Extend get_efi_vendor() to support usr/lib/efi - #991

Merged
cgwalters merged 3 commits into
coreos:mainfrom
HuijingHei:step2-prep
Sep 3, 2025
Merged

cgwalters merged 3 commits into
coreos:mainfrom
HuijingHei:step2-prep

Conversation

@HuijingHei

@HuijingHei HuijingHei commented Aug 29, 2025 •

Copy link
Copy Markdown
Contributor

Prepare for step2 (in #926) to install efi files from usr/lib/efi

@gemini-code-assist gemini-code-assist Bot 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.

Code Review

This pull request extends get_efi_vendor() to support usr/lib/efi as a new location for EFI files. The core change involves refactoring several functions, notably install() and get_efi_vendor() across components, to accept a path string (&str) instead of an openat::Dir. This is a sensible refactoring that enables more flexible path handling. The new logic in get_efi_vendor() correctly prioritizes the new path and is accompanied by thorough tests. Overall, the changes are well-implemented and consistent. I have one suggestion to improve code clarity.

Comment thread src/efi.rs Outdated

@jbtrystram jbtrystram left a comment

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.

Superficial LGTM as I don't know this codebase well, but the change look sane. Suggested a small change to avoid having to convert all the openat::Dir to str all around maybe ?

Comment thread src/component.rs Outdated
Comment thread src/component.rs Outdated
@HuijingHei
HuijingHei force-pushed the step2-prep branch 2 times, most recently from 0e41d17 to 17c571c Compare September 2, 2025 12:28
Check we do not have it in latest 9.0.20250828-0-coreos:
```
$ podman run -q --rm -it quay.io/openshift-release-dev/ocp-v4.0-art-dev:9.0.20250828-0-coreos ls /var
lib  run  tmp
```
@HuijingHei

Copy link
Copy Markdown
Contributor Author

I will merge this if there is no objection.

@travier travier left a comment

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.

Not tested but looks OK.

Comment thread Dockerfile
# Clean out the default to ensure we're using our updated content
RUN rpm -e bootupd
COPY --from=build /out/ /
# Remove /var/roothome as workaround

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.

What error is this working around?

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.

Comment thread src/efi.rs
Comment on lines +556 to +560
{
p
} else {
bail!("Failed to find valid target path");
};

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.

This is just .ok_or_else(|| anyhow!("Failed..."))

Comment thread src/efi.rs
.sub_dir(&component_updatedirname(self))
.context("opening update dir")?;
let shim_files = find_file_recursive(updated.recover_path()?, SHIM)?;
fn get_efi_vendor(&self, sysroot: &str) -> Result<Option<String>> {

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.

I don't follow why we needed to switch to taking an ambient path here.

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.

Will try to update to Path later, just thought it could be convenient to pass.

@cgwalters
cgwalters merged commit df62897 into coreos:main Sep 3, 2025
12 checks passed
HuijingHei added a commit to HuijingHei/bootupd that referenced this pull request Sep 4, 2025
HuijingHei added a commit to HuijingHei/bootupd that referenced this pull request Sep 4, 2025
HuijingHei added a commit to HuijingHei/bootupd that referenced this pull request Sep 4, 2025
@HuijingHei
HuijingHei deleted the step2-prep branch September 4, 2025 08:18
HuijingHei added a commit to HuijingHei/bootupd that referenced this pull request Sep 4, 2025
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