From 558fc6da592fa7e16ac8418f0e229cc7817a9451 Mon Sep 17 00:00:00 2001 From: Asya Date: Sat, 17 Dec 2022 10:24:34 +0300 Subject: [PATCH] Stop assuming that udisks2 automatically mounted filesystem --- repbuild/src/main.rs | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/repbuild/src/main.rs b/repbuild/src/main.rs index 48d25dc..c1c0bae 100644 --- a/repbuild/src/main.rs +++ b/repbuild/src/main.rs @@ -147,12 +147,12 @@ fn main() -> Result<(), Box> { .path(&filesystem)? .build()?; - // Obtain mountpoint - let mountpoint = loop { - if let Some(m) = fsproxy.mount_points()?.get(0) { - break m.to_string(); - } - }; + // Mount the filesystem + let mountpoint = fsproxy.mount(MountOptions { + no_user_interaction: true, + fs_type: String::new(), + mount_options: String::new(), + })?; // copy ./base/* over to ./disk Command::new("sh") @@ -363,12 +363,12 @@ fn main() -> Result<(), Box> { .path(&parts[0])? .build()?; - // Obtain mountpoint - let mountpoint = loop { - if let Some(m) = fsproxy.mount_points()?.get(0) { - break m.to_string(); - } - }; + // Mount the filesystem + let mountpoint = fsproxy.mount(MountOptions { + no_user_interaction: true, + fs_type: String::new(), + mount_options: String::new(), + })?; // copy the kernel over to ./disk/boot/kernel Command::new("cp")