From 583d18847438219a29ad4bbb93825c9ba2ffa2bf Mon Sep 17 00:00:00 2001 From: Valentin Haudiquet Date: Fri, 30 Oct 2026 19:10:59 +0100 Subject: [PATCH] build(snap): build the engine with blk and stage e2fsprogs The rootfs boots from a virtio-blk disk now, and the blk feature is what compiles the device into libkrun - without it krun_add_disk and krun_set_root_disk_remount have no symbols and every run fails at lookup. e2fsprogs joins the stage set for mkfs.ext4 (the cache image build) and debugfs (per-run provisioning and the control-file read); core26 ships 1.47.4, which knows how to build from a compressed tarball. --- snap/snapcraft.yaml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/snap/snapcraft.yaml b/snap/snapcraft.yaml index 55efa4f..175346d 100644 --- a/snap/snapcraft.yaml +++ b/snap/snapcraft.yaml @@ -63,6 +63,9 @@ parts: rust-channel: "1.98.1" rust-path: [crates/ecrou-cli] build-packages: [cmake, perl] + # mkfs.ext4 builds the cache image and debugfs provisions it; both + # ship in e2fsprogs and run as child processes of the binary. + stage-packages: [e2fsprogs] override-pull: | craftctl default # [workspace.package] version — the single `version = "..."` at @@ -94,7 +97,10 @@ parts: source-depth: 1 rust-channel: "1.98.1" override-build: | - cargo build --release -p libkrun --features net + # blk turns on the virtio-blk device: the rootfs crosses as a + # raw ext4 image (krun_add_disk + krun_set_root_disk_remount), + # which is what makes guest-side chown work. + cargo build --release -p libkrun --features net,blk install -Dm755 target/release/libkrun.so \ "$CRAFT_PART_INSTALL/lib/libkrun.so.1.19.7" ln -s libkrun.so.1.19.7 "$CRAFT_PART_INSTALL/lib/libkrun.so.1"