Skip to content

Conversation

@bgartzi
Copy link
Contributor

@bgartzi bgartzi commented Jan 14, 2026

Fixes #60 and #63

@bgartzi bgartzi force-pushed the esp-alternate_locations branch from 71e9035 to 419e4b8 Compare January 14, 2026 11:09
@bgartzi
Copy link
Contributor Author

bgartzi commented Jan 14, 2026

The problem is that the image that the tests proposed here depend on will likely be garbage collected sooner than later.

lib/src/esp.rs Outdated

const ESP_VENDOR_NAMES: [&str; 2] = ["redhat", "fedora"];
fn find_efi_bin(root_path: &Path, bin_name: &str) -> io::Result<PathBuf> {
let glob_path = root_path.join(Path::new("**/EFI/*/").join(bin_name));
Copy link
Member

Choose a reason for hiding this comment

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

That feels a bit too broad. Let search in two places like below?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It might be variable naming thing, root path was supposed to be the root of the search path, not the fs root. I updated the variable name to search_path.

In the end, find_efi_bin will receive "usr/lib/bootupd/updates/" or "usr/lib/efi" based on which of them exists (giving priority to the former/old).

const RELATIVE_KERNELS_PATH: &str = "usr/lib/modules/";
const RELATIVE_ESP_PATH: &str = "usr/lib/bootupd/updates/";
const RELATIVE_ESP_OLD: &str = "usr/lib/bootupd/updates/";
// From fcos-43 on shim/grub are stored in different directories
Copy link
Member

Choose a reason for hiding this comment

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

You can link to https://fedoraproject.org/wiki/Changes/BootLoaderUpdatesPhase1.

I should be from Fedora 44.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixing...

Copy link
Member

Choose a reason for hiding this comment

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

OK I missed that coreos/bootupd#995 landed in F43 and that makes this also apply to F43.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That's why I probably saw it happen in some testing stream images. It's not yet in stable, right?

From fcos 44, shim and grub are not longer located in /usr/lib/bootupd..
but in /usr/lib/efi/..

This commit adds some changes to be able to find shim and grub binaries
both under the old and new image fs hierarchy.

Note that as for the kernel images, the first found shim and grub are
returned.

Signed-off-by: Beñat Gartzia Arruabarrena <[email protected]>
@bgartzi bgartzi force-pushed the esp-alternate_locations branch from 419e4b8 to 9e07661 Compare January 21, 2026 16:23
Only fetching ociarchive images and then loading them into the local
podman registry was allowed. We would also like to directly pull from a
registry in some cases though.

Try podman pull and fall back into the previous logic if that does not
happen to work.

Signed-off-by: Beñat Gartzia Arruabarrena <[email protected]>
This is an image that will be likely garbage collected.

However, this aims to be a demonstration that the previously added logic
works properly on fedora coreos images in which grub and shim images are
not longer stored under /usr/lib/bootupd/...

Signed-off-by: Beñat Gartzia Arruabarrena <[email protected]>
@bgartzi bgartzi force-pushed the esp-alternate_locations branch from 9e07661 to 3ba9a00 Compare January 22, 2026 08:06
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.

Find ESP successfuly in non stable fcos images

2 participants