[ipxe/f19: 2/2] Build UEFI drivers for QEMU and include them

bonzini bonzini at fedoraproject.org
Mon May 20 11:41:36 UTC 2013


commit 9eea98cb5be0a442ebede50d51e127d8d3edaa58
Author: Gerd Hoffmann <kraxel at redhat.com>
Date:   Mon May 20 13:38:17 2013 +0200

    Build UEFI drivers for QEMU and include them
    
    Fixes BZ#958875.

 ipxe.spec |   37 ++++++++++++++++++++++++++++++++++---
 1 files changed, 34 insertions(+), 3 deletions(-)
---
diff --git a/ipxe.spec b/ipxe.spec
index 124469c..722d18e 100644
--- a/ipxe.spec
+++ b/ipxe.spec
@@ -13,8 +13,11 @@
 
 # We only build the ROMs if on an x86 build host. The resulting
 # binary RPM will be noarch, so other archs will still be able
-# to use the binary ROMs
-%global buildarches %{ix86} x86_64
+# to use the binary ROMs.
+#
+# We could also use cross-compilation, but EDK II does not support
+# big-endian hosts.
+%global buildarches x86_64
 
 # debugging firmwares does not goes the same way as a normal program.
 # moreover, all architectures providing debuginfo for a single noarch
@@ -36,7 +39,7 @@
 
 Name:    ipxe
 Version: %{date}
-Release: 1.git%{hash}%{?dist}
+Release: 2.git%{hash}%{?dist}
 Summary: A network boot loader
 
 Group:   System Environment/Base
@@ -58,6 +61,7 @@ BuildRequires: perl
 BuildRequires: syslinux
 BuildRequires: mtools
 BuildRequires: mkisofs
+BuildRequires: edk2-tools
 Obsoletes: gpxe <= 1.0.1
 
 %package bootimgs
@@ -132,11 +136,29 @@ rm -rf drivers/net/ath/ath9k
 make bin/undionly.kpxe bin/ipxe.{dsk,iso,usb,lkrn} allroms \
                    ISOLINUX_BIN=${ISOLINUX_BIN} NO_WERROR=1 V=1 \
 		   GITVERSION=%{hash}
+
+# build roms with efi support for qemu
+mkdir bin-combined
+for rom in %qemuroms; do
+  make NO_WERROR=1 V=1 GITVERSION=%{hash} bin/${rom}.rom
+  make NO_WERROR=1 V=1 GITVERSION=%{hash} bin-i386-efi/${rom}.efidrv
+  make NO_WERROR=1 V=1 GITVERSION=%{hash} bin-x86_64-efi/${rom}.efidrv
+  vid="0x${rom%%????}"
+  did="0x${rom#????}"
+  EfiRom -f "$vid" -i "$did" --pci23 \
+         -b  bin/${rom}.rom \
+         -ec bin-i386-efi/${rom}.efidrv \
+         -ec bin-x86_64-efi/${rom}.efidrv \
+         -o  bin-combined/${rom}.rom
+  EfiRom -d  bin-combined/${rom}.rom
+done
+
 %endif
 
 %install
 %ifarch %{buildarches}
 mkdir -p %{buildroot}/%{_datadir}/%{name}/
+mkdir -p %{buildroot}/%{_datadir}/%{name}.efi/
 pushd src/bin/
 
 cp -a undionly.kpxe ipxe.{iso,usb,dsk,lkrn} %{buildroot}/%{_datadir}/%{name}/
@@ -159,6 +181,10 @@ for fmt in rom ;do
   echo %{_datadir}/%{name}/${rom}.${fmt} >> qemu.${fmt}.list
  done
 done
+for rom in %{qemuroms}; do
+  cp src/bin-combined/${rom}.rom %{buildroot}/%{_datadir}/%{name}.efi/
+  echo %{_datadir}/%{name}.efi/${rom}.rom >> qemu.rom.list
+done
 %endif
 
 %ifarch %{buildarches}
@@ -177,10 +203,15 @@ done
 
 %files roms-qemu -f qemu.rom.list
 %dir %{_datadir}/%{name}
+%dir %{_datadir}/%{name}.efi
 %doc COPYING COPYRIGHTS
 %endif
 
 %changelog
+* Mon May 20 2013 Paolo Bonzini <pbonzini at redhat.com> - 20130103-3.git717279a
+- Build UEFI drivers for QEMU and include them (patch from Gerd Hoffmann.
+  BZ#958875)
+
 * Fri May 17 2013 Daniel P. Berrange <berrange at redhat.com> - 20130517-1.gitc4bce43
 - Update to latest upstream snapshot
 


More information about the scm-commits mailing list