mirror of
https://github.com/linuxkit/linuxkit.git
synced 2025-09-16 15:21:46 +00:00
remove grub-dev in favour of grub package
Signed-off-by: Avi Deitcher <avi@deitcher.net>
This commit is contained in:
@@ -1,53 +1,25 @@
|
||||
# this is really hard to build. Do not change this version unless you must
|
||||
FROM linuxkit/alpine:86cd4f51b49fb9a078b50201d892a3c7973d48ec AS grub-build
|
||||
FROM linuxkit/alpine:5ac048802293564a50414394e1b9896eac528e7d AS build
|
||||
ENV GRUB_MODULES="part_gpt fat ext2 iso9660 gzio linux acpi normal cpio crypto disk boot crc64 \
|
||||
search_fs_uuid tftp xzio xfs video"
|
||||
|
||||
RUN apk add \
|
||||
automake \
|
||||
make \
|
||||
bison \
|
||||
gettext \
|
||||
flex \
|
||||
gcc \
|
||||
git \
|
||||
libtool \
|
||||
libc-dev \
|
||||
linux-headers \
|
||||
python3 \
|
||||
autoconf
|
||||
|
||||
# because python is not available
|
||||
RUN ln -s python3 /usr/bin/python
|
||||
|
||||
ENV GRUB_MODULES="part_gpt fat ext2 iso9660 gzio linux acpi normal cpio crypto disk boot crc64 gpt \
|
||||
search_disk_uuid tftp verify xzio xfs video"
|
||||
ENV GRUB_COMMIT=2f868ac992be2ae3ab838951aa3e260c045f20f9
|
||||
grub \
|
||||
grub-efi
|
||||
|
||||
COPY patches/* /patches/
|
||||
FROM build as build-arm64
|
||||
RUN grub-mkimage -O arm64-efi -o /BOOTAA64.EFI -p /EFI/BOOT ${GRUB_MODULES}
|
||||
|
||||
WORKDIR /src
|
||||
RUN git clone https://github.com/coreos/grub.git grub
|
||||
WORKDIR /src/grub
|
||||
RUN git checkout -b grub-build ${GRUB_COMMIT}
|
||||
RUN for patch in /patches/*.patch; do \
|
||||
echo "Applying $patch"; \
|
||||
patch -p1 < "$patch"; \
|
||||
done
|
||||
FROM build as build-amd64
|
||||
RUN grub-mkimage -O x86_64-efi -o /BOOTX64.EFI -p /EFI/BOOT ${GRUB_MODULES}
|
||||
|
||||
RUN ./autogen.sh
|
||||
FROM build as build-riscv64
|
||||
RUN grub-mkimage -O riscv64-efi -o /BOOTRISCV64.EFI -p /EFI/BOOT ${GRUB_MODULES}
|
||||
|
||||
RUN ./configure --libdir=/grub-lib --with-platform=efi CFLAGS="-Os -Wno-unused-value"
|
||||
RUN make -j "$(getconf _NPROCESSORS_ONLN)"
|
||||
RUN make install
|
||||
RUN case $(uname -m) in \
|
||||
x86_64) \
|
||||
./grub-mkimage -O x86_64-efi -d /grub-lib/grub/x86_64-efi -o /grub-lib/BOOTX64.EFI -p /EFI/BOOT ${GRUB_MODULES}; \
|
||||
;; \
|
||||
aarch64) \
|
||||
./grub-mkimage -O arm64-efi -d /grub-lib/grub/arm64-efi -o /grub-lib/BOOTAA64.EFI -p /EFI/BOOT ${GRUB_MODULES}; \
|
||||
;; \
|
||||
esac
|
||||
FROM build-${TARGETARCH} AS collate
|
||||
ARG TARGETARCH
|
||||
COPY /*.EFI /
|
||||
|
||||
FROM scratch
|
||||
ENTRYPOINT []
|
||||
WORKDIR /
|
||||
COPY --from=grub-build /grub-lib/*.EFI /
|
||||
COPY --from=collate /*.EFI /
|
||||
|
Reference in New Issue
Block a user