aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAntonio Alvarez Feijoo <antonio.feijoo@suse.com>2021-11-23 14:53:18 +0100
committerJóhann B. Guðmundsson <johannbg@gmail.com>2021-11-24 06:49:39 +0000
commit5d990a004b5ae6863f2c9a633b184c07dd73563d (patch)
tree4a0eb2b25133e03f8453fcbab7cf13bb7a176e86
parentbf8738d31ca53ad6410c46c1f9b2a4a12273b9a3 (diff)
downloaddracut-5d990a004b5ae6863f2c9a633b184c07dd73563d.tar.gz
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.
-rwxr-xr-xmodules.d/90crypt/module-setup.sh9
1 files changed, 8 insertions, 1 deletions
diff --git a/modules.d/90crypt/module-setup.sh b/modules.d/90crypt/module-setup.sh
index acb9cf83..639d9cdd 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
}