Blame SPECS/shim-unsigned-x64.spec

d84fc6
%global pesign_vre 0.106-1
d84fc6
%global openssl_vre 1.0.2j
d84fc6
d84fc6
%global efidir %(eval echo $(grep ^ID= /etc/os-release | sed -e 's/^ID=//' -e 's/rhel/redhat/'))
d84fc6
%global shimrootdir %{_datadir}/shim/
d84fc6
%global shimversiondir %{shimrootdir}/%{version}-%{release}
d84fc6
%global efiarch x64
d84fc6
%global shimdir %{shimversiondir}/%{efiarch}
d84fc6
%global efialtarch ia32
d84fc6
%global shimaltdir %{shimversiondir}/%{efialtarch}
d84fc6
4a1067
%global debug_package %{nil}
4a1067
%global __debug_package 1
4a1067
%global _binaries_in_noarch_packages_terminate_build 0
4a1067
%global __debug_install_post %{SOURCE100} %{efiarch} %{efialtarch}
4a1067
%undefine _debuginfo_subpackages
4a1067
4a1067
# currently here's what's in our dbx: nothing
4a1067
%global dbxfile %{nil}
4a1067
d84fc6
Name:		shim-unsigned-%{efiarch}
88d6c0
Version:	15.5
88d6c0
Release:	1.el8
d84fc6
Summary:	First-stage UEFI bootloader
d84fc6
ExclusiveArch:	x86_64
d84fc6
License:	BSD
d84fc6
URL:		https://github.com/rhboot/shim
d84fc6
Source0:	https://github.com/rhboot/shim/releases/download/%{version}/shim-%{version}.tar.bz2
d84fc6
Source1:	redhatsecurebootca5.cer
4a1067
%if 0%{?dbxfile}
4a1067
Source2:	%{dbxfile}
4a1067
%endif
4a1067
Source3:	sbat.redhat.csv
d84fc6
d84fc6
Source100:	shim-find-debuginfo.sh
d84fc6
4a1067
BuildRequires:	gcc make
d84fc6
BuildRequires:	elfutils-libelf-devel
d84fc6
BuildRequires:	git openssl-devel openssl
d84fc6
BuildRequires:	pesign >= %{pesign_vre}
4a1067
BuildRequires:	dos2unix findutils
d84fc6
d84fc6
# Shim uses OpenSSL, but cannot use the system copy as the UEFI ABI is not
d84fc6
# compatible with SysV (there's no red zone under UEFI) and there isn't a
d84fc6
# POSIX-style C library.
d84fc6
# BuildRequires:	OpenSSL
d84fc6
Provides:	bundled(openssl) = %{openssl_vre}
d84fc6
d84fc6
%global desc \
d84fc6
Initial UEFI bootloader that handles chaining to a trusted full \
d84fc6
bootloader under secure boot environments.
d84fc6
%global debug_desc \
d84fc6
This package provides debug information for package %{expand:%%{name}} \
d84fc6
Debug information is useful when developing applications that \
d84fc6
use this package or when debugging this package.
d84fc6
d84fc6
%description
d84fc6
%desc
d84fc6
d84fc6
%package -n shim-unsigned-%{efialtarch}
d84fc6
Summary:	First-stage UEFI bootloader (unsigned data)
d84fc6
Provides:	bundled(openssl) = %{openssl_vre}
d84fc6
d84fc6
%description -n shim-unsigned-%{efialtarch}
d84fc6
%desc
d84fc6
d84fc6
%package debuginfo
d84fc6
Summary:	Debug information for shim-unsigned-%{efiarch}
88d6c0
Requires:	%{name}-debugsource = %{version}-%{release}
d84fc6
Group:		Development/Debug
d84fc6
AutoReqProv:	0
d84fc6
BuildArch:	noarch
d84fc6
d84fc6
%description debuginfo
d84fc6
%debug_desc
d84fc6
d84fc6
%package -n shim-unsigned-%{efialtarch}-debuginfo
d84fc6
Summary:	Debug information for shim-unsigned-%{efialtarch}
d84fc6
Group:		Development/Debug
88d6c0
Requires:	%{name}-debugsource = %{version}-%{release}
d84fc6
AutoReqProv:	0
d84fc6
BuildArch:	noarch
d84fc6
d84fc6
%description -n shim-unsigned-%{efialtarch}-debuginfo
d84fc6
%debug_desc
d84fc6
d84fc6
%package debugsource
d84fc6
Summary:	Debug Source for shim-unsigned
d84fc6
Group:		Development/Debug
d84fc6
AutoReqProv:	0
d84fc6
BuildArch:	noarch
d84fc6
d84fc6
%description debugsource
d84fc6
%debug_desc
d84fc6
d84fc6
%prep
d84fc6
%autosetup -S git -n shim-%{version}
d84fc6
git config --unset user.email
d84fc6
git config --unset user.name
d84fc6
mkdir build-%{efiarch}
d84fc6
mkdir build-%{efialtarch}
4a1067
cp %{SOURCE3} data/
d84fc6
d84fc6
%build
d84fc6
COMMITID=$(cat commit)
d84fc6
MAKEFLAGS="TOPDIR=.. -f ../Makefile COMMITID=${COMMITID} "
d84fc6
MAKEFLAGS+="EFIDIR=%{efidir} PKGNAME=shim RELEASE=%{release} "
4a1067
MAKEFLAGS+="ENABLE_SHIM_HASH=true "
d84fc6
MAKEFLAGS+="%{_smp_mflags}"
88d6c0
if [ -s "%{SOURCE1}" ]; then
d84fc6
	MAKEFLAGS="$MAKEFLAGS VENDOR_CERT_FILE=%{SOURCE1}"
d84fc6
fi
88d6c0
if [ -s "%{SOURCE2}" ]; then
d84fc6
	MAKEFLAGS="$MAKEFLAGS VENDOR_DBX_FILE=%{SOURCE2}"
d84fc6
fi
d84fc6
d84fc6
cd build-%{efiarch}
88d6c0
make ${MAKEFLAGS} DEFAULT_LOADER='\\\\grub%{efiarch}.efi' all
d84fc6
cd ..
d84fc6
d84fc6
cd build-%{efialtarch}
88d6c0
setarch linux32 -B make ${MAKEFLAGS} ARCH=%{efialtarch} DEFAULT_LOADER='\\\\grub%{efialtarch}.efi' all
d84fc6
cd ..
d84fc6
d84fc6
%install
d84fc6
COMMITID=$(cat commit)
d84fc6
MAKEFLAGS="TOPDIR=.. -f ../Makefile COMMITID=${COMMITID} "
d84fc6
MAKEFLAGS+="EFIDIR=%{efidir} PKGNAME=shim RELEASE=%{release} "
4a1067
MAKEFLAGS+="ENABLE_SHIM_HASH=true "
88d6c0
if [ -s "%{SOURCE1}" ]; then
d84fc6
	MAKEFLAGS="$MAKEFLAGS VENDOR_CERT_FILE=%{SOURCE1}"
d84fc6
fi
88d6c0
if [ -s "%{SOURCE2}" ]; then
d84fc6
	MAKEFLAGS="$MAKEFLAGS VENDOR_DBX_FILE=%{SOURCE2}"
d84fc6
fi
d84fc6
d84fc6
cd build-%{efiarch}
d84fc6
make ${MAKEFLAGS} \
d84fc6
	DEFAULT_LOADER='\\\\grub%{efiarch}.efi' \
d84fc6
	DESTDIR=${RPM_BUILD_ROOT} \
d84fc6
	install-as-data install-debuginfo install-debugsource
d84fc6
cd ..
d84fc6
d84fc6
cd build-%{efialtarch}
88d6c0
setarch linux32 make ${MAKEFLAGS} ARCH=%{efialtarch} \
d84fc6
	DEFAULT_LOADER='\\\\grub%{efialtarch}.efi' \
d84fc6
	DESTDIR=${RPM_BUILD_ROOT} \
d84fc6
	install-as-data install-debuginfo install-debugsource
d84fc6
cd ..
d84fc6
d84fc6
%files
d84fc6
%license COPYRIGHT
d84fc6
%dir %{shimrootdir}
d84fc6
%dir %{shimversiondir}
d84fc6
%dir %{shimdir}
d84fc6
%{shimdir}/*.efi
d84fc6
%{shimdir}/*.hash
4a1067
%{shimdir}/*.CSV
d84fc6
d84fc6
%files -n shim-unsigned-%{efialtarch}
d84fc6
%license COPYRIGHT
d84fc6
%dir %{shimrootdir}
d84fc6
%dir %{shimversiondir}
d84fc6
%dir %{shimaltdir}
d84fc6
%{shimaltdir}/*.efi
d84fc6
%{shimaltdir}/*.hash
4a1067
%{shimaltdir}/*.CSV
d84fc6
d84fc6
%files debuginfo -f build-%{efiarch}/debugfiles.list
d84fc6
d84fc6
%files -n shim-unsigned-%{efialtarch}-debuginfo -f build-%{efialtarch}/debugfiles.list
d84fc6
d84fc6
%files debugsource -f build-%{efiarch}/debugsource.list
d84fc6
d84fc6
%changelog
88d6c0
* Wed Mar 09 2022 Peter Jones <pjones@redhat.com> - 15.5-1.el8
88d6c0
- Update to shim-15.5
88d6c0
  Related: rhbz#1982071
88d6c0
88d6c0
* Thu Sep 17 2020 Peter Jones <pjones@redhat.com> - 15-9.el8
88d6c0
- Fix an incorrect allocation size.
88d6c0
  Related: rhbz#1877253
88d6c0
88d6c0
* Thu Jul 30 2020 Peter Jones <pjones@redhat.com> - 15-8
88d6c0
- Fix a load-address-dependent forever loop.
88d6c0
  Resolves: rhbz#1861977
88d6c0
  Related: CVE-2020-10713
88d6c0
  Related: CVE-2020-14308
88d6c0
  Related: CVE-2020-14309
88d6c0
  Related: CVE-2020-14310
88d6c0
  Related: CVE-2020-14311
88d6c0
  Related: CVE-2020-15705
88d6c0
  Related: CVE-2020-15706
88d6c0
  Related: CVE-2020-15707
88d6c0
88d6c0
* Sat Jul 25 2020 Peter Jones <pjones@redhat.com> - 15-7
88d6c0
- Implement Lenny's workaround
88d6c0
  Related: CVE-2020-10713
88d6c0
  Related: CVE-2020-14308
88d6c0
  Related: CVE-2020-14309
88d6c0
  Related: CVE-2020-14310
88d6c0
  Related: CVE-2020-14311
88d6c0
88d6c0
* Fri Jul 24 2020 Peter Jones <pjones@redhat.com> - 15-5
88d6c0
- Once more with the MokListRT config table patch added.
88d6c0
  Related: CVE-2020-10713
88d6c0
  Related: CVE-2020-14308
88d6c0
  Related: CVE-2020-14309
88d6c0
  Related: CVE-2020-14310
88d6c0
  Related: CVE-2020-14311
88d6c0
88d6c0
* Thu Jul 23 2020 Peter Jones <pjones@redhat.com> - 15-4
88d6c0
- Rebuild for bug fixes and new signing keys
88d6c0
  Related: CVE-2020-10713
88d6c0
  Related: CVE-2020-14308
88d6c0
  Related: CVE-2020-14309
88d6c0
  Related: CVE-2020-14310
88d6c0
  Related: CVE-2020-14311
d84fc6
d84fc6
* Wed Jun 05 2019 Javier Martinez Canillas <javierm@redhat.com> - 15-3
d84fc6
- Make EFI variable copying fatal only on secureboot enabled systems
d84fc6
  Resolves: rhbz#1715878
d84fc6
- Fix booting shim from an EFI shell using a relative path
d84fc6
  Resolves: rhbz#1717064
d84fc6
d84fc6
* Tue Feb 12 2019 Peter Jones <pjones@redhat.com> - 15-2
d84fc6
- Fix MoK mirroring issue which breaks kdump without intervention
d84fc6
  Related: rhbz#1668966
d84fc6
d84fc6
* Fri Jul 20 2018 Peter Jones <pjones@redhat.com> - 15-1
d84fc6
- Update to shim 15
d84fc6
d84fc6
* Tue Sep 19 2017 Peter Jones <pjones@redhat.com> - 13-3
d84fc6
- Actually update to the *real* 13 final.
d84fc6
  Related: rhbz#1489604
d84fc6
d84fc6
* Thu Aug 31 2017 Peter Jones <pjones@redhat.com> - 13-2
d84fc6
- Actually update to 13 final.
d84fc6
d84fc6
* Fri Aug 18 2017 Peter Jones <pjones@redhat.com> - 13-1
d84fc6
- Make a new shim-unsigned-x64 package like the shim-unsigned-aarch64 one.
d84fc6
- This will (eventually) supersede what's in the "shim" package so we can
d84fc6
  make "shim" hold the signed one, which will confuse fewer people.