Skip to content

Commit

Permalink
QemuHCK: Ensure to kill swtpm
Browse files Browse the repository at this point in the history
Signed-off-by: Akihiko Odaki <[email protected]>
  • Loading branch information
akihikodaki authored and YanVugenfirer committed Feb 9, 2024
1 parent ebe550e commit 78712a8
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/setupmanagers/qemuhck/devices/tpm-tis.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"-device tpm-tis,tpmdev=tpm0"
],
"define_variables": {
"@tpm_pid@": "@workspace@/swtpm_@run_id@_@[email protected]",
"@tpm_state_dir@": "@workspace@/swtpm_state_@run_id@_@client_id@",
"@tpm_socket@": "/tmp/swtpm_@run_id@_@client_id@_sock"
},
Expand All @@ -15,6 +16,9 @@
],
"pre_start_commands": [
"rm -f @tpm_socket@",
"swtpm socket --daemon --tpm2 --tpmstate dir=@tpm_state_dir@ --ctrl type=unixio,path=@tpm_socket@ --log file=@tpm_state_dir@/swtpm.log,level=20"
"swtpm socket --daemon --pid file=@tpm_pid@ --tpm2 --tpmstate dir=@tpm_state_dir@ --ctrl type=unixio,path=@tpm_socket@ --log file=@tpm_state_dir@/swtpm.log,level=20"
],
"post_stop_commands": [
"kill $(cat @tpm_pid@) || true"
]
}

0 comments on commit 78712a8

Please sign in to comment.