mirror of
https://github.com/ps5-linux/ps5-linux-image.git
synced 2026-07-16 06:00:42 +00:00
Initial commit
This commit is contained in:
23
docker/kernel-builder/Dockerfile
Normal file
23
docker/kernel-builder/Dockerfile
Normal 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"]
|
||||
28
docker/kernel-builder/build.sh
Normal file
28
docker/kernel-builder/build.sh
Normal 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 ==="
|
||||
Reference in New Issue
Block a user