Unverified Commit 63f1a1ec authored by Kroese's avatar Kroese Committed by GitHub
Browse files

fix: Move socket to /run (#375)

parent bf5f894c
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -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

+2 −2
Original line number Diff line number Diff line
@@ -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