Skip to content

Commit 2599c92

Browse files
committed
install: Trim bind/btrfs mount information
This happens with btrfs subvolumes for the root; we'll need to handle that separately. Signed-off-by: Colin Walters <[email protected]>
1 parent 6c0b7f3 commit 2599c92

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

lib/src/install.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -967,6 +967,15 @@ pub(crate) async fn install_to_filesystem(opts: InstallToFilesystemOpts) -> Resu
967967
// for GRUB (BIOS) and in the future zipl (I think).
968968
let backing_device = {
969969
let mut dev = inspect.source;
970+
// Hack: trim bind mount information from source
971+
if dev.contains('[') {
972+
dev = inspect
973+
.sources
974+
.into_iter()
975+
.flatten()
976+
.next()
977+
.ok_or_else(|| anyhow!("Expected `sources` in findmnt output"))?;
978+
}
970979
loop {
971980
tracing::debug!("Finding parents for {dev}");
972981
let mut parents = crate::blockdev::find_parent_devices(&dev)?.into_iter();

lib/src/mount.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ pub(crate) struct Findmnt {
2525
pub(crate) fn inspect_filesystem(path: &Utf8Path) -> Result<Filesystem> {
2626
tracing::debug!("Inspecting {path}");
2727
let o = Command::new("findmnt")
28-
.args(["-J", "--output-all", path.as_str()])
28+
.args(["-J", "-v", "--output-all", path.as_str()])
2929
.output()?;
3030
let st = o.status;
3131
if !st.success() {

0 commit comments

Comments
 (0)