From 45da6cbc04c767faee78462bd3c706a19ccb58d7 Mon Sep 17 00:00:00 2001 From: Dominic Date: Fri, 21 Apr 2023 14:36:08 +0200 Subject: [PATCH] replace udisksctl with losetup for docker-friendliness --- src/steps/mod.rs | 2 +- src/steps/prepare_img.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/steps/mod.rs b/src/steps/mod.rs index 83ac63d..1c4682d 100644 --- a/src/steps/mod.rs +++ b/src/steps/mod.rs @@ -134,7 +134,7 @@ impl Deref for LoopDevice { impl Drop for LoopDevice { fn drop(&mut self) { - let res = run(&["udisksctl", "loop-delete", "--no-user-interaction", "-b", self]); + let res = run(&["losetup", "-d", self]); if let Err(err) = res { eprintln!("Failed to free loop device {}: {err}", self.0); } diff --git a/src/steps/prepare_img.rs b/src/steps/prepare_img.rs index ef569db..87342ab 100644 --- a/src/steps/prepare_img.rs +++ b/src/steps/prepare_img.rs @@ -22,7 +22,7 @@ pub fn prepare_img() -> anyhow::Result { run_parted!(path, "mkpart", "primary", "ext4", "128M", &size)?; // create a loopback device - let output = run_output(&["udisksctl", "loop-setup", "--no-user-interaction", "-f", path.to_str().unwrap()])?; + let output = run_output(&["losetup", "-f", "--show", path.to_str().unwrap()])?; print!("{output}"); let idx = output.find("/dev/loop").ok_or_else(|| anyhow!("Unable to identify loop device"))?; let mut end = idx + "/dev/loop".len();