summary refs log tree commit diff
path: root/pkgs/applications/virtualization
diff options
context:
space:
mode:
authorJoachim Fasting <joachifm@fastmail.fm>2017-05-18 12:46:14 +0200
committerJoachim Fasting <joachifm@fastmail.fm>2017-05-20 12:33:48 +0200
commit252dcd62f39ec9163832805dd41286c75f802530 (patch)
tree34c016bd538bcb4d45403f6cacef7440e74889c8 /pkgs/applications/virtualization
parente000fb05dba84ea28dc3edaa3ad664b4a2500f29 (diff)
downloadnixpkgs-252dcd62f39ec9163832805dd41286c75f802530.tar
nixpkgs-252dcd62f39ec9163832805dd41286c75f802530.tar.gz
nixpkgs-252dcd62f39ec9163832805dd41286c75f802530.tar.bz2
nixpkgs-252dcd62f39ec9163832805dd41286c75f802530.tar.lz
nixpkgs-252dcd62f39ec9163832805dd41286c75f802530.tar.xz
nixpkgs-252dcd62f39ec9163832805dd41286c75f802530.tar.zst
nixpkgs-252dcd62f39ec9163832805dd41286c75f802530.zip
OVMF: separate output for ovmf binaries
OVMF{,CODE,VARS}.fd are now available in a dedicated fd output, greatly
reducing the closure in the common case where only those files are used (a
few MBs versus several hundred MBs for the full OVMF).

Note: it's unclear why `dontPatchELF` is now necessary for the build to
pass (on my end, at any rate) but it doesn't make much sense to run this
fixup anyway,

Note: my reading of xen's INSTALL suggests that --with-system-ovmf should
point directly to the OVMF binary.  As such, the previous invocation was
incorrect (it pointed to the root of the OVMF tree).  In any case, I have
only built xen with `--with-system-ovmf`, I have not tested it.

Fixes https://github.com/NixOS/nixpkgs/issues/25854
Closes https://github.com/NixOS/nixpkgs/pull/25855
Diffstat (limited to 'pkgs/applications/virtualization')
-rw-r--r--pkgs/applications/virtualization/OVMF/default.nix9
-rw-r--r--pkgs/applications/virtualization/xen/4.5.nix2
2 files changed, 10 insertions, 1 deletions
diff --git a/pkgs/applications/virtualization/OVMF/default.nix b/pkgs/applications/virtualization/OVMF/default.nix
index 608ae594a2e..4f7ea37ca18 100644
--- a/pkgs/applications/virtualization/OVMF/default.nix
+++ b/pkgs/applications/virtualization/OVMF/default.nix
@@ -15,6 +15,8 @@ in
 stdenv.mkDerivation (edk2.setup "OvmfPkg/OvmfPkg${targetArch}.dsc" {
   name = "OVMF-${version}";
 
+  outputs = [ "out" "fd" ];
+
   # TODO: properly include openssl for secureBoot
   buildInputs = [nasm iasl] ++ stdenv.lib.optionals (secureBoot == true) [ openssl ];
 
@@ -48,6 +50,13 @@ stdenv.mkDerivation (edk2.setup "OvmfPkg/OvmfPkg${targetArch}.dsc" {
       build -D CSM_ENABLE -D FD_SIZE_2MB ${if secureBoot then "-DSECURE_BOOT_ENABLE=TRUE" else ""}
     '';
 
+  postFixup = ''
+    mkdir -p $fd/FV
+    mv $out/FV/OVMF{,_CODE,_VARS}.fd $fd/FV
+  '';
+
+  dontPatchELF = true;
+
   meta = {
     description = "Sample UEFI firmware for QEMU and KVM";
     homepage = http://sourceforge.net/apps/mediawiki/tianocore/index.php?title=OVMF;
diff --git a/pkgs/applications/virtualization/xen/4.5.nix b/pkgs/applications/virtualization/xen/4.5.nix
index 754f800afad..3fbdee981c4 100644
--- a/pkgs/applications/virtualization/xen/4.5.nix
+++ b/pkgs/applications/virtualization/xen/4.5.nix
@@ -167,7 +167,7 @@ callPackage (import ./generic.nix (rec {
     ++ optional (withSeabios) "--with-system-seabios=${seabios}"
     ++ optional (!withInternalSeabios && !withSeabios) "--disable-seabios"
 
-    ++ optional (withOVMF) "--with-system-ovmf=${OVMF}"
+    ++ optional (withOVMF) "--with-system-ovmf=${OVMF.fd}/FV/OVMF.fd"
     ++ optional (withInternalOVMF) "--enable-ovmf";
 
   patches =