forked from bottlerocket-os/bottlerocket-kernel-kit
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathshim.spec
More file actions
66 lines (56 loc) · 1.91 KB
/
Copy pathshim.spec
File metadata and controls
66 lines (56 loc) · 1.91 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
%global debug_package %{nil}
%global __strip %{_bindir}/true
%global efidir /boot/efi/EFI/BOOT
%global boot_efi_image boot%{_cross_efi_arch}.efi
%global grub_efi_image grub%{_cross_efi_arch}.efi
%global shim_efi_image shim%{_cross_efi_arch}.efi
%global mokm_efi_image mm%{_cross_efi_arch}.efi
%global shimver 16.0
%global commit 5914984a1ffeab841f482c791426d7ca9935a5e6
Name: %{_cross_os}shim
Version: %{shimver}
Release: 1%{?dist}
Summary: UEFI shim loader
License: BSD-3-Clause
URL: https://github.com/rhboot/shim/
Source0: https://github.com/rhboot/shim/releases/download/%{shimver}/shim-%{shimver}.tar.bz2
Source1: https://github.com/rhboot/shim/releases/download/%{shimver}/shim-%{shimver}.tar.bz2.asc
Source2: gpgkey-8107B101A432AAC9FE8E547CA348D61BC2713E9F.asc
%description
%{summary}.
%prep
%{gpgverify} --data=%{S:0} --signature=%{S:1} --keyring=%{S:2}
%autosetup -n shim-%{shimver} -p1
# Make sure the `.vendor_cert` section is large enough to cover a replacement
# certificate, or `objcopy` may silently retain the existing section.
# 4096 - 16 (for cert_table structure) = 4080 bytes.
truncate -s 4080 empty.cer
%global shim_make \
make\\\
ARCH="%{_cross_arch}"\\\
CROSS_COMPILE="%{_cross_target}-"\\\
COMMIT_ID="%{commit}"\\\
RELEASE="%{release}"\\\
DEFAULT_LOADER="%{grub_efi_image}"\\\
DISABLE_REMOVABLE_LOAD_OPTIONS=y\\\
DESTDIR="%{buildroot}"\\\
EFIDIR="BOOT"\\\
VENDOR_CERT_FILE="empty.cer"\\\
POST_PROCESS_PE_FLAGS="-N"\\\
%{nil}
%build
%shim_make
%install
%shim_make install-as-data
install -d %{buildroot}%{efidir}
find %{buildroot}%{_datadir} -name '%{shim_efi_image}' -exec \
mv {} "%{buildroot}%{efidir}/%{boot_efi_image}" \;
find %{buildroot}%{_datadir} -name '%{mokm_efi_image}' -exec \
mv {} "%{buildroot}%{efidir}/%{mokm_efi_image}" \;
rm -rf %{buildroot}%{_datadir}
%files
%license COPYRIGHT
%{_cross_attribution_file}
%dir %{efidir}
%{efidir}/%{boot_efi_image}
%{efidir}/%{mokm_efi_image}