diff options
author | Robert Hensing <roberth@users.noreply.github.com> | 2022-08-23 13:29:23 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-08-23 13:29:23 +0200 |
commit | 10f175334406d1ff626945562bb9a047923869c1 (patch) | |
tree | 37c914aae6e3d20b7dcc90ced15e5d1bae53eaf6 /pkgs/applications/virtualization | |
parent | f414e1f853aaa896566b2ec33f748a39a972e1b4 (diff) | |
parent | c91d0713ac476dfb367bbe12a7a048f6162f039c (diff) |
Merge pull request #187887 from RaitoBezarius/ovmf-uefi-prefixes
ovmf: expose EFI prefixes and refactor qemu-vm with it
Diffstat (limited to 'pkgs/applications/virtualization')
-rw-r--r-- | pkgs/applications/virtualization/OVMF/default.nix | 25 |
1 files changed, 22 insertions, 3 deletions
diff --git a/pkgs/applications/virtualization/OVMF/default.nix b/pkgs/applications/virtualization/OVMF/default.nix index 82d98274f8ae5..9a4276997b8ee 100644 --- a/pkgs/applications/virtualization/OVMF/default.nix +++ b/pkgs/applications/virtualization/OVMF/default.nix @@ -1,4 +1,4 @@ -{ stdenv, lib, edk2, util-linux, nasm, acpica-tools +{ stdenv, nixosTests, lib, edk2, util-linux, nasm, acpica-tools , csmSupport ? false, seabios ? null , secureBoot ? false , httpSupport ? false @@ -19,9 +19,15 @@ let throw "Unsupported architecture"; version = lib.getVersion edk2; + + suffixes = { + x86_64 = "FV/OVMF"; + aarch64 = "FV/AAVMF"; + }; + in -edk2.mkDerivation projectDscPath { +edk2.mkDerivation projectDscPath (finalAttrs: { pname = "OVMF"; inherit version; @@ -62,10 +68,23 @@ edk2.mkDerivation projectDscPath { dontPatchELF = true; + passthru = + let + cpuName = stdenv.hostPlatform.parsed.cpu.name; + suffix = suffixes."${cpuName}" or (throw "Host cpu name `${cpuName}` is not supported in this OVMF derivation!"); + prefix = "${finalAttrs.finalPackage.fd}/${suffix}"; + in { + firmware = "${prefix}_CODE.fd"; + variables = "${prefix}_VARS.fd"; + # This will test the EFI firmware for the host platform as part of the NixOS Tests setup. + tests.basic-systemd-boot = nixosTests.systemd-boot.basic; + }; + meta = { description = "Sample UEFI firmware for QEMU and KVM"; homepage = "https://github.com/tianocore/tianocore.github.io/wiki/OVMF"; license = lib.licenses.bsd2; platforms = ["x86_64-linux" "i686-linux" "aarch64-linux" "x86_64-darwin"]; + maintainers = [ lib.maintainers.raitobezarius ]; }; -} +}) |