From 68d0e7237e8ffac07239032c8d2ef0ccf3f1d312 Mon Sep 17 00:00:00 2001 From: David Tolnay Date: Thu, 17 Jan 2019 14:17:01 -0800 Subject: kokoro: Install libtpm2 Required for CL:1387624 which uses libtpm2 as a TPM simulator. BUG=chromium:911799 TEST=build kokoro image, test master as well as TPM CL in it Change-Id: I636be593a245ecd7ac10bc71319dee48e6511e97 Reviewed-on: https://chromium-review.googlesource.com/1419397 Commit-Ready: David Tolnay Tested-by: David Tolnay Tested-by: kokoro Reviewed-by: Stephen Barber --- kokoro/Dockerfile | 15 ++++++++++++++- kokoro/pkgconfig/libtpm2.pc | 5 +++++ 2 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 kokoro/pkgconfig/libtpm2.pc (limited to 'kokoro') diff --git a/kokoro/Dockerfile b/kokoro/Dockerfile index 848e94e..44c63aa 100644 --- a/kokoro/Dockerfile +++ b/kokoro/Dockerfile @@ -20,6 +20,7 @@ RUN apt-get update && apt-get install -y \ libgl1-mesa-dev \ libgles1-mesa-dev \ libgles2-mesa-dev \ + libssl1.0-dev \ libtool \ libusb-1.0-0-dev \ libwayland-dev \ @@ -33,7 +34,8 @@ RUN apt-get update && apt-get install -y \ ENV RUSTUP_HOME=/usr/local/rustup \ CARGO_HOME=/usr/local/cargo \ PATH=/usr/local/cargo/bin:$PATH \ - RUST_VERSION=1.31.0 + RUST_VERSION=1.31.0 \ + RUSTFLAGS='--cfg hermetic' # Debian usually has an old rust version in the repository. Instead of using that, we use rustup to # pull in a toolchain versions of our choosing. @@ -90,6 +92,17 @@ RUN git clone https://gitlab.freedesktop.org/virgl/virglrenderer.git \ && ./autogen.sh \ && make install -j24 +# Install libtpm2 so that tpm2-sys/build.rs does not try to build it in place in +# the read-only source directory. +RUN git clone https://chromium.googlesource.com/chromiumos/third_party/tpm2 \ + && cd tpm2 \ + && git checkout 15260c8cd98eb10b4976d2161cd5cb9bc0c3adac \ + && make -j24 \ + && cp build/libtpm2.a /lib + +# Inform pkg-config where libraries we install are placed. +COPY pkgconfig/* /usr/lib/pkgconfig + # Reduces image size and prevents accidentally using /scratch files RUN rm -r /scratch /usr/bin/meson diff --git a/kokoro/pkgconfig/libtpm2.pc b/kokoro/pkgconfig/libtpm2.pc new file mode 100644 index 0000000..c9ff8f0 --- /dev/null +++ b/kokoro/pkgconfig/libtpm2.pc @@ -0,0 +1,5 @@ +Name: tpm2 +Description: TPM simulator extracted from the TCG TPM 2.0 library specification +Version: 2.0.0 +Requires.private: libcrypto +Libs: -L/lib -ltpm2 -- cgit 1.4.1