Skip to content

Instantly share code, notes, and snippets.

@jshen28
Forked from Jacobboogiebear/build-swtpm.sh
Created July 2, 2023 02:06
Show Gist options
  • Save jshen28/3b5c09b7657b7a6c000900bf2502516b to your computer and use it in GitHub Desktop.
Save jshen28/3b5c09b7657b7a6c000900bf2502516b to your computer and use it in GitHub Desktop.
A quick script to build swtpm and libtpm on Ubuntu 20.04 (created for WSL2 and WSLg)
sudo apt-get install git g++ gcc automake autoconf libtool make gcc libc-dev libssl-dev pkg-config libtasn1-6-dev libjson-glib-dev expect gawk socat libseccomp-dev -y
cd ~
git clone https://github.com/stefanberger/swtpm.git
git clone https://github.com/stefanberger/libtpms.git
cd libtpms
./autogen.sh --prefix=/usr --with-tpm2 --with-openssl
make
sudo make install
cd ../swtpm
./autogen.sh --prefix=/usr
make
sudo make install
cd ..
rm -rf swtpm/ libtpms/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment