OVMF: add TPM2 support flags

This commit is contained in:
Jade 2021-10-11 02:28:39 -04:00
parent 24d90f4150
commit 0b92261d6a
No known key found for this signature in database
GPG Key ID: 80A1F76FC9F954AE
3 changed files with 12 additions and 4 deletions

View File

@ -2,6 +2,7 @@
, csmSupport ? false, seabios ? null
, secureBoot ? false
, httpSupport ? false
, tpmSupport ? false
}:
assert csmSupport -> seabios != null;
@ -30,9 +31,10 @@ edk2.mkDerivation projectDscPath {
hardeningDisable = [ "format" "stackprotector" "pic" "fortify" ];
buildFlags =
lib.optional secureBoot "-DSECURE_BOOT_ENABLE=TRUE"
lib.optional secureBoot "-D SECURE_BOOT_ENABLE=TRUE"
++ lib.optionals csmSupport [ "-D CSM_ENABLE" "-D FD_SIZE_2MB" ]
++ lib.optionals httpSupport [ "-DNETWORK_HTTP_ENABLE=TRUE" "-DNETWORK_HTTP_BOOT_ENABLE=TRUE" ];
++ lib.optionals httpSupport [ "-D NETWORK_HTTP_ENABLE=TRUE" "-D NETWORK_HTTP_BOOT_ENABLE=TRUE" ]
++ lib.optionals tpmSupport [ "-D TPM_ENABLE" "-D TPM2_ENABLE" "-D TPM2_CONFIG_ENABLE"];
postPatch = lib.optionalString csmSupport ''
cp ${seabios}/Csm16.bin OvmfPkg/Csm/Csm16/Csm16.bin

View File

@ -615,6 +615,8 @@ mapAliases ({
osquery = throw "osquery has been removed."; # added 2019-11-24
osxfuse = macfuse-stubs; # added 2021-03-20
otter-browser = throw "otter-browser has been removed from nixpkgs, as it was unmaintained"; # added 2020-02-02
OVMF-CSM = throw "OVMF-CSM has been removed in favor of OVMFFull"; # added 2021-10-16
OVMF-secureBoot = throw "OVMF-secureBoot has been removed in favor of OVMFFull"; # added 2021-10-16
owncloudclient = owncloud-client; # added 2016-08
ocz-ssd-guru = throw "ocz-ssd-guru has been removed due to there being no source available"; # added 2021-07-12
p11_kit = p11-kit; # added 2018-02-25

View File

@ -20912,8 +20912,12 @@ with pkgs;
qboot = pkgsi686Linux.callPackage ../applications/virtualization/qboot { };
OVMF = callPackage ../applications/virtualization/OVMF { };
OVMF-CSM = OVMF.override { csmSupport = true; };
OVMF-secureBoot = OVMF.override { secureBoot = true; };
OVMFFull = callPackage ../applications/virtualization/OVMF {
secureBoot = true;
csmSupport = true;
httpSupport = true;
tpmSupport = true;
};
seabios = callPackage ../applications/virtualization/seabios { };