From b363acc16c469ff84433b541327427f6affbe5eb Mon Sep 17 00:00:00 2001 From: AtomicFS Date: Fri, 15 Nov 2024 12:04:31 +0100 Subject: [PATCH] feat(docker): do not pre-compile utilities - partial revert of 9c3128f0 - we are going to store toolchains in separate repository, it is more convenient to compile coreboot utilities inside the container rather than store them also in the separate repository Signed-off-by: AtomicFS --- docker/coreboot/Dockerfile | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/docker/coreboot/Dockerfile b/docker/coreboot/Dockerfile index ee109f6a..b381b072 100644 --- a/docker/coreboot/Dockerfile +++ b/docker/coreboot/Dockerfile @@ -69,13 +69,31 @@ RUN apt-get update && \ rm -rf /var/lib/apt/lists/* && \ mkdir -p "${TOOLSDIR}" + +#============= +# "toolchain" stage to build the coreboot toolchain +FROM base AS toolchain + +# Compile coreboot utilities +WORKDIR $TOOLSDIR +RUN git clone --depth 1 "https://review.coreboot.org/coreboot.git" -b "${COREBOOT_VERSION}" +WORKDIR $TOOLSDIR/coreboot +RUN make -C util/ifdtool install && \ + make -C util/cbfstool install + + +#============= +# "final" stage is the actual product with everything included +FROM base AS final + # Let coreboot know the toolchain path ENV XGCCPATH=${TOOLSDIR}/coreboot/util/crossgcc/xgcc/bin/ +# Copy over things from previous stage(s) +COPY --from=toolchain /usr/local/bin/* /usr/local/bin/ # Add pre-compiled coreboot toolchain and utils COPY coreboot-${COREBOOT_VERSION}/xgcc-${TARGETARCH} ${TOOLSDIR}/coreboot/util/crossgcc/xgcc -COPY coreboot-${COREBOOT_VERSION}/utils-${TARGETARCH}/* /usr/local/bin/ -RUN git clone --depth 1 https://github.com/platomav/MEAnalyzer.git ${TOOLSDIR}/MEAnalyzer/ +RUN git clone --depth 1 "https://github.com/platomav/MEAnalyzer.git" "${TOOLSDIR}/MEAnalyzer/" # Prepare SSH for interactive debugging RUN mkdir -p /run/sshd && \