systemd/initrd: Add TPM modules into initrd

This improves the out-of-box experience of TPM2 unlocking at a
small (50K) overhead.
This commit is contained in:
Zhaofeng Li 2022-09-23 15:47:05 -06:00
parent 21bbef9548
commit b9b454820a

View File

@ -332,7 +332,10 @@ in {
config = mkIf (config.boot.initrd.enable && cfg.enable) {
system.build = { inherit initialRamdisk; };
boot.initrd.availableKernelModules = [ "autofs4" ]; # systemd needs this for some features
boot.initrd.availableKernelModules = [
"autofs4" # systemd needs this for some features
"tpm-tis" "tpm-crb" # systemd-cryptenroll
];
boot.initrd.systemd = {
initrdBin = [pkgs.bash pkgs.coreutils cfg.package.kmod cfg.package] ++ config.system.fsPackages;