summaryrefslogtreecommitdiff
path: root/src/init
diff options
context:
space:
mode:
authorsarthurdev <965089+sarthurdev@users.noreply.github.com>2025-07-15 16:47:20 +0200
committersarthurdev <965089+sarthurdev@users.noreply.github.com>2025-07-15 16:47:20 +0200
commit1a22eacd20e74aa013ca95bc4442ad4475ea7675 (patch)
tree609543f1a83296334591511fda903e5821c9ce1f /src/init
parent6c3efdc7c7d3c1e1e9f130bfb37c644e1ac0b4bf (diff)
downloadvyos-1x-1a22eacd20e74aa013ca95bc4442ad4475ea7675.tar.gz
vyos-1x-1a22eacd20e74aa013ca95bc4442ad4475ea7675.zip
tpm: T4919: Add boot warning if TPM not present
Diffstat (limited to 'src/init')
-rwxr-xr-xsrc/init/vyos-router7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/init/vyos-router b/src/init/vyos-router
index 563f12755..7a02ce564 100755
--- a/src/init/vyos-router
+++ b/src/init/vyos-router
@@ -97,6 +97,13 @@ mount_encrypted_config() {
return 0
fi
+ if [ ! -e /sys/class/tpm/tpm0 ]; then
+ echo "WARN: TPM device not found, encrypted config volume will not be automatically mounted"
+ echo "Use 'encryption load' to load volume manually with a key"
+ echo "or 'encryption disable' to decrypt volume with a key"
+ return 1
+ fi
+
vyos_tpm_key=$(python3 -c 'from vyos.tpm import read_tpm_key; print(read_tpm_key().decode())' 2>/dev/null)
if [ $? -ne 0 ]; then
echo "ERROR: Failed to fetch encryption key from TPM. Encrypted config volume has not been mounted"