fix: Move socket to /run (#375)

This commit is contained in:
Kroese 2024-01-23 01:53:20 +01:00 committed by GitHub
parent bf5f894c76
commit 63f1a1ec9f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 4 additions and 4 deletions

View file

@ -56,13 +56,13 @@ if [[ "${BOOT_MODE,,}" != "legacy" ]]; then
if [[ "${BOOT_MODE,,}" == "windows" ]]; then
BOOT_OPTS="$BOOT_OPTS -chardev socket,id=chrtpm,path=/dev/shm/tpm/swtpm-sock"
BOOT_OPTS="$BOOT_OPTS -chardev socket,id=chrtpm,path=/run/swtpm-sock"
BOOT_OPTS="$BOOT_OPTS -tpmdev emulator,id=tpm0,chardev=chrtpm -device tpm-tis,tpmdev=tpm0"
BOOT_OPTS="$BOOT_OPTS -global kvm-pit.lost_tick_policy=discard -global ICH9-LPC.disable_s3=1"
mkdir -p /dev/shm/tpm
chmod 755 /dev/shm/tpm
swtpm socket -t -d --tpmstate dir=/dev/shm/tpm --ctrl type=unixio,path=/dev/shm/tpm/swtpm-sock --tpm2
swtpm socket -t -d --tpmstate dir=/dev/shm/tpm --ctrl type=unixio,path=/run/swtpm-sock --tpm2
fi

View file

@ -19,13 +19,13 @@ if [[ "${BOOT_MODE,,}" == "windows" ]]; then
for (( i = 0; i < 10; i++ )); do
[ -S "/dev/shm/tpm/swtpm-sock" ] && break
[ -S "/run/swtpm-sock" ] && break
echo "Waiting for TPM socket to become available..."
sleep 1
done
if [ ! -S "/dev/shm/tpm/swtpm-sock" ]; then
if [ ! -S "/run/swtpm-sock" ]; then
error "TPM socket not found?" && exit 46
fi