Skip to content

Commit

Permalink
install: Trim bind mount information
Browse files Browse the repository at this point in the history
I'm seeing this appear when targeting from a container image.
  • Loading branch information
cgwalters committed Sep 22, 2023
1 parent 6c0b7f3 commit 198016e
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions lib/src/install.rs
Original file line number Diff line number Diff line change
Expand Up @@ -967,6 +967,15 @@ pub(crate) async fn install_to_filesystem(opts: InstallToFilesystemOpts) -> Resu
// for GRUB (BIOS) and in the future zipl (I think).
let backing_device = {
let mut dev = inspect.source;
// Hack: trim bind mount information from source
if dev.contains('[') {
dev = inspect
.sources
.into_iter()
.flatten()
.next()
.ok_or_else(|| anyhow!("Expected `sources` in findmnt output"))?;
}
loop {
tracing::debug!("Finding parents for {dev}");
let mut parents = crate::blockdev::find_parent_devices(&dev)?.into_iter();
Expand Down

0 comments on commit 198016e

Please sign in to comment.