fix-build #4

Merged
chris merged 10 commits from fix-build into master 2026-06-20 05:51:53 +02:00
Showing only changes of commit f91b06da9d - Show all commits

View File

@ -51,23 +51,31 @@ jobs:
if [ ! -e /proc/sys/fs/binfmt_misc/qemu-aarch64 ]; then if [ ! -e /proc/sys/fs/binfmt_misc/qemu-aarch64 ]; then
docker run --privileged --rm tonistiigi/binfmt --install arm64 docker run --privileged --rm tonistiigi/binfmt --install arm64
fi fi
# Per-version image tag. The matrix entries can run concurrently on a
# single runner sharing one Docker daemon; a fixed tag (e.g. iec-kbuild)
# is then a shared mutable name and the builds race — whichever `docker
# build` finishes last wins the tag, so both `docker create` calls
# resolve to the same image and every job emits the same vermagic.
# A unique tag per kernel version isolates them.
img="iec-kbuild:${KERNEL_VERSION//[:\/]/-}"
# Builder image: toolchain + matching raspberrypi kernel headers. # Builder image: toolchain + matching raspberrypi kernel headers.
docker build --platform linux/arm64 \ docker build --platform linux/arm64 \
--build-arg DEBIAN_SUITE="$DEBIAN_SUITE" \ --build-arg DEBIAN_SUITE="$DEBIAN_SUITE" \
--build-arg HEADERS_PKG="$HEADERS_PKG" \ --build-arg HEADERS_PKG="$HEADERS_PKG" \
--build-arg KERNEL_VERSION="$KERNEL_VERSION" \ --build-arg KERNEL_VERSION="$KERNEL_VERSION" \
-t iec-kbuild . -t "$img" .
# Compile inside the container. We use `docker cp` instead of the bind # 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 # 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 # 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. # `-v "$PWD:/build"` mounts an empty dir and make finds no Makefile.
cid=$(docker create --platform linux/arm64 --entrypoint sleep iec-kbuild infinity) cid=$(docker create --platform linux/arm64 --entrypoint sleep "$img" infinity)
docker start "$cid" docker start "$cid"
docker cp ./. "$cid:/build" docker cp ./. "$cid:/build"
docker exec "$cid" /usr/local/bin/docker-entrypoint.sh clean docker exec "$cid" /usr/local/bin/docker-entrypoint.sh clean
docker exec "$cid" /usr/local/bin/docker-entrypoint.sh docker exec "$cid" /usr/local/bin/docker-entrypoint.sh
docker cp "$cid:/build/iec_listener.ko" ./iec_listener.ko docker cp "$cid:/build/iec_listener.ko" ./iec_listener.ko
docker rm -f "$cid" docker rm -f "$cid"
docker rmi "$img" || true
- name: Stage build output (modules/iec_listener_<kernel_version>.ko) - name: Stage build output (modules/iec_listener_<kernel_version>.ko)
working-directory: kernel working-directory: kernel