From cd0285cc0b1cd6c0e4bcf05cd0f5f9d24b96e5ac Mon Sep 17 00:00:00 2001 From: Christian Werner Date: Fri, 19 Jun 2026 03:55:26 +0200 Subject: [PATCH] feat(ci): Add arm64 emulation and multi-arch kernel build support Introduce arm64 emulation setup and enhance the kernel build workflow to support multi-architecture builds. Updated the process to use Docker copy commands for compatibility with docker-in-docker environments, ensuring accurate context access and successful compilation. --- .gitea/workflows/build-kernel.yml | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/.gitea/workflows/build-kernel.yml b/.gitea/workflows/build-kernel.yml index b57019a..e53cdbd 100644 --- a/.gitea/workflows/build-kernel.yml +++ b/.gitea/workflows/build-kernel.yml @@ -38,7 +38,28 @@ jobs: env: HEADERS_PKG: ${{ env.HEADERS_PKG }} KERNEL_VERSION: ${{ matrix.kernel_version }} - run: ./build-in-docker.sh + run: | + set -eux + # arm64 emulation for the builder image (no-op if already registered). + if [ ! -e /proc/sys/fs/binfmt_misc/qemu-aarch64 ]; then + docker run --privileged --rm tonistiigi/binfmt --install arm64 + fi + # Builder image: toolchain + matching raspberrypi kernel headers. + docker build --platform linux/arm64 \ + --build-arg HEADERS_PKG="$HEADERS_PKG" \ + --build-arg KERNEL_VERSION="$KERNEL_VERSION" \ + -t iec-kbuild . + # Compile inside the container. We use `docker cp` instead of the bind + # mount that build-in-docker.sh uses for local builds: under the runner's + # docker-in-docker, /workspace is a volume the host daemon can't see, so + # `-v "$PWD:/build"` mounts an empty dir and make finds no Makefile. + cid=$(docker create --platform linux/arm64 --entrypoint sleep iec-kbuild infinity) + docker start "$cid" + docker cp ./. "$cid:/build" + docker exec "$cid" /usr/local/bin/docker-entrypoint.sh clean + docker exec "$cid" /usr/local/bin/docker-entrypoint.sh + docker cp "$cid:/build/iec_listener.ko" ./iec_listener.ko + docker rm -f "$cid" - name: Stage build output (modules/iec_listener_.ko) working-directory: kernel