diff options
author | Adam C. Stephens <2071575+adamcstephens@users.noreply.github.com> | 2024-04-19 13:27:37 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-04-19 13:27:37 -0400 |
commit | 716b484faececc3cd4570cc612ec9e927427d682 (patch) | |
tree | 990acc1ca0683bd367954ff54a6db5e6406bc56c /pkgs/applications | |
parent | 45a89f4ea3ccb6dc08b06f746a968992464d410f (diff) | |
parent | 17afbb81db5b5c0b3a211e5290b9ac7dbacd0021 (diff) |
Merge pull request #297475 from astro/ovmf-chv
OVMF: add cloudHypervisorSupport
Diffstat (limited to 'pkgs/applications')
-rw-r--r-- | pkgs/applications/virtualization/OVMF/default.nix | 51 |
1 files changed, 26 insertions, 25 deletions
diff --git a/pkgs/applications/virtualization/OVMF/default.nix b/pkgs/applications/virtualization/OVMF/default.nix index 4798e324141d6..79df60253ff59 100644 --- a/pkgs/applications/virtualization/OVMF/default.nix +++ b/pkgs/applications/virtualization/OVMF/default.nix @@ -24,41 +24,39 @@ # Usually, this option is broken, do not use it except if you know what you are # doing. , sourceDebug ? false +, projectDscPath ? { + i686 = "OvmfPkg/OvmfPkgIa32.dsc"; + x86_64 = "OvmfPkg/OvmfPkgX64.dsc"; + aarch64 = "ArmVirtPkg/ArmVirtQemu.dsc"; + riscv64 = "OvmfPkg/RiscVVirt/RiscVVirtQemu.dsc"; + }.${stdenv.hostPlatform.parsed.cpu.name} + or (throw "Unsupported OVMF `projectDscPath` on ${stdenv.hostPlatform.parsed.cpu.name}") +, fwPrefix ? { + i686 = "OVMF"; + x86_64 = "OVMF"; + aarch64 = "AAVMF"; + riscv64 = "RISCV_VIRT"; + }.${stdenv.hostPlatform.parsed.cpu.name} + or (throw "Unsupported OVMF `fwPrefix` on ${stdenv.hostPlatform.parsed.cpu.name}") +, metaPlatforms ? edk2.meta.platforms }: let platformSpecific = { - i686 = { - projectDscPath = "OvmfPkg/OvmfPkgIa32.dsc"; - fwPrefix = "OVMF"; + x86_64.msVarsArgs = { + flavor = "OVMF_4M"; + archDir = "X64"; }; - x86_64 = { - projectDscPath = "OvmfPkg/OvmfPkgX64.dsc"; - fwPrefix = "OVMF"; - msVarsArgs = { - flavor = "OVMF_4M"; - archDir = "X64"; - }; - }; - aarch64 = { - projectDscPath = "ArmVirtPkg/ArmVirtQemu.dsc"; - fwPrefix = "AAVMF"; - msVarsArgs = { - flavor = "AAVMF"; - archDir = "AARCH64"; - }; - }; - riscv64 = { - projectDscPath = "OvmfPkg/RiscVVirt/RiscVVirtQemu.dsc"; - fwPrefix = "RISCV_VIRT"; + aarch64.msVarsArgs = { + flavor = "AAVMF"; + archDir = "AARCH64"; }; }; cpuName = stdenv.hostPlatform.parsed.cpu.name; - inherit (platformSpecific.${cpuName}) - projectDscPath fwPrefix msVarsArgs; + inherit (platformSpecific.${cpuName}) msVarsArgs; version = lib.getVersion edk2; @@ -152,6 +150,9 @@ edk2.mkDerivation projectDscPath (finalAttrs: { # release notes accordingly. postInstall = '' mkdir -vp $fd/FV + '' + lib.optionalString (builtins.elem fwPrefix [ + "OVMF" "AAVMF" "RISCV_VIRT" + ]) '' mv -v $out/FV/${fwPrefix}_{CODE,VARS}.fd $fd/FV '' + lib.optionalString stdenv.hostPlatform.isx86 '' mv -v $out/FV/${fwPrefix}.fd $fd/FV @@ -184,7 +185,7 @@ edk2.mkDerivation projectDscPath (finalAttrs: { description = "Sample UEFI firmware for QEMU and KVM"; homepage = "https://github.com/tianocore/tianocore.github.io/wiki/OVMF"; license = lib.licenses.bsd2; - inherit (edk2.meta) platforms; + platforms = metaPlatforms; maintainers = with lib.maintainers; [ adamcstephens raitobezarius ]; broken = stdenv.isDarwin; }; |