Skip to content

Commit

Permalink
feat(docker): do not pre-compile utilities
Browse files Browse the repository at this point in the history
- partial revert of 9c3128f
- 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 <vojtech.vesely@9elements.com>
  • Loading branch information
AtomicFS committed Nov 27, 2024
1 parent c5e7f0e commit b363acc
Showing 1 changed file with 20 additions and 2 deletions.
22 changes: 20 additions & 2 deletions docker/coreboot/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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 && \
Expand Down

0 comments on commit b363acc

Please sign in to comment.