5 echo "Shared volume is ${ABRMD_DATA}"
6 FILE="${ABRMD_DATA}/tpm_status.yaml"
8 flag=$(echo "$(cat ${ABRMD_DATA}/tpm_status.yaml)" | sed '/^flag/{s/[^0-9,]//g;y/,/\n/;}')
9 if [ "$flag" == 0 ];then
11 mkdir -p /var/run/dbus
12 stdbuf -oL -eL dbus-daemon --system --nofork 2>&1 1> /var/log/dbus-daemon.log &
13 # Time for Daemon to start before executin next step
15 # Start Resource Manager
16 if [ -z $TPM_SIMULATOR ]; then
17 echo "Using TPM Hardware for the operations"
19 # Time for abrmd process to start
21 state=$( ps aux | grep tpm2-abrmd | grep -v grep )
22 echo "Staus of abrmd Process is $state"
24 echo "Using TPM Simulator for the opeations";
25 hostip=$(ip route show | awk '/default/ {print $3}');
26 echo "Connecting to $hostip\n";
27 tpm2-abrmd -a $hostip -t socket&
30 /abrmd/bin/initialize_tpm.sh
32 if [ $status -eq "0" ]; then
33 echo "TPM Initialization successful $status"
37 echo "TPM is already Initialized"
41 echo " TPM Status file not found, Hence exiting"