diff --git a/shim.spec b/shim.spec index 08494df..4173742 100644 --- a/shim.spec +++ b/shim.spec @@ -1,38 +1,50 @@ +%ifarch aarch64 +%global efi_arch aa64 +%global bootcsv BOOTAA64.CSV +%global bootefi BOOTAA64.EFI +%endif + +%ifarch x86_64 +%global efi_arch x64 +%global bootcsv BOOTX64.CSV +%global bootefi BOOTX64.EFI +%endif + %global debug_package %{nil} %global __debug_package 1 %global _binaries_in_noarch_packages_terminate_build 0 -%global __debug_install_post %{SOURCE100} aa64 %undefine _debuginfo_subpackages +%global __debug_install_post %{SOURCE100} %{efi_arch} %global efidir %(eval echo $(grep ^ID= /etc/os-release | sed -e 's/^ID=//' )) -%global efiarch aa64 -%global shimdir %{_datadir}/shim/%{version}-%{release}/%{efiarch} +%global shimdir %{_datadir}/shim/%{version}-%{release}/%{efi_arch} %global shimefivendor /boot/efi/EFI/%{efi_vendor}/ %global shimBOOT /boot/efi/EFI/BOOT/ Name: shim Version: 15 -Release: 10 +Release: 14 Summary: First-stage UEFI bootloader -ExclusiveArch: aarch64 +ExclusiveArch: x86_64 aarch64 License: BSD URL: https://github.com/rhboot/shim Source0: https://github.com/rhboot/shim/releases/download/%{version}/shim-%{version}.tar.bz2 Source1: BOOTAA64.CSV +Source2: BOOTX64.CSV Source100: shim-find-debuginfo.sh BuildRequires: elfutils-libelf-devel openssl-devel openssl git pesign gnu-efi gnu-efi-devel Requires: dbxtool efi-filesystem mokutil Provides: bundled(openssl) = 1.0.2j -Provides: shim-aa64 -Obsoletes: shim-aa64 +Provides: shim-%{efi_arch} +Obsoletes: shim-%{efi_arch} %description Initial UEFI bootloader that handles chaining to a trusted full \ bootloader under secure boot environments. %package debuginfo -Summary: Debug information for shim-unsigned-aarch64 +Summary: Debug information for shim-unsigned Requires: %{name}-debugsource = %{version}-%{release} AutoReqProv: 0 BuildArch: noarch @@ -57,7 +69,7 @@ chmod +x %{SOURCE100} %autosetup -n shim-%{version} -S git git config --unset user.email git config --unset user.name -mkdir build-%{efiarch} +mkdir build-%{efi_arch} %build COMMITID=$(cat commit) @@ -66,8 +78,8 @@ MAKEFLAGS+="EFIDIR=%{efidir} PKGNAME=shim RELEASE=%{release} " MAKEFLAGS+="ENABLE_HTTPBOOT=true ENABLE_SHIM_HASH=true " MAKEFLAGS+="%{_smp_mflags}" -cd build-%{efiarch} -make ${MAKEFLAGS} DEFAULT_LOADER='\\\\grub%{efiarch}.efi' all +cd build-%{efi_arch} +make ${MAKEFLAGS} DEFAULT_LOADER='\\\\grub%{efi_arch}.efi' all cd .. %install @@ -76,37 +88,54 @@ MAKEFLAGS="TOPDIR=.. -f ../Makefile COMMITID=${COMMITID} " MAKEFLAGS+="EFIDIR=%{efidir} PKGNAME=shim RELEASE=%{release} " MAKEFLAGS+="ENABLE_HTTPBOOT=true ENABLE_SHIM_HASH=true " -cd build-%{efiarch} +cd build-%{efi_arch} make ${MAKEFLAGS} \ - DEFAULT_LOADER='\\\\grub%{efiarch}.efi' \ + DEFAULT_LOADER='\\\\grub%{efi_arch}.efi' \ DESTDIR=${RPM_BUILD_ROOT} \ install-debuginfo install-debugsource install -d -m 0700 ${RPM_BUILD_ROOT}/%{shimBOOT} -install -m 0700 fbaa64.efi ${RPM_BUILD_ROOT}/%{shimBOOT} -install -m 0700 mmaa64.efi ${RPM_BUILD_ROOT}/%{shimBOOT} -install -m 0700 shimaa64.efi ${RPM_BUILD_ROOT}/%{shimBOOT}/BOOTAA64.EFI +install -m 0700 fb%{efi_arch}.efi ${RPM_BUILD_ROOT}/%{shimBOOT} +install -m 0700 mm%{efi_arch}.efi ${RPM_BUILD_ROOT}/%{shimBOOT} +install -m 0700 shim%{efi_arch}.efi ${RPM_BUILD_ROOT}/%{shimBOOT}/%{bootefi} install -d -m 0700 ${RPM_BUILD_ROOT}/%{shimefivendor} -install -m 0700 %{SOURCE1} ${RPM_BUILD_ROOT}/%{shimefivendor} install -m 0700 *.efi ${RPM_BUILD_ROOT}/%{shimefivendor} install -m 0700 *.hash ${RPM_BUILD_ROOT}/%{shimefivendor} +%ifarch aarch64 +install -m 0700 %{SOURCE1} ${RPM_BUILD_ROOT}/%{shimefivendor} +%endif +%ifarch x86_64 +install -m 0700 %{SOURCE2} ${RPM_BUILD_ROOT}/%{shimefivendor} +%endif cd .. %files %license COPYRIGHT -%{shimBOOT}/fbaa64.efi -%{shimBOOT}/mmaa64.efi -%{shimBOOT}/BOOTAA64.EFI -%{shimefivendor}/BOOTAA64.CSV +%{shimBOOT}/fb%{efi_arch}.efi +%{shimBOOT}/mm%{efi_arch}.efi +%{shimBOOT}/%{bootefi} +%{shimefivendor}/%{bootcsv} %{shimefivendor}/*.efi %{shimefivendor}/*.hash -%files debuginfo -f build-%{efiarch}/debugfiles.list +%files debuginfo -f build-%{efi_arch}/debugfiles.list -%files debugsource -f build-%{efiarch}/debugsource.list +%files debugsource -f build-%{efi_arch}/debugsource.list %changelog +* Tue Nov 27 2019 openEuler Buildteam - 15-14 +- Remove excess install + +* Thu Nov 21 2019 openEuler Buildteam - 15-13 +- Add defination of efi_arch + +* Mon Nov 18 2019 openEuler Buildteam - 15-12 +- Add %{bootefi} + +* Thu Nov 14 2019 openEuler Buildteam - 15-11 +- Add arch x86_64 + * Thu Sep 26 2019 openEuler Buildteam - 15-10 - Add missing BOOTAA64.CSV