Merge remote-tracking branch 'origin/lance/grub-updates' into staging

This commit is contained in:
ryan 2024-06-18 00:39:31 -04:00
commit 71690e97bb
No known key found for this signature in database
GPG key ID: 8E401478A3FBEF72

View file

@ -1,6 +1,6 @@
FROM scratch as base
ENV VERSION=2.06
ENV SRC_HASH=23b64b4c741569f9426ed2e3d0e6780796fca081bee4c99f62aa3f53ae803f5f
ENV VERSION=2.12
ENV SRC_HASH=b30919fa5be280417c17ac561bb1650f60cfb80cc6237fa1e2b6f56154cb9c91
ENV SRC_FILE=grub-${VERSION}.tar.gz
ENV SRC_SITE=https://mirrors.kernel.org/gnu/grub/${SRC_FILE}
@ -14,34 +14,63 @@ COPY --from=stagex/flex . /
COPY --from=stagex/gcc . /
COPY --from=stagex/binutils . /
COPY --from=stagex/make . /
COPY --from=stagex/gawk . /
COPY --from=stagex/musl . /
COPY --from=stagex/python . /
COPY --from=stagex/m4 . /
COPY --from=stagex/linux-headers . /
COPY --from=stagex/perl . /
COPY --from=stagex/pkgconf . /
COPY --from=stagex/automake . /
COPY --from=stagex/autoconf . /
COPY --from=stagex/gettext . /
COPY --from=stagex/xz . /
COPY --from=stagex/linux-headers . /
RUN tar -xf ${SRC_FILE}
WORKDIR grub-${VERSION}
RUN --network=none <<-EOF
set -eux
./configure \
--prefix=/usr
make -j "$(nproc)" CFLAGS="-Wno-error"
sh autogen.sh
touch grub-core/extra_deps.lst
mkdir build-pc
cd build-pc
CLFLAGS="-fno-plt" \
../configure \
--prefix=/usr \
--sysconfdir=/etc \
--mandir=/usr/share/man \
--localstatedir=/var \
--build=x86_64 \
--target=x86_64 \
--host=x86_64 \
--disable-nls \
--disable-werror \
--with-platform=pc
make
cd ..
mkdir build-efi
cd build-efi
../configure \
--prefix=/usr \
--sysconfdir=/etc \
--mandir=/usr/share/man \
--localstatedir=/var \
--build=x86_64 \
--target=x86_64 \
--host=x86_64 \
--disable-nls \
--disable-werror \
--with-platform=efi \
--disable-efiemu
make
EOF
FROM build as install
RUN make DESTDIR=/rootfs install
FROM base as test
COPY --from=install /rootfs/. /
COPY --from=stagex/musl . /
COPY --from=stagex/busybox . /
RUN grub-install --version
RUN /bin/sh <<-EOF
set -eux
GRUB_VERSION=\$(echo | grub-install --version)
if [ "grub-install (GRUB) ${VERSION}" != "\$GRUB_VERSION" ]; then
echo "Expected grub version is \$VERSION, but got \$GRUB_VERSION"
exit 1
fi
RUN <<-EOF
cd build-pc
make DESTDIR=/rootfs install-strip
cd ..
cd build-efi
make DESTDIR=/rootfs install-strip
EOF
FROM stagex/filesystem as package