lol

Merge pull request #297475 from astro/ovmf-chv

OVMF: add cloudHypervisorSupport

authored by

Adam C. Stephens and committed by
GitHub
716b484f 45a89f4e

+33 -25
+26 -25
pkgs/applications/virtualization/OVMF/default.nix
··· 24 24 # Usually, this option is broken, do not use it except if you know what you are 25 25 # doing. 26 26 , sourceDebug ? false 27 + , projectDscPath ? { 28 + i686 = "OvmfPkg/OvmfPkgIa32.dsc"; 29 + x86_64 = "OvmfPkg/OvmfPkgX64.dsc"; 30 + aarch64 = "ArmVirtPkg/ArmVirtQemu.dsc"; 31 + riscv64 = "OvmfPkg/RiscVVirt/RiscVVirtQemu.dsc"; 32 + }.${stdenv.hostPlatform.parsed.cpu.name} 33 + or (throw "Unsupported OVMF `projectDscPath` on ${stdenv.hostPlatform.parsed.cpu.name}") 34 + , fwPrefix ? { 35 + i686 = "OVMF"; 36 + x86_64 = "OVMF"; 37 + aarch64 = "AAVMF"; 38 + riscv64 = "RISCV_VIRT"; 39 + }.${stdenv.hostPlatform.parsed.cpu.name} 40 + or (throw "Unsupported OVMF `fwPrefix` on ${stdenv.hostPlatform.parsed.cpu.name}") 41 + , metaPlatforms ? edk2.meta.platforms 27 42 }: 28 43 29 44 let 30 45 31 46 platformSpecific = { 32 - i686 = { 33 - projectDscPath = "OvmfPkg/OvmfPkgIa32.dsc"; 34 - fwPrefix = "OVMF"; 35 - }; 36 - x86_64 = { 37 - projectDscPath = "OvmfPkg/OvmfPkgX64.dsc"; 38 - fwPrefix = "OVMF"; 39 - msVarsArgs = { 40 - flavor = "OVMF_4M"; 41 - archDir = "X64"; 42 - }; 47 + x86_64.msVarsArgs = { 48 + flavor = "OVMF_4M"; 49 + archDir = "X64"; 43 50 }; 44 - aarch64 = { 45 - projectDscPath = "ArmVirtPkg/ArmVirtQemu.dsc"; 46 - fwPrefix = "AAVMF"; 47 - msVarsArgs = { 48 - flavor = "AAVMF"; 49 - archDir = "AARCH64"; 50 - }; 51 - }; 52 - riscv64 = { 53 - projectDscPath = "OvmfPkg/RiscVVirt/RiscVVirtQemu.dsc"; 54 - fwPrefix = "RISCV_VIRT"; 51 + aarch64.msVarsArgs = { 52 + flavor = "AAVMF"; 53 + archDir = "AARCH64"; 55 54 }; 56 55 }; 57 56 58 57 cpuName = stdenv.hostPlatform.parsed.cpu.name; 59 58 60 - inherit (platformSpecific.${cpuName}) 61 - projectDscPath fwPrefix msVarsArgs; 59 + inherit (platformSpecific.${cpuName}) msVarsArgs; 62 60 63 61 version = lib.getVersion edk2; 64 62 ··· 152 150 # release notes accordingly. 153 151 postInstall = '' 154 152 mkdir -vp $fd/FV 153 + '' + lib.optionalString (builtins.elem fwPrefix [ 154 + "OVMF" "AAVMF" "RISCV_VIRT" 155 + ]) '' 155 156 mv -v $out/FV/${fwPrefix}_{CODE,VARS}.fd $fd/FV 156 157 '' + lib.optionalString stdenv.hostPlatform.isx86 '' 157 158 mv -v $out/FV/${fwPrefix}.fd $fd/FV ··· 184 185 description = "Sample UEFI firmware for QEMU and KVM"; 185 186 homepage = "https://github.com/tianocore/tianocore.github.io/wiki/OVMF"; 186 187 license = lib.licenses.bsd2; 187 - inherit (edk2.meta) platforms; 188 + platforms = metaPlatforms; 188 189 maintainers = with lib.maintainers; [ adamcstephens raitobezarius ]; 189 190 broken = stdenv.isDarwin; 190 191 };
+7
pkgs/by-name/ov/OVMF-cloud-hypervisor/package.nix
··· 1 + { lib, OVMF }: 2 + 3 + OVMF.override { 4 + projectDscPath = "OvmfPkg/CloudHv/CloudHvX64.dsc"; 5 + fwPrefix = "CLOUDHV"; 6 + metaPlatforms = builtins.filter (lib.hasPrefix "x86_64-") OVMF.meta.platforms; 7 + }