Skip to content

Commit

Permalink
Include actual TPM version detection in qubes-hcl-report
Browse files Browse the repository at this point in the history
  • Loading branch information
marmarta committed Nov 23, 2022
1 parent 8ef6202 commit 31824b4
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions qvm-tools/qubes-hcl-report
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,6 @@ QUBES=`cat $TEMP_DIR/qubes-release |cut -d '(' -f2 |cut -d ')' -f1`
XL_VTX=`cat $TEMP_DIR/xl-info |grep xen_caps | grep hvm`
XL_VTD=`cat $TEMP_DIR/xl-info |grep virt_caps |grep hvm_directio`
XL_HAP=`cat $TEMP_DIR/xl-dmesg |grep "$XL_DMESG_PREFIX_REGEX"'HVM: Hardware Assisted Paging (HAP) detected\( but disabled\)\?$'`
PCRS=`find /sys/devices/ -name pcrs`
XL_REMAP=`cat $TEMP_DIR/xl-dmesg |grep "$XL_DMESG_PREFIX_REGEX"'\(Intel VT-d Interrupt Remapping enabled\|Interrupt remapping enabled\)'`


Expand Down Expand Up @@ -176,14 +175,19 @@ else
HAP_VERBOSE="No"
fi

if [[ $PCRS ]]
if [[ -f "/sys/class/tpm/tpm0/tpm_version_major" ]]
then
# try tu run tcsd and: grep the logs, try get version info.
TPM="Device present"
TPM_s="yes"
TPM="Device present (TPM 2.0)"
TPM_s="2.0"
else
TPM="Device not found"
TPM_s="unknown"
if [[ -f "/sys/class/tpm/tpm0/pcrs" ]]
then
TPM="Device present (TPM 1.2)"
TPM_s="1.2"
else
TPM="Device not found"
TPM_s="unknown"
fi
fi

if [[ $XL_REMAP ]]
Expand Down

0 comments on commit 31824b4

Please sign in to comment.