Skip to content

Instantly share code, notes, and snippets.

@lukehinds
Last active December 21, 2018 16:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lukehinds/952cee9bae8599b1b051970cafbfa51b to your computer and use it in GitHub Desktop.
Save lukehinds/952cee9bae8599b1b051970cafbfa51b to your computer and use it in GitHub Desktop.
#!/bin/bash
if [[ $EUID -ne 0 ]]; then
echo -e "Please run as the root user"
exit 1
fi
echo -e "Updating Packages"
dnf update -y
echo -e "Install virtualization package group and deps"
dnf install -y @virtualization
dnf -y install make \
libtasn1-devel \
expect \
socat \
python3-twisted \
fuse-devel glib2-devel \
gnutls \
gnutls-devel \
gnutls-utils \
tpm-tools \
tpm2-tools \
openssl-devel \
git \
libtool \
autoconf
echo -e "Starting / Enabling Libvirt virtualization package group"
systemctl start libvirtd
systemctl enable libvirt
echo -e "Clone and build libtmpms"
git clone https://github.com/stefanberger/libtpms
cd libtpms/
./bootstrap.sh
./configure --prefix=/usr --with-openssl --with-tpm2
make
make install
echo -e "Clone and build swtpm"
cd ../
git clone https://github.com/stefanberger/swtpm
cd swtpm/
./autogen.sh --with-openssl --prefix=/usr
make -j4
make -j4 check
make install
echo -e "Build complete"
echo -e "Run swtpm --help."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment