Skip to content

Commit 5191828

Browse files
rizlikdanielinux
authored andcommitted
tools/scripts/qemu: start QEMU with gdb server when env DEBUG = 1
1 parent b78f7b2 commit 5191828

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

tools/scripts/qemu64/qemu64-tpm.sh

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,18 @@ QEMU_TPM_OPTIONS=" \
1818
-chardev socket,id=chrtpm,path=/tmp/swtpm/swtpm-sock \
1919
-tpmdev emulator,id=tpm0,chardev=chrtpm \
2020
-device tpm-tis,tpmdev=tpm0"
21+
2122
QEMU_OPTIONS=" \
2223
-m 1G -machine q35 -serial mon:stdio -nographic \
2324
-pflash wolfboot_stage1.bin -drive id=mydisk,format=raw,file=app.bin,if=none \
2425
-device ide-hd,drive=mydisk"
2526

27+
QEMU=qemu-system-x86_64
28+
if [ "$DEBUG" = "1" ]; then
29+
QEMU_OPTIONS="${QEMU_OPTIONS} -S -s"
30+
QEMU=qemu-system-i386
31+
fi
32+
2633
killall swtpm
2734
sleep 1
2835
echo TPM Emulation ON
@@ -32,5 +39,5 @@ swtpm socket --tpm2 --tpmstate dir=/tmp/swtpm \
3239
sleep .5
3340
echo Running QEMU...
3441

35-
qemu-system-x86_64 $QEMU_OPTIONS $QEMU_TPM_OPTIONS
42+
$QEMU $QEMU_OPTIONS $QEMU_TPM_OPTIONS
3643

0 commit comments

Comments
 (0)