Distribute edk2-aarch64 on x86 (bz #1338027)

This commit is contained in:
Cole Robinson 2016-05-21 10:39:41 -04:00
parent 6ac749e232
commit 1db20ef467

View File

@ -4,7 +4,7 @@
Name: edk2 Name: edk2
Version: %{edk2_date}git%{edk2_githash} Version: %{edk2_date}git%{edk2_githash}
Release: 0%{dist} Release: 1%{dist}
Summary: EFI Development Kit II Summary: EFI Development Kit II
Group: Applications/Emulators Group: Applications/Emulators
@ -45,6 +45,7 @@ ExclusiveArch: %{ix86} x86_64 %{arm} aarch64
BuildRequires: python BuildRequires: python
BuildRequires: libuuid-devel BuildRequires: libuuid-devel
BuildRequires: gcc-aarch64-linux-gnu
%ifarch x86_64 %ifarch x86_64
BuildRequires: iasl BuildRequires: iasl
BuildRequires: nasm BuildRequires: nasm
@ -53,6 +54,7 @@ BuildRequires: mtools
BuildRequires: genisoimage BuildRequires: genisoimage
%endif %endif
%description %description
EDK II is a development code base for creating UEFI drivers, applications EDK II is a development code base for creating UEFI drivers, applications
and firmware images. and firmware images.
@ -94,7 +96,6 @@ EFI Development Kit II
Open Virtual Machine Firmware (x64) Open Virtual Machine Firmware (x64)
%endif %endif
%ifarch aarch64
%package aarch64 %package aarch64
Summary: AARCH64 Virtual Machine Firmware Summary: AARCH64 Virtual Machine Firmware
Provides: AAVMF Provides: AAVMF
@ -102,7 +103,7 @@ BuildArch: noarch
%description aarch64 %description aarch64
EFI Development Kit II EFI Development Kit II
AARCH64 UEFI Firmware AARCH64 UEFI Firmware
%endif
%prep %prep
%setup -q -n tianocore-%{name}-%{edk2_githash} %setup -q -n tianocore-%{name}-%{edk2_githash}
@ -115,6 +116,7 @@ tar -C CryptoPkg/Library/OpensslLib -xf %{SOURCE1}
(cd CryptoPkg/Library/OpensslLib; ./Install.sh) (cd CryptoPkg/Library/OpensslLib; ./Install.sh)
cp CryptoPkg/Library/OpensslLib/openssl-*/LICENSE LICENSE.openssl cp CryptoPkg/Library/OpensslLib/openssl-*/LICENSE LICENSE.openssl
%build %build
source ./edksetup.sh source ./edksetup.sh
@ -147,6 +149,7 @@ OVMF_SB_FLAGS="${OVMF_SB_FLAGS} -D EXCLUDE_SHELL_FROM_FD"
ARM_FLAGS="${CC_FLAGS}" ARM_FLAGS="${CC_FLAGS}"
ARM_FLAGS="${ARM_FLAGS} -D DEBUG_PRINT_ERROR_LEVEL=0x8040004F" ARM_FLAGS="${ARM_FLAGS} -D DEBUG_PRINT_ERROR_LEVEL=0x8040004F"
unset MAKEFLAGS
make -C BaseTools #%{?_smp_mflags} make -C BaseTools #%{?_smp_mflags}
sed -i -e 's/-Werror//' Conf/tools_def.txt sed -i -e 's/-Werror//' Conf/tools_def.txt
@ -167,15 +170,16 @@ cp Build/Ovmf3264/*/X64/EnrollDefaultKeys.efi ovmf
sh %{SOURCE3} ovmf sh %{SOURCE3} ovmf
%endif %endif
%ifarch aarch64
# build arm/aarch64 firmware # build arm/aarch64 firmware
export GCC49_AARCH64_PREFIX="aarch64-linux-gnu-"
mkdir -p aarch64 mkdir -p aarch64
build $ARM_FLAGS -a AARCH64 -p ArmVirtPkg/ArmVirtQemu.dsc build $ARM_FLAGS -a AARCH64 -p ArmVirtPkg/ArmVirtQemu.dsc
cp Build/ArmVirtQemu-AARCH64/DEBUG_*/FV/*.fd aarch64 cp Build/ArmVirtQemu-AARCH64/DEBUG_*/FV/*.fd aarch64
dd of="aarch64/QEMU_EFI-pflash.raw" if="/dev/zero" bs=1M count=64 dd of="aarch64/QEMU_EFI-pflash.raw" if="/dev/zero" bs=1M count=64
dd of="aarch64/QEMU_EFI-pflash.raw" if="aarch64/QEMU_EFI.fd" conv=notrunc dd of="aarch64/QEMU_EFI-pflash.raw" if="aarch64/QEMU_EFI.fd" conv=notrunc
dd of="aarch64/vars-template-pflash.raw" if="/dev/zero" bs=1M count=64 dd of="aarch64/vars-template-pflash.raw" if="/dev/zero" bs=1M count=64
%endif unset GCC49_AARCH64_PREFIX
%install %install
mkdir -p %{buildroot}%{_bindir} \ mkdir -p %{buildroot}%{_bindir} \
@ -204,9 +208,8 @@ mkdir -p %{buildroot}/usr/share/%{name}
%ifarch x86_64 %ifarch x86_64
cp -a ovmf %{buildroot}/usr/share/%{name} cp -a ovmf %{buildroot}/usr/share/%{name}
%endif %endif
%ifarch aarch64
cp -a aarch64 %{buildroot}/usr/share/%{name} cp -a aarch64 %{buildroot}/usr/share/%{name}
%endif
%files tools %files tools
%{_bindir}/BootSectImage %{_bindir}/BootSectImage
@ -260,16 +263,18 @@ cp -a aarch64 %{buildroot}/usr/share/%{name}
/usr/share/%{name}/ovmf/*.iso /usr/share/%{name}/ovmf/*.iso
%endif %endif
%ifarch aarch64
%files aarch64 %files aarch64
%license ArmVirtPkg/License.txt %license ArmVirtPkg/License.txt
%dir /usr/share/%{name} %dir /usr/share/%{name}
%dir /usr/share/%{name}/aarch64 %dir /usr/share/%{name}/aarch64
/usr/share/%{name}/aarch64/QEMU*.fd /usr/share/%{name}/aarch64/QEMU*.fd
/usr/share/%{name}/aarch64/*.raw /usr/share/%{name}/aarch64/*.raw
%endif
%changelog %changelog
* Sat May 21 2016 Cole Robinson <crobinso@redhat.com> - 20160418gita8c39ba-1
- Distribute edk2-aarch64 on x86 (bz #1338027)
* Mon Apr 18 2016 Gerd Hoffmann <kraxel@redhat.com> 20160418gita8c39ba-0 * Mon Apr 18 2016 Gerd Hoffmann <kraxel@redhat.com> 20160418gita8c39ba-0
- Update to latest git. - Update to latest git.
- Add firmware builds (FatPkg is free now). - Add firmware builds (FatPkg is free now).