Progress
CI / build (push) Successful in 14s

This commit is contained in:
2026-09-04 17:01:46 +02:00
parent 286def05c1
commit 7dd818db68
7 changed files with 170 additions and 24 deletions
+13 -17
View File
@@ -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