1
0
mirror of https://github.com/rancher/os.git synced 2025-09-05 16:52:20 +00:00
Files
os/scripts/qemu-in-container
2021-10-29 23:08:26 -07:00

14 lines
385 B
Bash
Executable File

#!/bin/bash
if [ "$#" = 0 ]; then
exec bash
fi
if [ -e /dev/tpm0 ]; then
mkdir /tmp/emulated_tpm
swtpm socket --tpmstate dir=/tmp/emulated_tpm --ctrl type=unixio,path=/tmp/emulated_tpm/swtpm-sock --log level=1 --tpm2 &
exec "$@" -chardev socket,id=chrtpm,path=/tmp/emulated_tpm/swtpm-sock \
-tpmdev emulator,id=tpm0,chardev=chrtpm -device tpm-tis,tpmdev=tpm0
fi