Created
February 21, 2022 16:09
-
-
Save seysn/10cbd80f3e448df256df690a56739f51 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
if [ -f ".tpm2-getkey.tmp" ]; then | |
# tmp file exists, meaning we tried the TPM this boot, but it didn’t work for the drive and this must be the second | |
# or later pass for the drive. Either the TPM is failed/missing, or has the wrong key stored in it. | |
/lib/cryptsetup/askpass "Automatic disk unlock via TPM failed for () Enter passphrase: " | |
exit | |
fi | |
# No tmp, so it is the first time trying the script. Create a tmp file and try the TPM | |
touch .tpm2-getkey.tmp | |
tpm2_nvread 0x1500016 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment