forked from lf-edge/eve
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
77 lines (57 loc) · 2.23 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
# syntax=docker/dockerfile-upstream:1.5.0-rc2-labs
# Instructions for this package are taken from:
# https://wiki.ubuntu.com/UEFI/EDK2
# https://wiki.linaro.org/LEG/UEFIforQEMU
#
# On ARM here's what works for other boars:
# git clone https://github.com/tianocore/edk2
# git clone https://github.com/tianocore/edk2-platforms
# git clone https://github.com/tianocore/edk2-non-osi
# git clone https://git.linaro.org/uefi/uefi-tools.git
# ./uefi-tools/edk2-build.sh -b DEBUG -b RELEASE all
#
FROM lfedge/eve-alpine:591df01e581889c3027514c8a91feaca1c8ad49f AS build
ENV BUILD_PKGS make gcc g++ python3 libuuid nasm util-linux-dev bash git util-linux patch
ENV BUILD_PKGS_amd64 iasl
ENV BUILD_PKGS_arm64 iasl
RUN eve-alpine-deploy.sh
RUN ln -s python3 /usr/bin/python
COPY edk2-patches /edk2-patches
FROM build AS build-arm64-versions
ENV EDK_VERSION edk2-stable202208
ENV EDK_COMMIT ba0e0e4c6a174b71b18ccd6e47319cc45878893c
# FIXME: we should be building Raspberry Pi 4 UEFI implementations
COPY rpi /rpi
FROM build AS build-amd64-versions
ENV EDK_VERSION edk2-stable202408
ENV EDK_COMMIT b158dad150bf02879668f72ce306445250838201
FROM build-${TARGETARCH}-versions AS build-edk2
WORKDIR /edk2
ADD --keep-git-dir=true https://github.com/tianocore/edk2.git#${EDK_COMMIT} /edk2
RUN set -e ; [ ! -d /edk2 ] || [ ! -d /edk2-patches/${EDK_VERSION} ] || \
for patch in /edk2-patches/${EDK_VERSION}/*.patch; do \
echo "Applying $patch"; \
patch -d /edk2 -p1 < "$patch" || exit 1 ; \
done
FROM build-edk2 AS build-amd64
FROM build-edk2 AS build-arm64
FROM build AS build-riscv64
ENV SBI_COMMIT cbaa9b0333517b3c25bea8d1c71ac8005ff1f727
ADD https://github.com/riscv/opensbi/tarball/${SBI_COMMIT} /opensbi.tgz
WORKDIR /opensbi
RUN tar -zxvf /opensbi.tgz --strip-components=1 && \
rm /opensbi.tgz
FROM build-${TARGETARCH} AS build-interim
WORKDIR /edk2
COPY build.sh /edk2/
RUN ./build.sh
# create an out dir for all the artifacts
RUN rm -rf /out && mkdir /out && cp /edk2/OVMF*.fd /out
# some architecture specific cases. There probably is a cleaner dockerfile-native way to do this.
RUN case $(uname -m) in \
aarch64) \
cp -r /rpi /out/ \
;; \
esac
FROM scratch
COPY --from=build-interim /out/* /