Initial commit

This commit is contained in:
Dan
2026-04-26 10:25:41 +02:00
commit 2a39fc1294
37 changed files with 10890 additions and 0 deletions

View File

@@ -0,0 +1,23 @@
FROM ubuntu:24.04
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential bc bison flex kmod cpio gawk \
libdw-dev libelf-dev libssl-dev \
python3 rsync dpkg-dev debhelper zstd \
perl git xz-utils ccache \
&& rm -rf /var/lib/apt/lists/*
ENV PATH="/usr/lib/ccache:${PATH}"
ENV CCACHE_DIR=/ccache
WORKDIR /src
# Kernel source is bind-mounted at /src
# Build artifacts are staged to /out/staging
COPY docker/kernel-builder/build.sh /build.sh
RUN chmod +x /build.sh
CMD ["/build.sh"]

View File

@@ -0,0 +1,28 @@
#!/bin/bash
# Compiles the kernel and stages all artifacts into /out/staging.
# Runs inside Docker; kernel source is bind-mounted at /src.
set -e
# Clean host-built tool artifacts that may reference wrong include paths
make -C tools/objtool clean 2>/dev/null || true
make olddefconfig
make -j"$(nproc)" bzImage modules
# Stage all artifacts so downstream packagers don't need to run make
echo "=== Staging build artifacts ==="
rm -rf /out/staging
mkdir -p /out/staging/boot
cp arch/x86/boot/bzImage /out/staging/boot/
cp System.map /out/staging/
cp .config /out/staging/
make modules_install INSTALL_MOD_PATH=/out/staging INSTALL_MOD_STRIP=1
# Remove dangling symlinks back into the source tree
KVER=$(make -s kernelrelease)
rm -f "/out/staging/lib/modules/$KVER/build" \
"/out/staging/lib/modules/$KVER/source"
echo "=== Build artifacts staged in /out/staging ==="