Dockerfile: build swtpm

For testing the TPM drivers and the EFI_TCG2_PROTOCOL we need the tool
swtpm.

Once we move to Ubuntu Impish we can take libtpms from package libtpms-dev.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
This commit is contained in:
Heinrich Schuchardt 2021-11-09 19:51:20 +01:00 committed by Tom Rini
parent e035ce4b3b
commit 8a87d1ae95

View file

@ -48,11 +48,14 @@ RUN apt-get update && apt-get install -y \
dosfstools \ dosfstools \
e2fsprogs \ e2fsprogs \
efitools \ efitools \
expect \
fakeroot \ fakeroot \
flex \ flex \
gawk \
gdisk \ gdisk \
git \ git \
gnu-efi \ gnu-efi \
gnutls-dev \
graphviz \ graphviz \
grub-efi-amd64-bin \ grub-efi-amd64-bin \
grub-efi-ia32-bin \ grub-efi-ia32-bin \
@ -62,13 +65,16 @@ RUN apt-get update && apt-get install -y \
iputils-ping \ iputils-ping \
libconfuse-dev \ libconfuse-dev \
libgit2-dev \ libgit2-dev \
libjson-glib-dev \
libguestfs-tools \ libguestfs-tools \
liblz4-tool \ liblz4-tool \
libpixman-1-dev \ libpixman-1-dev \
libpython3-dev \ libpython3-dev \
libsdl1.2-dev \ libsdl1.2-dev \
libsdl2-dev \ libsdl2-dev \
libseccomp-dev \
libssl-dev \ libssl-dev \
libtool \
libudev-dev \ libudev-dev \
libusb-1.0-0-dev \ libusb-1.0-0-dev \
linux-image-kvm \ linux-image-kvm \
@ -77,6 +83,7 @@ RUN apt-get update && apt-get install -y \
mount \ mount \
mtd-utils \ mtd-utils \
mtools \ mtools \
net-tools \
ninja-build \ ninja-build \
openssl \ openssl \
picocom \ picocom \
@ -92,6 +99,8 @@ RUN apt-get update && apt-get install -y \
rpm2cpio \ rpm2cpio \
sbsigntool \ sbsigntool \
sloccount \ sloccount \
socat \
softhsm2 \
sparse \ sparse \
srecord \ srecord \
sudo \ sudo \
@ -186,6 +195,25 @@ RUN wget -O - https://github.com/pengutronix/genimage/releases/download/v14/geni
make install && \ make install && \
rm -rf /tmp/genimage-14 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 # Create our user/group
RUN echo uboot ALL=NOPASSWD: ALL > /etc/sudoers.d/uboot RUN echo uboot ALL=NOPASSWD: ALL > /etc/sudoers.d/uboot
RUN useradd -m -U uboot RUN useradd -m -U uboot