diff --git a/src/steps/init_os.rs b/src/steps/init_os.rs index 788e6a8..8c42c66 100644 --- a/src/steps/init_os.rs +++ b/src/steps/init_os.rs @@ -79,6 +79,12 @@ initramfs initramfs-rpi4 // bootstrap alpine run(&[ + "docker", + "run", + "--rm", + "-v", + &format!("{root}:{root}", root = &*img.root), + "alpine", "apk", "add", "--root", diff --git a/src/steps/prepare_img.rs b/src/steps/prepare_img.rs index 87342ab..07f5277 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(&["losetup", "-f", "--show", path.to_str().unwrap()])?; + let output = run_output(&["losetup", "-P", "-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();