# This Dockerfile is used to build an image containing basic stuff to be used
# to build U-Boot and run our test suites.
-FROM ubuntu:focal-20210723
+FROM ubuntu:focal-20210921
LABEL Description=" This image is for building U-Boot inside a container"
# Add LLVM repository
RUN apt-get update && apt-get install -y gnupg2 wget xz-utils && rm -rf /var/lib/apt/lists/*
RUN wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add -
-RUN echo deb http://apt.llvm.org/focal/ llvm-toolchain-focal-12 main | tee /etc/apt/sources.list.d/llvm.list
+RUN echo deb http://apt.llvm.org/focal/ llvm-toolchain-focal-13 main | tee /etc/apt/sources.list.d/llvm.list
# Manually install the kernel.org "Crosstool" based toolchains for gcc-11.1.0
RUN wget -O - https://mirrors.edge.kernel.org/pub/tools/crosstool/files/bin/x86_64/11.1.0/x86_64-gcc-11.1.0-nolibc-aarch64-linux.tar.xz | tar -C /opt -xJ
binutils-dev \
bison \
build-essential \
- clang-12 \
+ clang-13 \
coreutils \
cpio \
cppcheck \
dosfstools \
e2fsprogs \
efitools \
+ expect \
fakeroot \
flex \
+ gawk \
gdisk \
git \
gnu-efi \
+ gnutls-dev \
graphviz \
grub-efi-amd64-bin \
grub-efi-ia32-bin \
iasl \
imagemagick \
iputils-ping \
+ libconfuse-dev \
libgit2-dev \
+ libjson-glib-dev \
libguestfs-tools \
liblz4-tool \
libpixman-1-dev \
libpython3-dev \
libsdl1.2-dev \
libsdl2-dev \
+ libseccomp-dev \
libssl-dev \
+ libtool \
libudev-dev \
libusb-1.0-0-dev \
linux-image-kvm \
mount \
mtd-utils \
mtools \
+ net-tools \
+ ninja-build \
openssl \
picocom \
parted \
rpm2cpio \
sbsigntool \
sloccount \
+ socat \
+ softhsm2 \
sparse \
srecord \
sudo \
RUN git clone git://git.qemu.org/qemu.git /tmp/qemu && \
cd /tmp/qemu && \
git submodule update --init dtc && \
- git checkout v4.2.0 && \
+ git checkout v6.1.0 && \
+ # config user.name and user.email to make 'git am' happy
+ git config user.name u-boot && \
+ # manually apply the bug fix for QEMU 6.1.0 Xilinx Zynq UART emulation codes
+ wget -O - http://patchwork.ozlabs.org/project/qemu-devel/patch/
[email protected]/mbox/ | git am && \
./configure --prefix=/opt/qemu --target-list="aarch64-softmmu,arm-softmmu,i386-softmmu,mips-softmmu,mips64-softmmu,mips64el-softmmu,mipsel-softmmu,ppc-softmmu,riscv32-softmmu,riscv64-softmmu,sh4-softmmu,x86_64-softmmu,xtensa-softmmu" && \
make -j$(nproc) all install && \
rm -rf /tmp/qemu
+# Build genimage (required by some targets to generate disk images)
+RUN wget -O - https://github.com/pengutronix/genimage/releases/download/v14/genimage-14.tar.xz | tar -C /tmp -xJ && \
+ cd /tmp/genimage-14 && \
+ ./configure && \
+ make -j$(nproc) && \
+ make install && \
+ rm -rf /tmp/genimage-14
+
+# Build libtpms
+RUN git clone https://github.com/stefanberger/libtpms /tmp/libtpms && \
+ cd /tmp/libtpms && \
+ ./autogen.sh && \
+ ./configure && \
+ make -j$(nproc) && \
+ make install && \
+ ldconfig && \
+ rm -rf /tmp/libtpms
+
+# Build swtpm
+RUN git clone https://github.com/stefanberger/swtpm /tmp/swtpm && \
+ cd /tmp/swtpm && \
+ ./autogen.sh && \
+ ./configure && \
+ make -j$(nproc) && \
+ make install && \
+ rm -rf /tmp/swtpm
+
# Create our user/group
RUN echo uboot ALL=NOPASSWD: ALL > /etc/sudoers.d/uboot
RUN useradd -m -U uboot