Skip to content

Commit

Permalink
Add Dockerfile for building the bootloader.
Browse files Browse the repository at this point in the history
  • Loading branch information
jiggoha committed Jan 8, 2024
1 parent 0e05eea commit d434311
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
FROM golang:1.21-bookworm

ARG TAMAGO_VERSION
ARG LOG_ORIGIN
ARG LOG_PUBLIC_KEY
ARG OS_PUBLIC_KEY1
ARG OS_PUBLIC_KEY2

# Install dependencies.
RUN apt-get update && apt-get install -y make
RUN apt-get install -y wget
RUN apt-get install -y binutils-arm-none-eabi
RUN apt-get install -y u-boot-tools

RUN wget "https://github.com/usbarmory/tamago-go/releases/download/tamago-go${TAMAGO_VERSION}/tamago-go${TAMAGO_VERSION}.linux-amd64.tar.gz"
RUN tar -xvf "tamago-go${TAMAGO_VERSION}.linux-amd64.tar.gz" -C /

WORKDIR /build

COPY . .

# Set Tamago path for Make rule.
ENV TAMAGO=/usr/local/tamago-go/bin/go

# The Makefile expects verifiers to be stored in files, so do that.
RUN echo "${LOG_PUBLIC_KEY}" > /tmp/log.pub
RUN echo "${OS_PUBLIC_KEY1}" > /tmp/os1.pub
RUN echo "${OS_PUBLIC_KEY2}" > /tmp/os2.pub

# Firmware transparency parameters for output binary.
ENV LOG_ORIGIN=${LOG_ORIGIN} \
LOG_PUBLIC_KEY="/tmp/log.pub" \
OS_PUBLIC_KEY1="/tmp/os1.pub" \
OS_PUBLIC_KEY2="/tmp/os2.pub"

RUN make imx

0 comments on commit d434311

Please sign in to comment.