+13
-17
@@ -43,10 +43,10 @@ pub(crate) fn build(BuildCmd { kind, name, init }: BuildCmd) -> Result<()> {
|
||||
ImageKind::Qcow2 => build_qcow2(image, &mount_path),
|
||||
};
|
||||
|
||||
let unmounted = Command::new("podman")
|
||||
.args(["unshare", "--", "podman", "image", "unmount", image])
|
||||
.output()
|
||||
.is_ok_and(|out| out.status.success());
|
||||
let unmounted = cmd(&[
|
||||
"podman", "unshare", "--", "podman", "image", "unmount", image,
|
||||
])
|
||||
.is_ok();
|
||||
if unmounted {
|
||||
println!("Unmounted image.");
|
||||
} else {
|
||||
@@ -137,19 +137,15 @@ fn build_initrd(image: &str, mount_path: &Path) -> Result<()> {
|
||||
println!("Registry: {}", reg_dir.display());
|
||||
|
||||
let vmlinuz_dst = reg_dir.join("vmlinuz");
|
||||
let cp_status = Command::new("podman")
|
||||
.args([
|
||||
"unshare",
|
||||
"--",
|
||||
"cp",
|
||||
&vmlinuz_src,
|
||||
vmlinuz_dst.to_str().context("registry path is not UTF-8")?,
|
||||
])
|
||||
.status()
|
||||
.context("Failed to copy vmlinuz out of the image mount")?;
|
||||
if !cp_status.success() {
|
||||
bail!("Failed to copy vmlinuz to registry");
|
||||
}
|
||||
cmd(&[
|
||||
"podman",
|
||||
"unshare",
|
||||
"--",
|
||||
"cp",
|
||||
&vmlinuz_src,
|
||||
vmlinuz_dst.to_str().context("registry path is not UTF-8")?,
|
||||
])
|
||||
.context("Failed to copy vmlinuz out of the image mount")?;
|
||||
println!("Copied vmlinuz -> {}", vmlinuz_dst.display());
|
||||
|
||||
// Pack the rootfs as a gzipped newc cpio archive; vmlinuz is excluded
|
||||
|
||||
Reference in New Issue
Block a user