Unverified Commit b616ce9f authored by Kroese's avatar Kroese Committed by GitHub
Browse files

Refactor boot.sh for clarity

parent d2448357
Loading
Loading
Loading
Loading
+5 −4
Original line number Diff line number Diff line
@@ -156,12 +156,13 @@ if [ -s "$PS" ] && [ -r "$PS" ]; then

fi

rm -f /var/run/tpm.pid
TPM_PID="$QEMU_DIR/tpm.pid"
rm -f "$TPM_PID"

if [[ "$TPM" == [Yy1]* ]]; then

  { swtpm socket -t -d --tpmstate "backend-uri=file://$DEST.tpm" \
     --ctrl type=unixio,path=/run/swtpm-sock --pid file=/var/run/tpm.pid --tpm2; rc=$?; } || :
     --ctrl type=unixio,path=/run/swtpm-sock --pid file="$TPM_PID" --tpm2; rc=$?; } || :

  if (( rc != 0 )); then
    error "Failed to start TPM emulator, reason: $rc"