diff options
author | Bryan Freed <bfreed@chromium.org> | 2016-01-07 09:11:58 -0800 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2016-01-07 14:29:42 -0800 |
commit | fd2b02abbf1c61f3887a0e4409dc7599a943c1f4 (patch) | |
tree | 1664fcdea0967c7560afca90e38634cd30ab3d8b | |
parent | 58cb8c532b0909edb34d17c7fd32b0559b917eb9 (diff) | |
download | vboot-fd2b02abbf1c61f3887a0e4409dc7599a943c1f4.tar.gz |
Update a utility to support the new tpm sysfs class directory
Kernel TPM patches from 4.x moved /sys/class/misc/tpm0 to /sys/class/tpm/tpm0.
Support both paths in this utility.
BUG=chromium:573368
BRANCH=none
TEST=untested, not sure if this utility is still used.
Change-Id: Ib81476eee4c9de921502a3a47f6990b9e6b1968b
Reviewed-on: https://chromium-review.googlesource.com/320892
Commit-Ready: Bryan Freed <bfreed@chromium.org>
Tested-by: Bryan Freed <bfreed@chromium.org>
Reviewed-by: Duncan Laurie <dlaurie@chromium.org>
-rw-r--r-- | utility/tpm-dad-lock | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/utility/tpm-dad-lock b/utility/tpm-dad-lock index 95fa0856..ba5527c9 100644 --- a/utility/tpm-dad-lock +++ b/utility/tpm-dad-lock @@ -7,7 +7,11 @@ # Attempt to trigger the TPM Dictionary Attack Defense Lock and measure its # behavior. -owned=$(cat /sys/class/misc/tpm0/device/owned) +if [ -f /sys/class/misc/tpm0/device/owned ]; then + owned=$(cat /sys/class/misc/tpm0/device/owned) +else + owned=$(cat /sys/class/tpm/tpm0/device/owned) +fi if [ "$owned" = "" ]; then echo "TPM is not functional" exit 1 |