Matthew Garrett 59b1f51
Name:           shim
28fad42
Version:        0.8
b20ba9c
Release:        1
Matthew Garrett 59b1f51
Summary:        First-stage UEFI bootloader
Matthew Garrett 59b1f51
Matthew Garrett 59b1f51
License:        BSD
Matthew Garrett 59b1f51
URL:            http://www.codon.org.uk/~mjg59/shim/
28fad42
Source0:        https://github.com/mjg59/%{name}/releases/download/%{version}/%{name}-%{version}.tar.bz2
75567da
Source1:	fedora-ca.cer
Matthew Garrett 59b1f51
48a92b9
# currently here's what's in our dbx:
48a92b9
# grub2-efi-2.00-11.fc18.x86_64:
48a92b9
# grubx64.efi 6ac839881e73504047c06a1aac0c4763408ecb3642783c8acf77a2d393ea5cd7
48a92b9
# gcdx64.efi 065cd63bab696ad2f4732af9634d66f2c0d48f8a3134b8808750d378550be151
48a92b9
# grub2-efi-2.00-11.fc19.x86_64:
48a92b9
# grubx64.efi 49ece9a10a9403b32c8e0c892fd9afe24a974323c96f2cc3dd63608754bf9b45
48a92b9
# gcdx64.efi 99fcaa957786c155a92b40be9c981c4e4685b8c62b408cb0f6cb2df9c30b9978
48a92b9
# woops.
28fad42
Source2:	dbx.esl
3f38048
28fad42
BuildRequires: git openssl-devel openssl
6e8ffa5
BuildRequires: pesign >= 0.106-1
28fad42
BuildRequires: gnu-efi = 3.0w
28fad42
BuildRequires: gnu-efi-devel = 3.0w
Matthew Garrett 59b1f51
Matthew Garrett 59b1f51
# Shim uses OpenSSL, but cannot use the system copy as the UEFI ABI is not
Matthew Garrett 59b1f51
# compatible with SysV (there's no red zone under UEFI) and there isn't a
Matthew Garrett 59b1f51
# POSIX-style C library.
Matthew Garrett 59b1f51
# BuildRequires: OpenSSL
28fad42
Provides: bundled(openssl) = 0.9.8zb
Matthew Garrett 59b1f51
Matthew Garrett 59b1f51
# Shim is only required on platforms implementing the UEFI secure boot
Matthew Garrett 59b1f51
# protocol. The only one of those we currently wish to support is 64-bit x86.
Matthew Garrett 59b1f51
# Adding further platforms will require adding appropriate relocation code.
28fad42
ExclusiveArch: x86_64 aarch64
Matthew Garrett 59b1f51
bc4b8b9
# Figure out the right file path to use
bc4b8b9
%if 0%{?rhel}
bc4b8b9
%global efidir redhat
bc4b8b9
%endif
bc4b8b9
%if 0%{?fedora}
bc4b8b9
%global efidir fedora
bc4b8b9
%endif
bc4b8b9
Matthew Garrett 59b1f51
%description
Matthew Garrett 59b1f51
Initial UEFI bootloader that handles chaining to a trusted full bootloader
Matthew Garrett 59b1f51
under secure boot environments.
Matthew Garrett 59b1f51
c476086
%package -n shim-unsigned
c476086
Summary: First-stage UEFI bootloader (unsigned data)
c476086
c476086
%description -n shim-unsigned
c476086
Initial UEFI bootloader that handles chaining to a trusted full bootloader
c476086
under secure boot environments.
c476086
Matthew Garrett 59b1f51
%prep
ba65b55
%setup -q
83155d7
git init
28fad42
git config user.email "%{name}-owner@fedoraproject.org"
83155d7
git config user.name "Fedora Ninjas"
83155d7
git add .
83155d7
git commit -a -q -m "%{version} baseline."
83155d7
git am %{patches} 
b20ba9c
git config --unset user.email
b20ba9c
git config --unset user.name
28fad42
Matthew Garrett 59b1f51
%build
83155d7
MAKEFLAGS=""
75567da
if [ -f "%{SOURCE1}" ]; then
28fad42
	MAKEFLAGS="VENDOR_CERT_FILE=%{SOURCE1} VENDOR_DBX_FILE=%{SOURCE2}"
83155d7
fi
ba65b55
make 'DEFAULT_LOADER=\\\\grubx64.efi' ${MAKEFLAGS} shim.efi MokManager.efi fallback.efi
Matthew Garrett 59b1f51
Matthew Garrett 59b1f51
%install
Matthew Garrett 59b1f51
rm -rf $RPM_BUILD_ROOT
b038901
pesign -h -P -i shim.efi -h > shim.hash
c476086
install -D -d -m 0755 $RPM_BUILD_ROOT%{_datadir}/shim/
c476086
install -m 0644 shim.efi $RPM_BUILD_ROOT%{_datadir}/shim/shim.efi
6e8ffa5
install -m 0644 shim.hash $RPM_BUILD_ROOT%{_datadir}/shim/shim.hash
6e8ffa5
install -m 0644 fallback.efi $RPM_BUILD_ROOT%{_datadir}/shim/fallback.efi
6e8ffa5
install -m 0644 MokManager.efi $RPM_BUILD_ROOT%{_datadir}/shim/MokManager.efi
b4e78d5
# now install our .debug files...
b4e78d5
install -D -d -m 0755 $RPM_BUILD_ROOT/usr/lib/debug/%{_datadir}/shim/
b4e78d5
install -m 0644 shim.efi.debug $RPM_BUILD_ROOT/usr/lib/debug/%{_datadir}/shim/shim.efi.debug
b4e78d5
install -m 0644 fallback.efi.debug $RPM_BUILD_ROOT/usr/lib/debug/%{_datadir}/shim/fallback.efi.debug
6e8ffa5
install -m 0644 MokManager.efi.debug $RPM_BUILD_ROOT/usr/lib/debug/%{_datadir}/shim/MokManager.efi.debug
Matthew Garrett 59b1f51
c476086
%files -n shim-unsigned
Matthew Garrett 59b1f51
%doc
c476086
%dir %{_datadir}/shim
c476086
%{_datadir}/shim/*
6e8ffa5
Matthew Garrett 59b1f51
%changelog
28fad42
* Tue Oct 14 2014 Peter Jones <pjones@redhat.com> - 0.8-1
28fad42
- Update to 0.8
28fad42
  Related: rhbz#1148230
28fad42
  Related: rhbz#1148231
28fad42
  Related: rhbz#1148232
28fad42
70e23be
* Wed Nov 06 2013 Peter Jones <pjones@redhat.com> - 0.7-1
70e23be
- Fix logic to handle SetupMode efi variable.
70e23be
7148df3
* Thu Oct 31 2013 Peter Jones <pjones@redhat.com> - 0.6-1
fecdfb1
- Fix a FreePool(NULL) call on machines too old for SB
fecdfb1
ba65b55
* Fri Oct 04 2013 Peter Jones <pjones@redhat.com> - 0.5-1
ba65b55
- Update to 0.5
ba65b55
57f3546
* Tue Jun 11 2013 Peter Jones <pjones@redhat.com> - 0.4-1
00ae245
- Update to 0.4
00ae245
345b99e
* Fri Jun 07 2013 Peter Jones <pjones@redhat.com> - 0.3-2
6e8ffa5
- Require gnu-efi-3.0q for now.
345b99e
- Don't allow mmx or sse during compilation.
6e8ffa5
- Re-organize this so all real signing happens in shim-signed instead.
6e8ffa5
- Split out mokutil
345b99e
0371db8
* Wed Dec 12 2012 Peter Jones <pjones@redhat.com> - 0.2-3
0371db8
- Fix mokutil's idea of signature sizes.
0371db8
fceb7ac
* Wed Nov 28 2012 Matthew Garrett <mjg59@srcf.ucam.org> - 0.2-2
fceb7ac
- Fix secure_mode() always returning true
fceb7ac
3f38048
* Mon Nov 26 2012 Matthew Garrett <mjg59@srcf.ucam.org> - 0.2-1
3f38048
- Update shim
3f38048
- Include mokutil
3f38048
- Add debuginfo package since mokutil is a userspace executable
3f38048
dbb3eca
* Mon Oct 22 2012 Peter Jones <pjones@redhat.com> - 0.1-4
c476086
- Produce an unsigned shim
c476086
efdbd82
* Tue Aug 14 2012 Peter Jones <pjones@redhat.com> - 0.1-3
efdbd82
- Update how embedded cert and signing work.
efdbd82
d9982da
* Mon Aug 13 2012 Josh Boyer <jwboyer@redhat.com> - 0.1-2
d9982da
- Add patch to fix image size calculation
d9982da
Matthew Garrett 59b1f51
* Mon Aug 13 2012 Matthew Garrett <mjg@redhat.com> - 0.1-1
Matthew Garrett 59b1f51
- initial release