mirror of
https://github.com/ps5-linux/ps5-linux-image.git
synced 2026-07-16 01:50:40 +00:00
add PS5 kernel build pipeline with multi-distro support and arm64 cross-compile
This commit is contained in:
@@ -7,8 +7,11 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||
libdw-dev libelf-dev libssl-dev \
|
||||
python3 rsync dpkg-dev debhelper zstd \
|
||||
perl git xz-utils ccache \
|
||||
gcc-x86-64-linux-gnu binutils-x86-64-linux-gnu libc6-dev-amd64-cross \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
ENV ARCH=x86_64
|
||||
ENV CROSS_COMPILE=x86_64-linux-gnu-
|
||||
ENV PATH="/usr/lib/ccache:${PATH}"
|
||||
ENV CCACHE_DIR=/ccache
|
||||
|
||||
@@ -18,6 +21,7 @@ WORKDIR /src
|
||||
# Build artifacts are staged to /out/staging
|
||||
|
||||
COPY docker/kernel-builder/build.sh /build.sh
|
||||
RUN chmod +x /build.sh
|
||||
COPY docker/kernel-builder/package-deb.sh /package-deb.sh
|
||||
RUN chmod +x /build.sh /package-deb.sh
|
||||
|
||||
CMD ["/build.sh"]
|
||||
|
||||
29
docker/kernel-builder/package-deb.sh
Executable file
29
docker/kernel-builder/package-deb.sh
Executable file
@@ -0,0 +1,29 @@
|
||||
#!/bin/bash
|
||||
# Builds a combined linux-ps5 .deb from the kernel source at /src.
|
||||
# Runs inside the kernel-builder container; output goes to /out.
|
||||
set -e
|
||||
|
||||
make -j$(nproc) DPKG_FLAGS=-d bindeb-pkg
|
||||
|
||||
VER=$(dpkg-deb -f "$(ls /linux-image-[0-9]*.deb | grep -v dbg | head -1)" Version)
|
||||
ARCH=$(dpkg-deb -f "$(ls /linux-image-[0-9]*.deb | grep -v dbg | head -1)" Architecture)
|
||||
KVER=$(ls /src/debian/linux-image-[0-9]*/lib/modules/ 2>/dev/null | head -1)
|
||||
|
||||
TMPDIR=$(mktemp -d)
|
||||
mkdir -p "$TMPDIR/DEBIAN"
|
||||
for deb in $(ls /linux-image-[0-9]*.deb /linux-headers-*.deb /linux-libc-dev_*.deb 2>/dev/null | grep -v -- '-dbg_'); do
|
||||
dpkg-deb -x "$deb" "$TMPDIR"
|
||||
done
|
||||
|
||||
cat > "$TMPDIR/DEBIAN/control" << CTRL
|
||||
Package: linux-ps5
|
||||
Version: $VER
|
||||
Architecture: $ARCH
|
||||
Maintainer: PS5 Linux
|
||||
Provides: linux-image, linux-image-$KVER, linux-headers-$KVER, linux-libc-dev
|
||||
Conflicts: linux-image-$KVER, linux-headers-$KVER, linux-libc-dev
|
||||
Replaces: linux-image-$KVER, linux-headers-$KVER, linux-libc-dev
|
||||
Description: PS5 Linux kernel $KVER (image + headers + libc-dev)
|
||||
CTRL
|
||||
|
||||
dpkg-deb --build --root-owner-group "$TMPDIR" "/out/linux-ps5_${VER}_${ARCH}.deb"
|
||||
Reference in New Issue
Block a user