Skip to content

Commit e434632

Browse files
committed
grubconfig: should use /sysroot for the physical root
Get hints from bootc code https://github.com/bootc-dev/bootc/blob/main/crates/lib/src/install.rs#L2017
1 parent 1768f31 commit e434632

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/grubconfigs.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,10 @@ pub(crate) fn install(
3131
write_uuid: bool,
3232
) -> Result<()> {
3333
let bootdir = &target_root.sub_dir("boot").context("Opening /boot")?;
34+
// Should use /sysroot for the physical root
35+
let rootdir = &target_root.sub_dir("sysroot").context("Opening /sysroot")?;
3436
let boot_is_mount = {
35-
let root_dev = target_root.self_metadata()?.stat().st_dev;
37+
let root_dev = rootdir.self_metadata()?.stat().st_dev;
3638
let boot_dev = bootdir.self_metadata()?.stat().st_dev;
3739
log::debug!("root_dev={root_dev} boot_dev={boot_dev}");
3840
root_dev != boot_dev

0 commit comments

Comments
 (0)