Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 17 additions & 2 deletions .github/workflows/armbian-builder.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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

Expand Down
12 changes: 9 additions & 3 deletions .github/workflows/raspios-builder.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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

Expand Down
1 change: 1 addition & 0 deletions dpx-buttonode.pkr.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
Loading