install: pull grubconfigs from the source root#990
Conversation
There was a problem hiding this comment.
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.
363c32c to
b9e02e8
Compare
|
/gemini review |
There was a problem hiding this comment.
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.
|
With this patch the static configs are copied from the source root when called from bootc : (my local environnement does not have |
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
b9e02e8 to
e855c6c
Compare
| #[context("Installing static GRUB configs")] | ||
| pub(crate) fn install( | ||
| target_root: &openat::Dir, | ||
| src_root: Option<&openat::Dir>, |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
I wasn't aware of that, good to know. I just went with what was existing in the code :)
When doing install with the
--src-rootargument, make sure grub static configs are copied from the source root rather than the running root.See bootc-dev/bootc#1559