HIRS/.ci/setup/container/setup_tpm2provisioner.sh

37 lines
958 B
Bash
Raw Normal View History

#!/bin/bash
2021-11-16 21:51:42 +00:00
#########################################################################################
# Script to setup the TPM 2.0 Provisioner for System Tests
# Initial setup only use resetTpm2Emulator to reset PCR values in subsequent tests
2021-11-16 21:51:42 +00:00
#########################################################################################
set -e
2022-01-26 15:04:07 +00:00
pushd / > /dev/null
2021-11-16 21:51:42 +00:00
echo "Setting up TPM emulator for the TPM2 Provisioner"
source /HIRS/.ci/setup/container/tpm2_common.sh
2021-11-16 21:51:42 +00:00
#Wait for the ACA to spin up, if it hasnt already
2022-01-26 15:24:29 +00:00
waitForAca
2021-11-16 21:51:42 +00:00
# Install packages
2022-01-26 15:24:29 +00:00
installProvisioner
2022-01-26 17:08:29 +00:00
# set location of tcg artifacts
setTcgProperties
2022-01-26 17:08:29 +00:00
#echo "Contents of /etc/hirs is $(ls -al /etc/hirs)";
2022-01-26 15:04:07 +00:00
# Install TPM 2.0 Emulator
2022-01-26 15:24:29 +00:00
initTpm2Emulator
# Update the hirs-site.config file
2022-01-26 15:24:29 +00:00
updateHirsSiteConfigFile
echo "TPM 2.0 Emulator NV RAM list"
tpm2_nvlist
echo ""
echo "===========HIRS ACA TPM 2.0 Provisioner Setup Complete!==========="
2021-11-16 21:51:42 +00:00
popd > /dev/null
#tpm2_pcrlist -g sha256