arrfab / rpms / shim

Forked from rpms/shim 5 years ago
Clone

Blame SPECS/shim.spec

e22f8f
Name:           shim
7adeae
Version:        0.9
7adeae
Release:        1%{?dist}
e22f8f
Summary:        First-stage UEFI bootloader
e22f8f
e22f8f
License:        BSD
e22f8f
URL:            http://www.codon.org.uk/~mjg59/shim/
e97c83
Source0:	https://github.com/mjg59/shim/releases/download/%{version}/shim-%{version}.tar.bz2
e22f8f
Source1:	securebootca.cer
7adeae
# currently here's what's in our dbx: # nothing.
7adeae
#Source2:	dbx.esl
7adeae
Source3:	shim-find-debuginfo.sh
e22f8f
7adeae
Patch0001:	0001-Typo-on-aarch64.patch
e22f8f
e22f8f
BuildRequires: git openssl-devel openssl
e22f8f
BuildRequires: pesign >= 0.106-1
7adeae
BuildRequires: gnu-efi >= 1:3.0.2, gnu-efi-devel >= 1:3.0.2
e22f8f
e22f8f
# for xxd
e22f8f
BuildRequires: vim-common
e22f8f
e22f8f
# Shim uses OpenSSL, but cannot use the system copy as the UEFI ABI is not
e22f8f
# compatible with SysV (there's no red zone under UEFI) and there isn't a
e22f8f
# POSIX-style C library.
e22f8f
# BuildRequires: OpenSSL
e22f8f
Provides: bundled(openssl) = 0.9.8w
e22f8f
e22f8f
# Shim is only required on platforms implementing the UEFI secure boot
e22f8f
# protocol. The only one of those we currently wish to support is 64-bit x86.
e22f8f
# Adding further platforms will require adding appropriate relocation code.
7adeae
ExclusiveArch: x86_64 aarch64
e22f8f
e97c83
%ifarch x86_64
e97c83
%global efiarch x64
e97c83
%endif
e97c83
%ifarch aarch64
e97c83
%global efiarch aa64
e97c83
%endif
e97c83
e22f8f
# Figure out the right file path to use
7adeae
%global efidir %(eval echo $(grep ^ID= /etc/os-release | sed -e 's/^ID=//' -e 's/rhel/redhat/'))
7adeae
7adeae
%define debug_package %{nil}
7adeae
%global __debug_package 1
e22f8f
e22f8f
%description
e22f8f
Initial UEFI bootloader that handles chaining to a trusted full bootloader
e22f8f
under secure boot environments.
e22f8f
e22f8f
%package -n shim-unsigned
e22f8f
Summary: First-stage UEFI bootloader (unsigned data)
e22f8f
e22f8f
%description -n shim-unsigned
e22f8f
Initial UEFI bootloader that handles chaining to a trusted full bootloader
e22f8f
under secure boot environments.
e22f8f
7adeae
%package -n shim-unsigned-%{efiarch}-debuginfo
7adeae
Obsoletes: shim-debuginfo < 0.9
7adeae
Summary: Debug information for package %{name}
7adeae
Group: Development/Debug
7adeae
AutoReqProv: 0
7adeae
BuildArch: noarch
e22f8f
7adeae
%description -n shim-unsigned-%{efiarch}-debuginfo
7adeae
This package provides debug information for package %{name}.
7adeae
Debug information is useful when developing applications that use this
7adeae
package or when debugging this package.
e22f8f
e22f8f
%prep
7adeae
%setup -n %{name}-%{version}-%{efiarch} -T -c
7adeae
cd %{_builddir}
7adeae
%{__tar} -xo -f %{SOURCE0}
7adeae
mv %{name}-%{version} %{name}-%{version}-%{efiarch}
7adeae
%setup -q -D -T -n %{name}-%{version}-%{efiarch}/%{name}-%{version}
e22f8f
git init
e97c83
git config user.email "example@example.com"
e97c83
git config user.name "rpmbuild -bp"
e22f8f
git add .
e22f8f
git commit -a -q -m "%{version} baseline."
e97c83
git am --ignore-whitespace %{patches} 
e97c83
git config --unset user.email
e97c83
git config --unset user.name
e22f8f
e22f8f
%build
7adeae
MAKEFLAGS="VENDOR_CERT_FILE=%{SOURCE1}"
7adeae
# MAKEFLAGS="$MAKEFLAGS VENDOR_DBX_FILE=%{SOURCE2}"
7adeae
MAKEFLAGS="$MAKEFLAGS RELEASE=%{release}"
e97c83
make 'DEFAULT_LOADER=\\\\grub%{efiarch}.efi' ${MAKEFLAGS} shim.efi MokManager.efi fallback.efi
e22f8f
e22f8f
%install
e22f8f
rm -rf $RPM_BUILD_ROOT
e22f8f
pesign -h -P -i shim.efi -h > shim.hash
7adeae
install -D -d -m 0755 $RPM_BUILD_ROOT%{_datadir}/shim/%{efiarch}-%{version}-%{release}/
7adeae
install -m 0644 shim.hash $RPM_BUILD_ROOT%{_datadir}/shim/%{efiarch}-%{version}-%{release}/shim.hash
7adeae
for x in shim fallback MokManager ; do
7adeae
	install -m 0644 $x.efi $RPM_BUILD_ROOT%{_datadir}/shim/%{efiarch}-%{version}-%{release}/
7adeae
	install -m 0644 $x.so $RPM_BUILD_ROOT%{_datadir}/shim/%{efiarch}-%{version}-%{release}/
7adeae
done
7adeae
7adeae
%global __debug_install_post						\
7adeae
	bash %{SOURCE3}							\\\
7adeae
		%{?_missing_build_ids_terminate_build:--strict-build-id}\\\
7adeae
		%{?_find_debuginfo_opts} "%{_builddir}/%{?buildsubdir}"	\
7adeae
	rm -f $RPM_BUILD_ROOT%{_datadir}/shim/%{efiarch}-%{version}-%{release}/*.so		\
7adeae
	%{nil}
e22f8f
e22f8f
%files -n shim-unsigned
e22f8f
%dir %{_datadir}/shim
7adeae
%dir %{_datadir}/shim/%{efiarch}-%{version}-%{release}/
7adeae
%{_datadir}/shim/%{efiarch}-%{version}-%{release}/*.efi
7adeae
%{_datadir}/shim/%{efiarch}-%{version}-%{release}/*.hash
e22f8f
7adeae
%files -n shim-unsigned-%{efiarch}-debuginfo -f debugfiles.list
7adeae
%defattr(-,root,root)
e22f8f
e22f8f
%changelog
7adeae
* Mon Jun 22 2015 Peter Jones <pjones@redhat.com> - 0.9-1
7adeae
- Update to 0.9-1
7adeae
- Fix early call to BS->Exit()
7adeae
  Resolves: rhbz#1115843
7adeae
- Implement shim on aarch64
7adeae
  Resolves: rhbz#1100048
7adeae
  Resolves: rhbz#1190191
7adeae
7adeae
* Mon Jun 22 2015 Peter Jones <pjones@redhat.com> - 0.7-14
7adeae
- Excise mokutil.
7adeae
  Related: rhbz#1100048
7adeae
7adeae
* Mon Jun 22 2015 Peter Jones <pjones@redhat.com> - 0.7-13
7adeae
- Do a build for Aarch64 to make the tree composable.
7adeae
  Related: rhbz#1100048
7adeae
7adeae
* Wed Feb 25 2015 Peter Jones <pjones@redhat.com> - 0.7-10
7adeae
- Fix a couple more minor bugs aavmf has found in fallback.
7adeae
  Related: rhbz#1190191
7adeae
- Build lib/ with the right CFLAGS
7adeae
  Related: rhbz#1190191
7adeae
7adeae
* Tue Feb 24 2015 Peter Jones <pjones@redhat.com> - 0.7-9
7adeae
- Fix aarch64 section loading.
7adeae
  Related: rhbz#1190191
7adeae
e97c83
* Tue Sep 30 2014 Peter Jones <pjones@redhat.com> - 0.7-8
7adeae
- Build -8 for arm as well.
7adeae
  Related: rhbz#1100048
e97c83
- out-of-bounds memory read flaw in DHCPv6 packet processing
e97c83
  Resolves: CVE-2014-3675
e97c83
- heap-based buffer overflow flaw in IPv6 address parsing
e97c83
  Resolves: CVE-2014-3676
e97c83
- memory corruption flaw when processing Machine Owner Keys (MOKs)
e97c83
  Resolves: CVE-2014-3677
e97c83
e97c83
* Tue Sep 23 2014 Peter Jones <pjones@redhat.com> - 0.7-7
e97c83
- Use the right key for ARM Aarch64.
e97c83
e97c83
* Sun Sep 21 2014 Peter Jones <pjones@redhat.com> - 0.7-6
e97c83
- Preliminary build for ARM Aarch64.
e97c83
f2fa6b
* Tue Feb 18 2014 Peter Jones <pjones@redhat.com> - 0.7-5
f2fa6b
- Update for production signing
f2fa6b
  Resolves: rhbz#1064424
f2fa6b
  Related: rhbz#1064449
f2fa6b
e22f8f
* Thu Nov 21 2013 Peter Jones <pjones@redhat.com> - 0.7-4
e22f8f
- Make dhcpv4 paths work better when netbooting.
e22f8f
  Resolves: rhbz#1032583
e22f8f
e22f8f
* Thu Nov 14 2013 Peter Jones <pjones@redhat.com> - 0.7-3
e22f8f
- Make lockdown include UEFI and other KEK/DB entries.
e22f8f
  Resolves: rhbz#1030492
e22f8f
e22f8f
* Fri Nov 08 2013 Peter Jones <pjones@redhat.com> - 0.7-2
e22f8f
- Update lockdown to reflect SetupMode better as well
e22f8f
  Related: rhbz#996863
e22f8f
e22f8f
* Wed Nov 06 2013 Peter Jones <pjones@redhat.com> - 0.7-1
e22f8f
- Fix logic to handle SetupMode efi variable.
e22f8f
  Related: rhbz#996863
e22f8f
e22f8f
* Thu Oct 31 2013 Peter Jones <pjones@redhat.com> - 0.6-1
e22f8f
- Fix a FreePool(NULL) call on machines too old for SB
e22f8f
e22f8f
* Fri Oct 04 2013 Peter Jones <pjones@redhat.com> - 0.5-1
e22f8f
- Update to 0.5
e22f8f
e22f8f
* Tue Aug 06 2013 Peter Jones <pjones@redhat.com> - 0.4-3
e22f8f
- Build with early RHEL test keys.
e22f8f
  Related: rhbz#989442
e22f8f
e22f8f
* Thu Jul 25 2013 Peter Jones <pjones@redhat.com> - 0.4-2
e22f8f
- Fix minor RHEL 7.0 build issues
e22f8f
  Resolves: rhbz#978766
e22f8f
- Be less verbose by default
e22f8f
e22f8f
* Tue Jun 11 2013 Peter Jones <pjones@redhat.com> - 0.4-1
e22f8f
- Update to 0.4
e22f8f
e22f8f
* Fri Jun 07 2013 Peter Jones <pjones@redhat.com> - 0.3-2
e22f8f
- Require gnu-efi-3.0q for now.
e22f8f
- Don't allow mmx or sse during compilation.
e22f8f
- Re-organize this so all real signing happens in shim-signed instead.
e22f8f
- Split out mokutil
e22f8f
e22f8f
* Wed Dec 12 2012 Peter Jones <pjones@redhat.com> - 0.2-3
e22f8f
- Fix mokutil's idea of signature sizes.
e22f8f
e22f8f
* Wed Nov 28 2012 Matthew Garrett <mjg59@srcf.ucam.org> - 0.2-2
e22f8f
- Fix secure_mode() always returning true
e22f8f
e22f8f
* Mon Nov 26 2012 Matthew Garrett <mjg59@srcf.ucam.org> - 0.2-1
e22f8f
- Update shim
e22f8f
- Include mokutil
e22f8f
- Add debuginfo package since mokutil is a userspace executable
e22f8f
e22f8f
* Mon Oct 22 2012 Peter Jones <pjones@redhat.com> - 0.1-4
e22f8f
- Produce an unsigned shim
e22f8f
e22f8f
* Tue Aug 14 2012 Peter Jones <pjones@redhat.com> - 0.1-3
e22f8f
- Update how embedded cert and signing work.
e22f8f
e22f8f
* Mon Aug 13 2012 Josh Boyer <jwboyer@redhat.com> - 0.1-2
e22f8f
- Add patch to fix image size calculation
e22f8f
e22f8f
* Mon Aug 13 2012 Matthew Garrett <mjg@redhat.com> - 0.1-1
e22f8f
- initial release