Skip to content

Instantly share code, notes, and snippets.

@psanford
Last active August 20, 2021 20:43
Show Gist options
  • Save psanford/4a4ac373d0dae97bc6f0d98137537a7c to your computer and use it in GitHub Desktop.
Save psanford/4a4ac373d0dae97bc6f0d98137537a7c to your computer and use it in GitHub Desktop.
tpm2-tools ubuntu build 20.04
#!/bin/bash
set -euo pipefail
# This is how I build tpm2-tools from master on ubuntu 20.04. The install instructions in the tpm2-tools repo is out of date:
sudo apt-get update
sudo apt-get -y upgrade
# install build-essential
sudo apt-get install -y build-essential
# install deps listed in https://github.com/tpm2-software/tpm2-tools/blob/master/doc/INSTALL.md
sudo apt-get install -y autoconf automake libtool pkg-config gcc libssl-dev libcurl4-gnutls-dev python-yaml
# install the additional dependencies for building tpm2-tools and tpm2-tss
# see also the docker build scripts here incase you need another dependency: https://github.com/tpm2-software/tpm2-software-container/blob/master/modules/ubuntu_20.04_base_deps.m4
# the install docs say you have to install autoconf-archive from source, but ubuntu 20.04 ships a new enough version
sudo apt-get install -y autoconf-archive acl libjson-c-dev
# build and install tpm2-tss
(
git clone https://github.com/tpm2-software/tpm2-tss.git
cd tpm2-tss
./bootstrap
./configure
make
sudo make install
)
# build and install tpm2-tools
(
git clone https://github.com/tpm2-software/tpm2-tools.git
cd tpm2-tools
./bootstrap
./configure
make
sudo make install
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment