stagex/packages/linux-generic/Containerfile

44 lines
958 B
Text
Raw Normal View History

2024-02-10 11:43:02 +00:00
FROM scratch as base
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
FROM base as fetch
ADD --checksum=sha256:${SRC_HASH} ${SRC_SITE} .
2024-02-02 21:38:33 +00:00
FROM fetch as build
2024-02-10 11:43:02 +00:00
COPY --from=busybox . /
2024-02-09 07:30:28 +00:00
COPY --from=musl . /
COPY --from=make . /
COPY --from=binutils . /
COPY --from=linux-headers . /
COPY --from=elfutils . /
COPY --from=openssl . /
COPY --from=perl . /
COPY --from=m4 . /
COPY --from=gcc . /
COPY --from=bison . /
COPY --from=libzstd . /
COPY --from=zlib . /
COPY --from=flex . /
COPY --from=pkgconf . /
2024-02-10 11:43:02 +00:00
RUN tar -xf ${SRC_FILE}
WORKDIR linux-${VERSION}
RUN <<-EOF
2024-02-10 11:43:02 +00:00
set -eux
make oldconfig
make
EOF
2024-02-02 21:38:33 +00:00
2024-02-05 10:42:27 +00:00
FROM build as install
RUN <<-EOF
2024-02-10 11:43:02 +00:00
set -eux
make DESTDIR=/rootfs install
mkdir -p /rootfs/usr
EOF
RUN find /rootfs -exec touch -hcd "@0" "{}" +
2024-02-02 21:38:33 +00:00
2024-02-05 10:42:27 +00:00
FROM scratch as package
COPY --from=install /rootfs /