a8752f8
# this is to make us only expand %%{dist} if we're on a modularity build.
a8752f8
# it's 2 macros make vim's \c not put a brace at the end of the changelog.
a0656a4
%global _dist %{expand:%{?_module_build:%%{?dist}}}
a0656a4
%global dist %{expand:%%{_dist}}
a0656a4
0abd456
Name:		shim
6e06d18
Version:	15.6
9de557d
Release:	2%{?dist}
a0656a4
Summary:	First-stage UEFI bootloader
a0656a4
License:	BSD
a8752f8
URL:		https://github.com/rhboot/shim/
3e21f6d
BuildRequires:	efi-filesystem
f4bf84f
BuildRequires:	efi-srpm-macros >= 5-1
a0656a4
a8752f8
ExclusiveArch:	%{efi}
a8752f8
# but we don't build a .i686 package, just a shim-ia32.x86_64 package
a8752f8
ExcludeArch:	%{ix86}
4f5f869
# but we don't build a .arm package, just a shim-arm.aarch64 package
a8752f8
ExcludeArch:	%{arm}
a8752f8
a8752f8
Source0:	shim.rpmmacros
f4bf84f
Source1:	shim.conf
a0656a4
a0656a4
# keep these two lists of sources synched up arch-wise.  That is 0 and 10
a0656a4
# match, 1 and 11 match, ...
a8752f8
Source10:	BOOTAA64.CSV
a8752f8
Source20:	shimaa64.efi
a8752f8
Source11:	BOOTIA32.CSV
a8752f8
Source21:	shimia32.efi
a8752f8
Source12:	BOOTX64.CSV
a8752f8
Source22:	shimx64.efi
6e06d18
#Source13:	BOOTARM.CSV
6e06d18
#Source23:	shimarm.efi
a8752f8
a8752f8
%include %{SOURCE0}
a8752f8
9d062d3
BuildRequires:	pesign >= 0.112-20.fc27
f54022b
# We need this because %%{efi} won't expand before choosing where to make
f54022b
# the src.rpm in koji, and we could be on a non-efi architecture, in which
f54022b
# case we won't have a valid expansion here...  To be solved in the future
f54022b
# (shim 16+) by making the unsigned packages all provide "shim-unsigned", so
f54022b
# we can just BuildRequires that.
f54022b
%ifarch x86_64
f54022b
BuildRequires: %{unsignedx64} = %{shimverx64}
f54022b
BuildRequires: %{unsignedia32} = %{shimveria32}
f54022b
%endif
f54022b
%ifarch aarch64
f54022b
BuildRequires: %{unsignedaa64} = %{shimveraa64}
6e06d18
#BuildRequires: %% {unsignedarm} = %% {shimverarm}
a8752f8
%endif
a0656a4
a0656a4
%description
a0656a4
Initial UEFI bootloader that handles chaining to a trusted full bootloader
a0656a4
under secure boot environments. This package contains the version signed by
a0656a4
the UEFI signing service.
a0656a4
a8752f8
%define_pkg -a %{efi_arch} -p 1
a8752f8
%if %{efi_has_alt_arch}
a8752f8
%define_pkg -a %{efi_alt_arch}
a0656a4
%endif
a0656a4
a0656a4
%prep
a0656a4
cd %{_builddir}
0abd456
rm -rf shim-%{version}
0abd456
mkdir shim-%{version}
a0656a4
a0656a4
%build
a0656a4
0abd456
cd shim-%{version}
a8752f8
%if %{efi_has_alt_arch}
4f5f869
%define_build -a %{efi_alt_arch} -A %{efi_alt_arch_upper} -i %{shimefialt} -b no -c %{is_alt_signed} -d %{shimdiralt}
a0656a4
%endif
4f5f869
%define_build -a %{efi_arch} -A %{efi_arch_upper} -i %{shimefi} -b no -c %{is_signed} -d %{shimdir}
a0656a4
a0656a4
%install
a0656a4
rm -rf $RPM_BUILD_ROOT
0abd456
cd shim-%{version}
a0656a4
install -D -d -m 0755 $RPM_BUILD_ROOT/boot/
a8752f8
install -D -d -m 0700 $RPM_BUILD_ROOT%{efi_esp_root}/
a8752f8
install -D -d -m 0700 $RPM_BUILD_ROOT%{efi_esp_efi}/
a8752f8
install -D -d -m 0700 $RPM_BUILD_ROOT%{efi_esp_dir}/
a8752f8
install -D -d -m 0700 $RPM_BUILD_ROOT%{efi_esp_boot}/
a8752f8
a8752f8
%do_install -a %{efi_arch} -A %{efi_arch_upper} -b %{bootcsv}
a8752f8
%if %{efi_has_alt_arch}
a8752f8
%do_install -a %{efi_alt_arch} -A %{efi_alt_arch_upper} -b %{bootcsvalt}
a0656a4
%endif
a8752f8
a8752f8
%if %{provide_legacy_shim}
a8752f8
install -m 0700 %{shimefi} $RPM_BUILD_ROOT%{efi_esp_dir}/shim.efi
a0656a4
%endif
f4bf84f
install -D -d -m 0755 $RPM_BUILD_ROOT%{_sysconfdir}/dnf/protected.d/
f4bf84f
install -m 0644 %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/dnf/protected.d/
a0656a4
a8752f8
( cd $RPM_BUILD_ROOT ; find .%{efi_esp_root} -type f ) \
a8752f8
  | sed -e 's/\./\^/' -e 's,^\\\./,.*/,' -e 's,$,$,' > %{__brp_mangle_shebangs_exclude_from_file}
a8752f8
a8752f8
%define_files -a %{efi_arch} -A %{efi_arch_upper}
a8752f8
%if %{provide_legacy_shim}
a8752f8
%{efi_esp_dir}/shim.efi
a0656a4
%endif
f4bf84f
%{_sysconfdir}/dnf/protected.d/shim.conf
f4bf84f
f1083ad
%if %{efi_has_alt_arch}
f1083ad
%define_files -a %{efi_alt_arch} -A %{efi_alt_arch_upper}
f4bf84f
%{_sysconfdir}/dnf/protected.d/shim.conf
f1083ad
%endif
a0656a4
a0656a4
%changelog
9de557d
* Thu Jul 07 2022 Robbie Harwood <rharwood@redhat.com> - 15.6-2
9de557d
- Update aarch64 (only) with relocation fixes
9de557d
- Resolves: #2101248
9de557d
1d32a64
* Wed Jun 15 2022 Peter Jones <pjones@redhat.com> - 15.6-1
6e06d18
- Update to shim-15.6
6e06d18
  Resolves: CVE-2022-28737
6e06d18
ab9d950
* Wed May 05 2021 Javier Martinez Canillas <javierm@redhat.com> - 15.4-5
ab9d950
- Bump release to build for F35
ab9d950
da8ecaa
* Wed Apr 21 2021 Javier Martinez Canillas <javierm@redhat.com> - 15.4-4
da8ecaa
- Fix handling of ignore_db and user_insecure_mode (pjones)
da8ecaa
- Fix booting on pre-UEFI Macs (pjones)
da8ecaa
- Fix mok variable storage allocation region (glin)
da8ecaa
  Resolves: rhbz#1948432
da8ecaa
- Fix the package version in the .sbat data (pjones)
da8ecaa
f4bf84f
* Tue Apr 06 2021 Peter Jones <pjones@redhat.com> - 15.4-3
f4bf84f
- Mark signed shim packages as protected in dnf.
f4bf84f
  Resolves: rhbz#1874541
f4bf84f
- Conflict with older fwupd, but don't require it.
f4bf84f
  Resolves: rhbz#1877751
f4bf84f
4f5f869
* Tue Apr 06 2021 Peter Jones <pjones@redhat.com> - 15.4-2
4f5f869
- Update to shim 15.4
4f5f869
  - Support for revocations via the ".sbat" section and SBAT EFI variable
4f5f869
  - A new unit test framework and a bunch of unit tests
4f5f869
  - No external gnu-efi dependency
4f5f869
  - Better CI
4f5f869
  Resolves: CVE-2020-14372
4f5f869
  Resolves: CVE-2020-25632
4f5f869
  Resolves: CVE-2020-25647
4f5f869
  Resolves: CVE-2020-27749
4f5f869
  Resolves: CVE-2020-27779
4f5f869
  Resolves: CVE-2021-20225
4f5f869
  Resolves: CVE-2021-20233
4f5f869
a2d56b6
* Tue Oct 02 2018 Peter Jones <pjones@redhat.com> - 15-8
a2d56b6
- Build a -8 because I can't tag -7 into f30 for pretty meh reasons.
a2d56b6
a069325
* Tue Oct 02 2018 Peter Jones <pjones@redhat.com> - 15-7
a069325
- Rebuild just because I'm dumb.
a069325
f1083ad
* Tue Oct 02 2018 Peter Jones <pjones@redhat.com> - 15-6
f1083ad
- Put the legacy shim.efi binary in the right subpackage
f1083ad
  Resolves: rhbz#1631989
f1083ad
3e21f6d
* Fri May 04 2018 Peter Jones <pjones@redhat.com> - 15-5
a8752f8
- Rework the .spec to use efi-rpm-macros.
a8752f8
595703b
* Fri May 04 2018 Peter Jones <pjones@redhat.com> - 15-4
b5087b8
- Fix directory permissions to be 0700 on FAT filesystems
b5087b8
240d9ca
* Mon Apr 30 2018 Peter Jones <pjones@redhat.com> - 15-3
240d9ca
- Pick a release value that'll be higher than what's in F28.
240d9ca
eb9b071
* Mon Apr 30 2018 Peter Jones <pjones@redhat.com> - 15-1
eb9b071
- Fix BOOT*.CSV and update release to -1
eb9b071
eb9b071
* Tue Apr 24 2018 Peter Jones <pjones@redhat.com> - 15-0.1
d369b28
- Update to shim 15.
d369b28
- more reproduceable build
d369b28
- better checking for bad linker output
d369b28
- flicker-free console if there's no error output
d369b28
- improved http boot support
d369b28
- better protocol re-installation
d369b28
- dhcp proxy support
d369b28
- tpm measurement even when verification is disabled
d369b28
- more reproducable builds
d369b28
- measurement of everything verified through shim_verify()
d369b28
- coverity and scan-build checker make targets
d369b28
- misc cleanups
d369b28
acc5812
* Tue Mar 06 2018 Peter Jones <pjones@redhat.com> - 13-5
acc5812
- Back off to the thing we had in 13-0.8 until I get new signatures.
acc5812
99b1d68
* Wed Feb 28 2018 Peter Jones <pjones@redhat.com> - 13-4
99b1d68
- Fix an inverted test that crept in in the signing macro.  (Woops.)
99b1d68
0abd456
* Wed Feb 28 2018 Peter Jones <pjones@redhat.com> - 13-2
0abd456
- Pivot the shim-signed package to be here.
0abd456
a0656a4
* Wed Nov 01 2017 Peter Jones <pjones@redhat.com> - 13-1
a0656a4
- Now with the actual signed 64-bit build of shim 13 for x64 as well.
a0656a4
- Make everything under /boot/efi be mode 0700, since that's what FAT will
a0656a4
  show anyway, so that rpm -V is correct.
a0656a4
  Resolves: rhbz#1508516
a0656a4
a0656a4
* Tue Oct 24 2017 Peter Jones <pjones@redhat.com> - 13-0.8
a0656a4
- Now with signed 32-bit x86 build.
a0656a4
  Related: rhbz#1474861
a0656a4
a0656a4
* Wed Oct 04 2017 Peter Jones <pjones@redhat.com> - 13-0.7
a0656a4
- Make /boot/efi/EFI/fedora/shim.efi still exist on aarch64 as well.
a0656a4
  Resolves: rhbz#1497854
a0656a4
a0656a4
* Tue Sep 19 2017 Peter Jones <pjones@redhat.com> - 13-0.6
a0656a4
- Fix binary format issue on Aarch64
a0656a4
  Resolves: rhbz#1489604
a0656a4
a0656a4
* Tue Sep 05 2017 Peter Jones <pjones@redhat.com> - 13-0.5
a0656a4
- Make /boot/efi/EFI/fedora/shim.efi still exist on x86_64, since some
a0656a4
  machines have boot entries that point to it.
a0656a4
a0656a4
* Tue Aug 29 2017 Peter Jones <pjones@redhat.com> - 13-0.4
a0656a4
- Make our provides not get silently ignore by rpmbuild...
a0656a4
a0656a4
* Fri Aug 25 2017 Peter Jones <pjones@redhat.com> - 13-0.3
a0656a4
- x64: use the new fbx64.efi and mm64.efi as fallback.efi and MokManager.efi
a0656a4
- Provide: "shim" in x64 and aa64 builds
a0656a4
a0656a4
* Thu Aug 24 2017 Peter Jones <pjones@redhat.com> - 13-0.2
a0656a4
- Obsolete old shim builds.
a0656a4
a0656a4
* Tue Aug 22 2017 Peter Jones <pjones@redhat.com> - 13-0.1
a0656a4
- Initial (partially unsigned) build for multi-arch support on x64/ia32.
a0656a4
a0656a4
* Thu Mar 23 2017 Petr Ĺ abata <contyk@redhat.com> - 0.8-9
a0656a4
- Re-enable dist tag for module builds
a0656a4
a0656a4
* Tue Feb 17 2015 Peter Jones <pjones@redhat.com> - 0.8-8
a0656a4
- Don't dual-sign shim-%%{efidir}.efi either.
a0656a4
  Resolves: rhbz#1184765
a0656a4
a0656a4
* Tue Feb 17 2015 Peter Jones <pjones@redhat.com> - 0.8-8
a0656a4
- Require dbxtool
a0656a4
a0656a4
* Wed Dec 17 2014 Peter Jones <pjones@redhat.com> - 0.8-7
a0656a4
- Wrong -signed changes got built for aarch64 last time, for dumb reasons.
a0656a4
  Related: rhbz#1170289
a0656a4
a0656a4
* Fri Dec 05 2014 Peter Jones <pjones@redhat.com> - 0.8-6
a0656a4
- Rebuild once more so we can use a different -unsigned version on different
a0656a4
  arches (because we can't tag a newer build into aarch64 without an x86
a0656a4
  update to match.)
a0656a4
  Related: rhbz#1170289
a0656a4
a0656a4
* Wed Dec 03 2014 Peter Jones <pjones@redhat.com> - 0.8-5
a0656a4
- Rebuild for aarch64 path fixes
a0656a4
  Related: rhbz#1170289
a0656a4
a0656a4
* Thu Oct 30 2014 Peter Jones <pjones@redhat.com> - 0.8-2
a0656a4
- Remove the dist tag so people don't complain about what it says.
a0656a4
a0656a4
* Fri Oct 24 2014 Peter Jones <pjones@redhat.com> - 0.8-1
a0656a4
- Update to shim 0.8
a0656a4
  rhbz#1148230
a0656a4
  rhbz#1148231
a0656a4
  rhbz#1148232
a0656a4
- Handle building on aarch64 as well
a0656a4
a0656a4
* Fri Jul 18 2014 Peter Jones <pjones@redhat.com> - 0.7-2
a0656a4
- Don't do multi-signing; too many machines screw up verification.
a0656a4
  Resolves: rhbz#1049749
a0656a4
a0656a4
* Wed Nov 13 2013 Peter Jones <pjones@redhat.com> - 0.7-1
a0656a4
- Update to shim 0.7
a0656a4
  Resolves: rhbz#1023767
a0656a4
a0656a4
* Thu Oct 24 2013 Peter Jones <pjones@redhat.com> - 0.5-1
a0656a4
- Update to shim 0.5
a0656a4
a0656a4
* Thu Jun 20 2013 Peter Jones <pjones@redhat.com> - 0.4-1
a0656a4
- Provide a fallback for uninitialized Boot#### and BootOrder
a0656a4
  Resolves: rhbz#963359
a0656a4
- Move all signing from shim-unsigned to here
a0656a4
- properly compare our generated hash from shim-unsigned with the hash of
a0656a4
  the signed binary (as opposed to doing it manually)
a0656a4
a0656a4
* Fri May 31 2013 Peter Jones <pjones@redhat.com> - 0.2-4.4
a0656a4
- Re-sign to get alignments that match the new specification.
a0656a4
  Resolves: rhbz#963361
a0656a4
a0656a4
* Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.2-4.3
a0656a4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
a0656a4
a0656a4
* Wed Jan 02 2013 Peter Jones <pjones@redhat.com> - 0.2-3.3
a0656a4
- Add obsoletes and provides for earlier shim-signed packages, to cover
a0656a4
  the package update cases where previous versions were installed.
a0656a4
  Related: rhbz#888026
a0656a4
a0656a4
* Mon Dec 17 2012 Peter Jones <pjones@redhat.com> - 0.2-3.2
a0656a4
- Make the shim-unsigned dep be on the subpackage.
a0656a4
a0656a4
* Sun Dec 16 2012 Peter Jones <pjones@redhat.com> - 0.2-3.1
a0656a4
- Rebuild to provide "shim" package directly instead of just as a Provides:
a0656a4
a0656a4
* Sat Dec 15 2012 Peter Jones <pjones@redhat.com> - 0.2-3
a0656a4
- Also provide shim-fedora.efi, signed only by the fedora signer.
a0656a4
- Fix the fedora signature on the result to actually be correct.
a0656a4
- Update for shim-unsigned 0.2-3
a0656a4
a0656a4
* Mon Dec 03 2012 Peter Jones <pjones@redhat.com> - 0.2-2
a0656a4
- Initial build