Thanks to visit codestin.com
Credit goes to github.com

Skip to content

install: pull grubconfigs from the source root#990

Merged
cgwalters merged 1 commit into
coreos:mainfrom
jbtrystram:src_root_static_configs
Aug 29, 2025
Merged

install: pull grubconfigs from the source root#990
cgwalters merged 1 commit into
coreos:mainfrom
jbtrystram:src_root_static_configs

Conversation

@jbtrystram

Copy link
Copy Markdown
Member

When doing install with the --src-root argument, make sure grub static configs are copied from the source root rather than the running root.

See bootc-dev/bootc#1559

@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 aims to source grub configs from a specified source root. The changes correctly plumb the src_root argument down to grubconfigs::install. However, the implementation within grubconfigs::install is flawed. It incorrectly uses absolute paths when trying to access files within src_root, which means it will continue to read from the host filesystem, defeating the purpose of the change. I've left a detailed comment on how to fix this.

@jbtrystram jbtrystram force-pushed the src_root_static_configs branch from 363c32c to b9e02e8 Compare August 29, 2025 08:55
@coreos coreos deleted a comment from gemini-code-assist Bot Aug 29, 2025
@jbtrystram

Copy link
Copy Markdown
Member Author

/gemini review

@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 correctly implements the logic to pull grub configurations from a specified source root during installation. The changes are well-contained within the grubconfigs module, and the call sites are updated accordingly. The overall approach is sound. I have one suggestion to improve the robustness of the file copying logic by avoiding a potentially racy API call.

Comment thread src/grubconfigs.rs Outdated
@jbtrystram

Copy link
Copy Markdown
Member Author

With this patch the static configs are copied from the source root when called from bootc :

Installing bootloader via bootupd
Added 01_users.cfg
Added 05_ignition.cfg
Added 10_blscfg.cfg
Added 14_menu_show_once.cfg
Added 30_uefi-firmware.cfg
Added 41_custom.cfg
Installed: grub.cfg
Installed: bootuuid.cfg
Installed: "fedora/grub.cfg"
Installed: "fedora/bootuuid.cfg"

(my local environnement does not have 05_ignition.cfg)

When doing install with the `--src-root` argument, make sure grub static
configs are copied from the source root rather than the running root.

See bootc-dev/bootc#1559
Comment thread src/grubconfigs.rs
#[context("Installing static GRUB configs")]
pub(crate) fn install(
target_root: &openat::Dir,
src_root: Option<&openat::Dir>,

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.

Yeah one problem we keep getting bit by here is that the openat crate is old and unmaintained, I'd like to move this project over to cap-std which we use extensively in bootc at least.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I wasn't aware of that, good to know. I just went with what was existing in the code :)

@cgwalters cgwalters merged commit 42f5536 into coreos:main Aug 29, 2025
10 of 12 checks passed
@HuijingHei HuijingHei mentioned this pull request Sep 8, 2025
41 tasks
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.

2 participants