diff --git a/.github/workflows/armbian-builder.yaml b/.github/workflows/armbian-builder.yaml index ceece9a..38e3a47 100644 --- a/.github/workflows/armbian-builder.yaml +++ b/.github/workflows/armbian-builder.yaml @@ -283,7 +283,14 @@ on: jobs: build: - runs-on: ubuntu-latest + # Native arm64 runner -- the images we build are arm64, and Packer's + # arm-image plugin skips its QEMU/binfmt chroot steps entirely when + # image_arch (set in dpx-buttonode.pkr.hcl) matches the host's actual + # runtime arch (pkg/builder/builder.go: `!ImageArch.IsNative()`). On + # ubuntu-latest (x86_64), every apt-get/dpkg inside the chroot ran + # through qemu-aarch64-static emulation, which is commonly 5-10x + # slower than native for that kind of CPU-bound work. + runs-on: ubuntu-24.04-arm permissions: contents: read outputs: @@ -294,7 +301,15 @@ jobs: - name: Checkout repository uses: actions/checkout@v4 - # ARM emulation is required to chroot into the ARM64 Armbian image + # Still needed even on a native arm64 runner: the plugin's Prepare() + # step unconditionally resolves a qemu_binary path via exec.LookPath + # regardless of whether it'll actually be used later -- only its + # separate Run()-time IsNative() check decides whether QEMU is + # actually invoked for the chroot. Without this installed, Prepare() + # falls back to an "embedded qemu" feature that's amd64-only and + # fails outright on arm64 (confirmed: "embedded qemu is not + # available - currently, embedded qemu is only available for linux + # amd64"). This is just a fast package install, not the slow part. - name: Install QEMU user-static run: sudo apt-get update -q && sudo apt-get install -y qemu-user-static diff --git a/.github/workflows/raspios-builder.yaml b/.github/workflows/raspios-builder.yaml index 459e766..9e548cb 100644 --- a/.github/workflows/raspios-builder.yaml +++ b/.github/workflows/raspios-builder.yaml @@ -41,7 +41,12 @@ on: jobs: build: - runs-on: ubuntu-latest + # See armbian-builder.yaml's build job for why: native arm64 runner + # lets Packer's arm-image plugin skip QEMU/binfmt entirely + # (image_arch in dpx-buttonode.pkr.hcl matches the host arch), instead + # of emulating every chroot apt-get/dpkg call via qemu-aarch64-static + # on an x86_64 runner. + runs-on: ubuntu-24.04-arm permissions: contents: read outputs: @@ -52,8 +57,9 @@ jobs: - name: Checkout repository uses: actions/checkout@v4 - # ARM emulation is required to chroot into the ARM64 image, same as - # the Armbian pipeline -- unrelated to which OS built the base image. + # Still needed on a native arm64 runner -- see armbian-builder.yaml's + # build job for why (Prepare()-time qemu_binary resolution is + # unconditional, only actual usage is skipped on native arch). - name: Install QEMU user-static run: sudo apt-get update -q && sudo apt-get install -y qemu-user-static diff --git a/dpx-buttonode.pkr.hcl b/dpx-buttonode.pkr.hcl index a7a46c3..b309098 100644 --- a/dpx-buttonode.pkr.hcl +++ b/dpx-buttonode.pkr.hcl @@ -73,6 +73,7 @@ source "arm-image" "base" { iso_url = var.url target_image_size = var.variant == "full" ? 8000000000 : 5000000000 output_filename = "output-dpx-buttonode/dpx-buttonode.img" + image_arch = "arm64" qemu_binary = "qemu-aarch64-static" image_mounts = var.image_mounts