From 4eefd8816b23f6c844efe9cf354f4e55b58f2d5a Mon Sep 17 00:00:00 2001 From: Kemal Yaylali Date: Sun, 16 Aug 2026 18:34:38 +0100 Subject: [PATCH] Fix image build: pi-gen wants qemu-user-binfmt, not qemu-user-static The first CI build failed in under a second with 'Required dependencies not installed: qemu-user-binfmt'. pi-gen checks for the binfmt handler rather than the emulator binary, and I had guessed the package name. The list now comes from pi-gen's own depends file at the pinned commit, and the workflow asserts the aarch64 handler is registered before spending an hour discovering it is not. --- .github/workflows/image.yml | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/.github/workflows/image.yml b/.github/workflows/image.yml index 66fe850..2e9d027 100644 --- a/.github/workflows/image.yml +++ b/.github/workflows/image.yml @@ -43,10 +43,18 @@ jobs: - name: Install build dependencies run: | sudo apt-get update + # Taken from pi-gen's own `depends` file at the pinned commit rather + # than guessed. My first attempt installed qemu-user-static, and + # pi-gen wants qemu-user-binfmt: it checks for the binfmt handler, not + # the emulator binary, and failed in under a second. sudo apt-get install -y --no-install-recommends \ - coreutils quilt parted qemu-user-static debootstrap zerofree zip \ - dosfstools libarchive-tools libcap2-bin grep rsync xz-utils file \ - git curl bc gpg pigz kpartx arch-test + quilt parted coreutils qemu-user-binfmt debootstrap zerofree zip \ + dosfstools e2fsprogs libcap2-bin libarchive-tools grep rsync \ + xz-utils curl xxd file git kmod bc gpg pigz arch-test + # Prove the handler is actually registered before spending an hour. + test -f /proc/sys/fs/binfmt_misc/qemu-aarch64 \ + || sudo systemctl restart systemd-binfmt || true + ls /proc/sys/fs/binfmt_misc/ | head # Pinned to a commit, not a branch. An image other people flash should not # change because an upstream branch moved between builds.