Build UEFI drivers for QEMU and include them

Fixes BZ#958875.
This commit is contained in:
Gerd Hoffmann 2013-05-20 13:38:17 +02:00 committed by Paolo Bonzini
parent f8be579190
commit 9eea98cb5b

View File

@ -13,8 +13,11 @@
# We only build the ROMs if on an x86 build host. The resulting # 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 # binary RPM will be noarch, so other archs will still be able
# to use the binary ROMs # to use the binary ROMs.
%global buildarches %{ix86} x86_64 #
# 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. # debugging firmwares does not goes the same way as a normal program.
# moreover, all architectures providing debuginfo for a single noarch # moreover, all architectures providing debuginfo for a single noarch
@ -36,7 +39,7 @@
Name: ipxe Name: ipxe
Version: %{date} Version: %{date}
Release: 1.git%{hash}%{?dist} Release: 2.git%{hash}%{?dist}
Summary: A network boot loader Summary: A network boot loader
Group: System Environment/Base Group: System Environment/Base
@ -58,6 +61,7 @@ BuildRequires: perl
BuildRequires: syslinux BuildRequires: syslinux
BuildRequires: mtools BuildRequires: mtools
BuildRequires: mkisofs BuildRequires: mkisofs
BuildRequires: edk2-tools
Obsoletes: gpxe <= 1.0.1 Obsoletes: gpxe <= 1.0.1
%package bootimgs %package bootimgs
@ -132,11 +136,29 @@ rm -rf drivers/net/ath/ath9k
make bin/undionly.kpxe bin/ipxe.{dsk,iso,usb,lkrn} allroms \ make bin/undionly.kpxe bin/ipxe.{dsk,iso,usb,lkrn} allroms \
ISOLINUX_BIN=${ISOLINUX_BIN} NO_WERROR=1 V=1 \ ISOLINUX_BIN=${ISOLINUX_BIN} NO_WERROR=1 V=1 \
GITVERSION=%{hash} 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 %endif
%install %install
%ifarch %{buildarches} %ifarch %{buildarches}
mkdir -p %{buildroot}/%{_datadir}/%{name}/ mkdir -p %{buildroot}/%{_datadir}/%{name}/
mkdir -p %{buildroot}/%{_datadir}/%{name}.efi/
pushd src/bin/ pushd src/bin/
cp -a undionly.kpxe ipxe.{iso,usb,dsk,lkrn} %{buildroot}/%{_datadir}/%{name}/ 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 echo %{_datadir}/%{name}/${rom}.${fmt} >> qemu.${fmt}.list
done done
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 %endif
%ifarch %{buildarches} %ifarch %{buildarches}
@ -177,10 +203,15 @@ done
%files roms-qemu -f qemu.rom.list %files roms-qemu -f qemu.rom.list
%dir %{_datadir}/%{name} %dir %{_datadir}/%{name}
%dir %{_datadir}/%{name}.efi
%doc COPYING COPYRIGHTS %doc COPYING COPYRIGHTS
%endif %endif
%changelog %changelog
* Mon May 20 2013 Paolo Bonzini <pbonzini@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@redhat.com> - 20130517-1.gitc4bce43 * Fri May 17 2013 Daniel P. Berrange <berrange@redhat.com> - 20130517-1.gitc4bce43
- Update to latest upstream snapshot - Update to latest upstream snapshot