Hi On Thu, Mar 8, 2018 at 1:31 PM, Shi, Steven <steven....@intel.com> wrote: > Hi Marcandre, >> I test with qemu & swtpm/libtpms (tpm2 branches, swtpm_setup.sh --tpm2 >> --tpm-state tpmstatedir) >> $ swtpm socket --tpmstate tpmstatedir --ctrl type=unixio,path=tpmsock >> --tpm2 & > > Where is the swtpm_setup.sh? And could you tell how to build & install the > swtpm? >
You need to compile & install libtpms & swtpm : git clone -b tpm2-preview.rev146.v2 https://github.com/stefanberger/libtpms cd libtpms autoreconf -vfi && ./configure --with-tpm2 --with-openssl && make install git clone -b tpm2-preview.v2 https://github.com/stefanberger/swtpm cd swtpm autoreconf -vfi && ./configure --with-openssl && make install Then you can run: mkdir tpmstatedir swtpm_setup.sh --tpm2 --tpm-state tpmstatedir Run the emulator: swtpm socket --tpmstate dir=tpmstatedir --ctrl type=unixio,path=tpmemu.sock --tpm2 Run qemu (from git) with ovmf (with this series): qemu ... -chardev socket,id=chrtpm,path=tpmemu.sock -tpmdev emulator,id=tpm0,chardev=chrtpm -device tpm-crb,tpmdev=tpm0 -drive if=pflash,format=raw,file=OVMF_CODE.fd,readonly -drive if=pflash,format=raw,file=OVMF_VARS.fd .. cheers -- Marc-André Lureau