Skip to content

Commit 023a4c6

Browse files
committed
fixup! install/bootloader bind-mount rootfs to /run before chrooting
1 parent 361ff7b commit 023a4c6

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

crates/lib/src/bootloader.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -104,20 +104,18 @@ pub(crate) fn install_via_bootupd(
104104

105105
// Clean up the mounts after ourselves
106106
if let Some(target_root) = abs_deployment_path {
107-
let mut unmount_res = Ok(());
108107
for dir in bind_mount_dirs {
109108
let mount = target_root
110109
.join(dir.strip_prefix("/").unwrap())
111110
.into_std_path_buf();
112111
if let Err(e) = rustix::mount::unmount(&mount, UnmountFlags::DETACH) {
112+
// let's not propagate the error up because in some cases we can't unmount
113+
// e.g. when running `to-existing-root`
113114
tracing::warn!("Error unmounting {}: {e}", mount.display());
114-
unmount_res = Err(e.into());
115115
}
116116
}
117-
install_result.and(unmount_res)
118-
} else {
119-
install_result
120117
}
118+
install_result
121119
}
122120

123121
#[context("Installing bootloader")]

0 commit comments

Comments
 (0)