Created
September 9, 2023 10:20
-
-
Save inclyc/7bc9c682b386af5d0f108d41f056c7e0 to your computer and use it in GitHub Desktop.
TPM for QEMU, command line
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# TPM | |
TPMSTATE=${TPMSTATE:-"$XDG_RUNTIME_DIR/tpm0"} | |
mkdir -p $TPMSTATE | |
TPMCMD=( | |
swtpm | |
socket | |
-d | |
--tpmstate dir=$TPMSTATE,mode=0600 | |
--tpm2 | |
--ctrl type=unixio,path=${TPMSTATE}/swtpm-sock | |
--pid file=${TPMSTATE}/swtpm-pid | |
--log level=20,file=${TPMSTATE}/swtpm.log | |
) | |
"${TPMCMD[@]}" | |
cmd+=( | |
-chardev socket,id=chrtpm,path=${TPMSTATE}/swtpm-sock | |
-tpmdev emulator,id=tpm0,chardev=chrtpm | |
-device tpm-tis,tpmdev=tpm0 | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment