stagex/packages/syslinux/Containerfile
2024-03-02 11:38:02 -08:00

40 lines
1.2 KiB
Docker

FROM scratch as base
ENV VERSION=6.04-pre1
ENV SRC_HASH=3f6d50a57f3ed47d8234fd0ab4492634eb7c9aaf7dd902f33d3ac33564fd631d
ENV SRC_FILE=syslinux-${VERSION}.tar.xz
ENV SRC_SITE=https://www.kernel.org/pub/linux/utils/boot/syslinux/Testing/6.04/${SRC_FILE}
FROM base as fetch
ADD --checksum=sha256:${SRC_HASH} ${SRC_SITE} ${SRC_FILE}
FROM fetch as build
COPY --from=stagex/busybox . /
COPY --from=stagex/gcc . /
COPY --from=stagex/binutils . /
COPY --from=stagex/make . /
COPY --from=stagex/perl . /
COPY --from=stagex/musl . /
COPY --from=stagex/util-linux . /
COPY --from=stagex/linux-headers . /
RUN tar -xf ${SRC_FILE}
WORKDIR syslinux-${VERSION}
COPY *.patch .
RUN --network=none <<-EOF
patch -p1 < fix-sysmacros.patch
patch -p1 < prevent-pow-optimization.patch
patch -p1 < gcc-10.patch
make efi64 installer
EOF
FROM build as install
RUN make -j1 INSTALLROOT="/rootfs/usr" MANDIR=/usr/share/man bios efi64 install
RUN find /rootfs -exec touch -hcd "@0" "{}" +
FROM base as test
COPY --from=install /rootfs/. /
COPY --from=stagex/musl . /
COPY --from=stagex/busybox . /
RUN syslinux --version
FROM stagex/filesystem as package
COPY --from=install /rootfs/. /