Skip to content

Commit 6e74964

Browse files
committed
install: mount separate boot partition to /sysroot/boot on ostree
If we're installing alongside existing ostree and there's a separate boot partition, we need to mount it to the sysroot's /boot so ostree can write bootloader entries there. Signed-off-by: Huijing Hei <[email protected]>
1 parent 336eb6d commit 6e74964

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

crates/lib/src/install.rs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -769,6 +769,17 @@ async fn initialize_ostree_root(state: &State, root_setup: &RootSetup) -> Result
769769
// Another implementation: https://github.com/coreos/coreos-assembler/blob/3cd3307904593b3a131b81567b13a4d0b6fe7c90/src/create_disk.sh#L295
770770
crate::lsm::ensure_dir_labeled(rootfs_dir, "", Some("/".into()), 0o755.into(), sepolicy)?;
771771

772+
// If we're installing alongside existing ostree and there's a separate boot partition,
773+
// we need to mount it to the sysroot's /boot so ostree can write bootloader entries there
774+
if has_ostree && root_setup.boot.is_some() {
775+
if let Some(boot) = &root_setup.boot {
776+
let source_boot = &boot.source;
777+
let target_boot = root_setup.physical_root_path.join(BOOT);
778+
tracing::debug!("Mount {source_boot} to {target_boot} on ostree");
779+
bootc_mount::mount(source_boot, &target_boot)?;
780+
}
781+
}
782+
772783
// And also label /boot AKA xbootldr, if it exists
773784
if rootfs_dir.try_exists("boot")? {
774785
crate::lsm::ensure_dir_labeled(rootfs_dir, "boot", None, 0o755.into(), sepolicy)?;

0 commit comments

Comments
 (0)