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}
4a1067
Version:	15.4
4a1067
Release:	4%{?dist}
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
Patch0001:	0001-Fix-a-broken-file-header-on-ia32.patch
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}
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
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}"
4a1067
if [ -f "%{SOURCE1}" ]; then
d84fc6
	MAKEFLAGS="$MAKEFLAGS VENDOR_CERT_FILE=%{SOURCE1}"
d84fc6
fi
4a1067
%if 0%{?dbxfile}
4a1067
if [ -f "%{SOURCE2}" ]; then
d84fc6
	MAKEFLAGS="$MAKEFLAGS VENDOR_DBX_FILE=%{SOURCE2}"
d84fc6
fi
4a1067
%endif
d84fc6
d84fc6
cd build-%{efiarch}
4a1067
make ${MAKEFLAGS} \
4a1067
	DEFAULT_LOADER='\\\\grub%{efiarch}.efi' \
4a1067
	all
d84fc6
cd ..
d84fc6
d84fc6
cd build-%{efialtarch}
4a1067
setarch linux32 -B make ${MAKEFLAGS} \
4a1067
	ARCH=%{efialtarch} \
4a1067
	DEFAULT_LOADER='\\\\grub%{efialtarch}.efi' \
4a1067
	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 "
4a1067
if [ -f "%{SOURCE1}" ]; then
d84fc6
	MAKEFLAGS="$MAKEFLAGS VENDOR_CERT_FILE=%{SOURCE1}"
d84fc6
fi
4a1067
%if 0%{?dbxfile}
4a1067
if [ -f "%{SOURCE2}" ]; then
d84fc6
	MAKEFLAGS="$MAKEFLAGS VENDOR_DBX_FILE=%{SOURCE2}"
d84fc6
fi
4a1067
%endif
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}
4a1067
setarch linux32 make ${MAKEFLAGS} \
4a1067
	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
4a1067
* Thu Apr 01 2021 Peter Jones <pjones@redhat.com> - 15.4-4
4a1067
- Fix the sbat data to actually match /this/ product.
4a1067
  Resolves: CVE-2020-14372
4a1067
  Resolves: CVE-2020-25632
4a1067
  Resolves: CVE-2020-25647
4a1067
  Resolves: CVE-2020-27749
4a1067
  Resolves: CVE-2020-27779
4a1067
  Resolves: CVE-2021-20225
4a1067
  Resolves: CVE-2021-20233
4a1067
4a1067
* Wed Mar 31 2021 Peter Jones <pjones@redhat.com> - 15.4-3
4a1067
- Build with the correct certificate trust list for this OS.
4a1067
  Resolves: CVE-2020-14372
4a1067
  Resolves: CVE-2020-25632
4a1067
  Resolves: CVE-2020-25647
4a1067
  Resolves: CVE-2020-27749
4a1067
  Resolves: CVE-2020-27779
4a1067
  Resolves: CVE-2021-20225
4a1067
  Resolves: CVE-2021-20233
4a1067
4a1067
* Wed Mar 31 2021 Peter Jones <pjones@redhat.com> - 15.4-2
4a1067
- Fix the ia32 build.
4a1067
  Resolves: CVE-2020-14372
4a1067
  Resolves: CVE-2020-25632
4a1067
  Resolves: CVE-2020-25647
4a1067
  Resolves: CVE-2020-27749
4a1067
  Resolves: CVE-2020-27779
4a1067
  Resolves: CVE-2021-20225
4a1067
  Resolves: CVE-2021-20233
4a1067
4a1067
* Tue Mar 30 2021 Peter Jones <pjones@redhat.com> - 15.4-1
4a1067
- Update to shim 15.4
4a1067
  - Support for revocations via the ".sbat" section and SBAT EFI variable
4a1067
  - A new unit test framework and a bunch of unit tests
4a1067
  - No external gnu-efi dependency
4a1067
  - Better CI
4a1067
  Resolves: CVE-2020-14372
4a1067
  Resolves: CVE-2020-25632
4a1067
  Resolves: CVE-2020-25647
4a1067
  Resolves: CVE-2020-27749
4a1067
  Resolves: CVE-2020-27779
4a1067
  Resolves: CVE-2021-20225
4a1067
  Resolves: CVE-2021-20233
4a1067
4a1067
* Wed Mar 24 2021 Peter Jones <pjones@redhat.com> - 15.3-0~1
4a1067
- Update to shim 15.3
4a1067
  - Support for revocations via the ".sbat" section and SBAT EFI variable
4a1067
  - A new unit test framework and a bunch of unit tests
4a1067
  - No external gnu-efi dependency
4a1067
  - Better CI
4a1067
  Resolves: CVE-2020-14372
4a1067
  Resolves: CVE-2020-25632
4a1067
  Resolves: CVE-2020-25647
4a1067
  Resolves: CVE-2020-27749
4a1067
  Resolves: CVE-2020-27779
4a1067
  Resolves: CVE-2021-20225
4a1067
  Resolves: CVE-2021-20233
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.