Created
July 2, 2019 01:12
-
-
Save mitsutaka/df8fd04b16cd027eacf08390109bb728 to your computer and use it in GitHub Desktop.
launch coreos with software TPM
This file contains 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
#!/bin/bash -xe | |
i=0 | |
while [ -d /tmp/mytpm$i ]; do | |
let i=i+1 | |
done | |
tpm=/tmp/tpm$i | |
disk=coreos_production_qemu_image.img | |
mkdir $tpm | |
echo "Starting $tpm" | |
sudo swtpm socket --tpmstate dir=$tpm --tpm2 \ | |
--ctrl type=unixio,path=/$tpm/swtpm-sock & | |
sleep 2 # this should be changed to a netstat query | |
sudo kvm -hda ${disk} \ | |
-chardev socket,id=chrtpm,path=/$tpm/swtpm-sock \ | |
-tpmdev emulator,id=tpm0,chardev=chrtpm \ | |
-device tpm-tis,tpmdev=tpm0 \ | |
-nographic \ | |
-serial telnet:127.0.0.1:4444,server,nowait \ | |
-m 1024 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment