From: Antonio Alvarez Feijoo Date: Tue, 23 Nov 2021 13:53:18 +0000 (+0100) Subject: feat(crypt): check if tpm2-tss module is needed in hostonly mode X-Git-Tag: 056~81 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5d990a004b5ae6863f2c9a633b184c07dd73563d;p=thirdparty%2Fdracut.git feat(crypt): check if tpm2-tss module is needed in hostonly mode In hostonly mode, include the tpm2-tss module if any encrypted volumes are configured to be decrypted using the TPM2 device. --- diff --git a/modules.d/90crypt/module-setup.sh b/modules.d/90crypt/module-setup.sh index acb9cf834..639d9cddd 100755 --- a/modules.d/90crypt/module-setup.sh +++ b/modules.d/90crypt/module-setup.sh @@ -18,7 +18,14 @@ check() { # called by dracut depends() { - echo dm rootfs-block + local deps + deps="dm rootfs-block" + if [[ $hostonly && -f "$dracutsysrootdir"/etc/crypttab ]]; then + if grep -q "tpm2-device=" "$dracutsysrootdir"/etc/crypttab; then + deps+=" tpm2-tss" + fi + fi + echo "$deps" return 0 }