Lorenz Brun | f95909d | 2019-09-11 19:48:26 +0200 | [diff] [blame] | 1 | #!/bin/sh |
| 2 | |
Leopold Schabel | 7670e67 | 2019-11-15 13:49:53 +0100 | [diff] [blame] | 3 | TMP=$(mktemp -d) |
| 4 | trap "{ rm -rf "$TMP"; pkill -9 -P $$; }" EXIT |
| 5 | |
| 6 | # sandbox uses a symlink farm - without -L, we would just copy the symlinks |
| 7 | cp -Lr core/tpm/* "${TMP}" |
| 8 | |
| 9 | swtpm socket --tpmstate dir=${TMP} --ctrl type=unixio,path=tpm-socket --tpm2 & |
Lorenz Brun | f95909d | 2019-09-11 19:48:26 +0200 | [diff] [blame] | 10 | |
Leopold Schabel | 67f9d09 | 2019-10-22 15:41:42 +0200 | [diff] [blame] | 11 | qemu-system-x86_64 \ |
| 12 | -cpu host -smp sockets=1,cpus=1,cores=2,threads=2,maxcpus=4 -m 1024 -machine q35 -enable-kvm -nographic -nodefaults \ |
Leopold Schabel | 5c80aca | 2019-10-22 15:48:58 +0200 | [diff] [blame] | 13 | -drive if=pflash,format=raw,readonly,file=external/edk2/OVMF_CODE.fd \ |
| 14 | -drive if=pflash,format=raw,snapshot=on,file=external/edk2/OVMF_VARS.fd \ |
Hendrik Hofstadt | 0d7c91e | 2019-10-23 21:44:47 +0200 | [diff] [blame] | 15 | -drive if=virtio,format=raw,snapshot=on,cache=unsafe,file=core/smalltown.img \ |
Lorenz Brun | aa6b734 | 2019-12-12 02:55:02 +0100 | [diff] [blame] | 16 | -netdev user,id=net0,hostfwd=tcp::7833-:7833,hostfwd=tcp::7834-:7834,hostfwd=tcp::6443-:6443,hostfwd=tcp::7835-:7835 \ |
Lorenz Brun | f95909d | 2019-09-11 19:48:26 +0200 | [diff] [blame] | 17 | -device virtio-net-pci,netdev=net0 \ |
Leopold Schabel | 5c80aca | 2019-10-22 15:48:58 +0200 | [diff] [blame] | 18 | -chardev socket,id=chrtpm,path=tpm-socket \ |
Lorenz Brun | f95909d | 2019-09-11 19:48:26 +0200 | [diff] [blame] | 19 | -tpmdev emulator,id=tpm0,chardev=chrtpm \ |
| 20 | -device tpm-tis,tpmdev=tpm0 \ |
Leopold Schabel | 5c80aca | 2019-10-22 15:48:58 +0200 | [diff] [blame] | 21 | -debugcon file:debug.log \ |
Lorenz Brun | f95909d | 2019-09-11 19:48:26 +0200 | [diff] [blame] | 22 | -global isa-debugcon.iobase=0x402 \ |
| 23 | -device ipmi-bmc-sim,id=ipmi0 \ |
| 24 | -device virtio-rng-pci \ |
Leopold Schabel | 7670e67 | 2019-11-15 13:49:53 +0100 | [diff] [blame] | 25 | -serial stdio \ |
| 26 | | stdbuf -oL tr -d '\r' | cat -v |