2024-08-08 07:47:42 +00:00
|
|
|
FROM scratch AS base
|
2024-02-10 11:43:02 +00:00
|
|
|
ENV VERSION=6.6
|
|
|
|
ENV SRC_HASH=d926a06c63dd8ac7df3f86ee1ffc2ce2a3b81a2d168484e76b5b389aba8e56d0
|
|
|
|
ENV SRC_FILE=linux-${VERSION}.tar.xz
|
|
|
|
ENV SRC_SITE=http://mirrors.edge.kernel.org/pub/linux/kernel/v6.x/${SRC_FILE}
|
2024-02-02 21:38:33 +00:00
|
|
|
|
2024-08-08 07:47:42 +00:00
|
|
|
FROM base AS fetch
|
2024-02-09 18:19:36 +00:00
|
|
|
ADD --checksum=sha256:${SRC_HASH} ${SRC_SITE} .
|
2024-02-02 21:38:33 +00:00
|
|
|
|
2024-08-08 07:47:42 +00:00
|
|
|
FROM fetch AS build
|
2024-02-15 15:22:38 +00:00
|
|
|
COPY --from=stagex/musl . /
|
|
|
|
COPY --from=stagex/make . /
|
|
|
|
COPY --from=stagex/binutils . /
|
|
|
|
COPY --from=stagex/linux-headers . /
|
|
|
|
COPY --from=stagex/elfutils . /
|
|
|
|
COPY --from=stagex/openssl . /
|
|
|
|
COPY --from=stagex/perl . /
|
|
|
|
COPY --from=stagex/m4 . /
|
|
|
|
COPY --from=stagex/gcc . /
|
|
|
|
COPY --from=stagex/bison . /
|
|
|
|
COPY --from=stagex/libzstd . /
|
|
|
|
COPY --from=stagex/zlib . /
|
|
|
|
COPY --from=stagex/flex . /
|
|
|
|
COPY --from=stagex/pkgconf . /
|
2024-02-18 02:42:40 +00:00
|
|
|
COPY --from=stagex/coreutils . /
|
|
|
|
COPY --from=stagex/findutils . /
|
|
|
|
COPY --from=stagex/diffutils . /
|
|
|
|
COPY --from=stagex/tar . /
|
|
|
|
COPY --from=stagex/gzip . /
|
|
|
|
COPY --from=stagex/xz . /
|
|
|
|
COPY --from=stagex/sed . /
|
|
|
|
COPY --from=stagex/grep . /
|
|
|
|
COPY --from=stagex/gawk . /
|
|
|
|
COPY --from=stagex/bc . /
|
|
|
|
COPY --from=stagex/bash . /
|
|
|
|
COPY --from=stagex/bash /bin/bash /bin/sh
|
2024-02-10 11:43:02 +00:00
|
|
|
RUN tar -xf ${SRC_FILE}
|
|
|
|
WORKDIR linux-${VERSION}
|
2024-03-05 02:52:31 +00:00
|
|
|
ENV KBUILD_BUILD_HOST=stagex
|
|
|
|
ENV KBUILD_BUILD_USER=user
|
|
|
|
ENV KBUILD_BUILD_TIMESTAMP=1
|
2024-02-09 18:19:36 +00:00
|
|
|
RUN <<-EOF
|
2024-02-10 11:43:02 +00:00
|
|
|
set -eux
|
2024-03-21 07:04:17 +00:00
|
|
|
unsetConfs='
|
|
|
|
CONFIG_BLK_DEV_INITRD
|
|
|
|
'
|
|
|
|
make defconfig
|
|
|
|
for conf in $unsetConfs; do
|
|
|
|
sed -i \
|
|
|
|
-e "s!^$conf=.*\$!# $conf is not set!" \
|
|
|
|
.config
|
|
|
|
done
|
|
|
|
make oldconfig
|
|
|
|
for conf in $unsetConfs; do
|
|
|
|
! grep -q "^$conf=" .config
|
|
|
|
done
|
2024-02-10 11:43:02 +00:00
|
|
|
make oldconfig
|
2024-03-14 07:16:26 +00:00
|
|
|
make -j "$(nproc)" bzImage
|
2024-03-21 05:28:51 +00:00
|
|
|
make -j "$(nproc)" modules INSTALL_MOD_PATH=/rootfs
|
2024-02-09 18:19:36 +00:00
|
|
|
EOF
|
2024-02-02 21:38:33 +00:00
|
|
|
|
2024-08-08 07:47:42 +00:00
|
|
|
FROM build AS install
|
2024-02-09 18:19:36 +00:00
|
|
|
RUN <<-EOF
|
2024-02-10 11:43:02 +00:00
|
|
|
set -eux
|
2024-03-01 18:30:23 +00:00
|
|
|
mkdir -p /rootfs/usr/lib/modules
|
|
|
|
make INSTALL_MOD_PATH=/rootfs/usr modules_install
|
2024-02-18 02:42:40 +00:00
|
|
|
cp .config /rootfs/linux.config
|
|
|
|
cp arch/x86_64/boot/bzImage /rootfs
|
2024-02-09 18:19:36 +00:00
|
|
|
EOF
|
2024-02-18 02:42:40 +00:00
|
|
|
|
2024-08-08 07:47:42 +00:00
|
|
|
FROM stagex/filesystem AS package
|
2024-03-01 18:30:23 +00:00
|
|
|
COPY --from=install /rootfs/. /
|