2012-08-13 15:39:34 +00:00
|
|
|
Name: shim
|
|
|
|
Version: 0.1
|
2012-10-22 15:14:19 +00:00
|
|
|
Release: 4%{?dist}
|
2012-08-13 15:39:34 +00:00
|
|
|
Summary: First-stage UEFI bootloader
|
|
|
|
|
|
|
|
License: BSD
|
|
|
|
URL: http://www.codon.org.uk/~mjg59/shim/
|
|
|
|
Source0: http://www.codon.org.uk/~mjg59/shim/shim-%{version}.tar.bz2
|
2012-10-18 22:32:33 +00:00
|
|
|
Source1: fedora-ca.cer
|
2012-08-13 15:39:34 +00:00
|
|
|
|
2012-08-14 15:54:28 +00:00
|
|
|
BuildRequires: gnu-efi git
|
2012-10-22 15:08:19 +00:00
|
|
|
BuildRequires: pesign >= 0.99-8
|
2012-08-13 15:39:34 +00:00
|
|
|
|
|
|
|
# Shim uses OpenSSL, but cannot use the system copy as the UEFI ABI is not
|
|
|
|
# compatible with SysV (there's no red zone under UEFI) and there isn't a
|
|
|
|
# POSIX-style C library.
|
|
|
|
# BuildRequires: OpenSSL
|
|
|
|
|
|
|
|
# Shim is only required on platforms implementing the UEFI secure boot
|
|
|
|
# protocol. The only one of those we currently wish to support is 64-bit x86.
|
|
|
|
# Adding further platforms will require adding appropriate relocation code.
|
|
|
|
ExclusiveArch: x86_64
|
|
|
|
|
|
|
|
# Shim generates no binaries that run under the installed OS, so debuginfo
|
|
|
|
# is useless
|
|
|
|
%global debug_package %{nil}
|
|
|
|
|
2012-08-13 15:45:54 +00:00
|
|
|
# Figure out the right file path to use
|
|
|
|
%if 0%{?rhel}
|
|
|
|
%global efidir redhat
|
|
|
|
%endif
|
|
|
|
%if 0%{?fedora}
|
|
|
|
%global efidir fedora
|
|
|
|
%endif
|
|
|
|
|
2012-08-13 15:39:34 +00:00
|
|
|
%description
|
|
|
|
Initial UEFI bootloader that handles chaining to a trusted full bootloader
|
|
|
|
under secure boot environments.
|
|
|
|
|
2012-10-18 19:27:54 +00:00
|
|
|
%package -n shim-unsigned
|
|
|
|
Summary: First-stage UEFI bootloader (unsigned data)
|
|
|
|
|
|
|
|
%description -n shim-unsigned
|
|
|
|
Initial UEFI bootloader that handles chaining to a trusted full bootloader
|
|
|
|
under secure boot environments.
|
|
|
|
|
2012-08-13 15:39:34 +00:00
|
|
|
%prep
|
2012-10-18 19:27:54 +00:00
|
|
|
%setup -q -n shim-%{version}
|
2012-08-14 15:54:28 +00:00
|
|
|
git init
|
|
|
|
git config user.email "shim-owner@fedoraproject.org"
|
|
|
|
git config user.name "Fedora Ninjas"
|
|
|
|
git add .
|
|
|
|
git commit -a -q -m "%{version} baseline."
|
|
|
|
git am %{patches} </dev/null
|
2012-08-13 15:39:34 +00:00
|
|
|
|
|
|
|
%build
|
2012-08-14 15:54:28 +00:00
|
|
|
%define vendor_token_str %{expand:%%{nil}%%{?vendor_token_name:-t "%{vendor_token_name}"}}
|
|
|
|
%define vendor_cert_str %{expand:%%{!?vendor_cert_nickname:-c "Red Hat Test Certificate"}%%{?vendor_cert_nickname:-c "%%{vendor_cert_nickname}"}}
|
2012-10-22 15:08:19 +00:00
|
|
|
#pesign %{vendor_token_str} %{vendor_cert_str} -C vendor.cer
|
2012-08-14 15:54:28 +00:00
|
|
|
|
|
|
|
MAKEFLAGS=""
|
2012-10-18 22:32:33 +00:00
|
|
|
if [ -f "%{SOURCE1}" ]; then
|
|
|
|
MAKEFLAGS="VENDOR_CERT_FILE=%{SOURCE1}"
|
2012-08-14 15:54:28 +00:00
|
|
|
fi
|
|
|
|
make %{?_smp_mflags} ${MAKEFLAGS}
|
2012-08-13 15:39:34 +00:00
|
|
|
|
|
|
|
|
|
|
|
%install
|
|
|
|
rm -rf $RPM_BUILD_ROOT
|
2012-10-18 19:27:54 +00:00
|
|
|
%pesign -s -i shim.efi -e shim.sig
|
|
|
|
install -D -d -m 0755 $RPM_BUILD_ROOT%{_datadir}/shim/
|
|
|
|
install -m 0644 shim.efi $RPM_BUILD_ROOT%{_datadir}/shim/shim.efi
|
|
|
|
install -m 0644 shim.sig $RPM_BUILD_ROOT%{_datadir}/shim/shim.sig
|
2012-10-22 15:13:00 +00:00
|
|
|
install -D -d -m 0755 $RPM_BUILD_ROOT/boot/efi/EFI/%{efidir}/
|
|
|
|
%pesign -s -i shim.efi -o $RPM_BUILD_ROOT/boot/efi/EFI/%{efidir}/shim.efi
|
2012-08-13 15:39:34 +00:00
|
|
|
|
2012-10-18 19:27:54 +00:00
|
|
|
%files -n shim-unsigned
|
2012-08-13 15:39:34 +00:00
|
|
|
%doc
|
2012-10-18 19:27:54 +00:00
|
|
|
%dir %{_datadir}/shim
|
|
|
|
%{_datadir}/shim/*
|
2012-10-22 15:13:00 +00:00
|
|
|
|
|
|
|
%files
|
2012-10-22 15:08:19 +00:00
|
|
|
/boot/efi/EFI/%{efidir}/shim.efi
|
2012-08-13 15:39:34 +00:00
|
|
|
|
|
|
|
%changelog
|
2012-10-22 15:14:19 +00:00
|
|
|
* Mon Oct 22 2012 Peter Jones <pjones@redhat.com> - 0.1-4
|
2012-10-18 19:27:54 +00:00
|
|
|
- Produce an unsigned shim
|
|
|
|
|
2012-08-14 18:40:17 +00:00
|
|
|
* Tue Aug 14 2012 Peter Jones <pjones@redhat.com> - 0.1-3
|
|
|
|
- Update how embedded cert and signing work.
|
|
|
|
|
2012-08-13 16:48:29 +00:00
|
|
|
* Mon Aug 13 2012 Josh Boyer <jwboyer@redhat.com> - 0.1-2
|
|
|
|
- Add patch to fix image size calculation
|
|
|
|
|
2012-08-13 15:39:34 +00:00
|
|
|
* Mon Aug 13 2012 Matthew Garrett <mjg@redhat.com> - 0.1-1
|
|
|
|
- initial release
|