diff --git a/modules.d/90crypt/module-setup.sh b/modules.d/90crypt/module-setup.sh index acb9cf8344..639d9cdddc 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 }