From 1a22eacd20e74aa013ca95bc4442ad4475ea7675 Mon Sep 17 00:00:00 2001 From: sarthurdev <965089+sarthurdev@users.noreply.github.com> Date: Tue, 15 Jul 2025 16:47:20 +0200 Subject: tpm: T4919: Add boot warning if TPM not present --- src/init/vyos-router | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/init') 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" -- cgit v1.2.3