Skip to content

Commit

Permalink
feat(crypt): check if pkcs11 module is needed in hostonly mode
Browse files Browse the repository at this point in the history
In hostonly mode, include the pkcs11 module if any encrypted volumes
are configured to be decrypted using pkcs11.
  • Loading branch information
johannbg committed Feb 2, 2022
1 parent 857b17f commit 56f4fb6
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions modules.d/90crypt/module-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,15 @@ depends() {
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
if grep -q -e "fido2-device=" -e "fido2-cid=" "$dracutsysrootdir"/etc/crypttab; then
deps+=" fido2"
fi
if grep -q "pkcs11-uri" "$dracutsysrootdir"/etc/crypttab; then
deps+=" pkcs11"
fi
if grep -q "tpm2-device=" "$dracutsysrootdir"/etc/crypttab; then
deps+=" tpm2-tss"
fi
fi
echo "$deps"
return 0
Expand Down

0 comments on commit 56f4fb6

Please sign in to comment.