-
Notifications
You must be signed in to change notification settings - Fork 38
Prepare to support UKIs #523
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
074c607
88a0581
9098e59
dca8028
860c8d6
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
This file was deleted.
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,11 +2,14 @@ | |
| %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 systemd_boot_efi_image systemd-boot%{_cross_efi_arch}.efi | ||
| %global shim_systemd_boot_efi_image shim-%{systemd_boot_efi_image} | ||
| %global shim_efi_image shim%{_cross_efi_arch}.efi | ||
| %global mokm_efi_image mm%{_cross_efi_arch}.efi | ||
|
|
||
| %global boot_efi_image boot%{_cross_efi_arch}.efi | ||
|
|
||
| %global shimver 16.0 | ||
| %global commit 18d98bfb34be583a5fe2987542e4b15e0db9cb61 | ||
|
|
||
|
|
@@ -20,9 +23,41 @@ Source0: https://github.com/rhboot/shim/releases/download/%{shimver}/shim-%{shim | |
| Source1: https://github.com/rhboot/shim/releases/download/%{shimver}/shim-%{shimver}.tar.bz2.asc | ||
| Source2: gpgkey-8107B101A432AAC9FE8E547CA348D61BC2713E9F.asc | ||
|
|
||
| Requires: %{name}(shim-efi) | ||
|
|
||
| %description | ||
| %{summary}. | ||
|
|
||
| %package grub | ||
| Summary: Shim built to chain-load GRUB | ||
| # Avoid explicit image-feature(no-uki-image) requires for backwards compatibility | ||
| # The conflict is enough for now to prevent installing GRUB when UKIs are used | ||
| Requires: %{name} | ||
| # The epoch here is a tie-breaker signaling this subpackage is the default | ||
| # shim-efi provider; selection is actually enforced by the Conflicts below. | ||
| Provides: %{name}(shim-efi) = 1: | ||
| Conflicts: %{_cross_os}image-feature(uki-image) | ||
| # Mutually exclusive with other shim providers | ||
| Conflicts: %{name}(shim-efi) | ||
|
|
||
| %description grub | ||
| %{summary}. | ||
|
|
||
| %package systemd-boot | ||
| Summary: Shim built to chain-load systemd-boot | ||
| Requires: %{name} | ||
| Requires: %{_cross_os}image-feature(uki-image) | ||
| # The epoch here is a tie-breaker signaling this subpackage is not the | ||
| # default shim-efi provider; selection is actually enforced by the | ||
| # Requires/Conflicts below. | ||
| Provides: %{name}(shim-efi) = 0: | ||
|
jmt-lab marked this conversation as resolved.
|
||
| Conflicts: %{_cross_os}image-feature(no-uki-image) | ||
| # Mutually exclusive with other shim providers | ||
| Conflicts: %{name}(shim-efi) | ||
|
|
||
| %description systemd-boot | ||
| %{summary}. | ||
|
jmt-lab marked this conversation as resolved.
|
||
|
|
||
| %prep | ||
| %{gpgverify} --data=%{S:0} --signature=%{S:1} --keyring=%{S:2} | ||
| %autosetup -n shim-%{shimver} -p1 | ||
|
|
@@ -38,7 +73,6 @@ make\\\ | |
| CROSS_COMPILE="%{_cross_target}-"\\\ | ||
| COMMIT_ID="%{commit}"\\\ | ||
| RELEASE="%{release}"\\\ | ||
| DEFAULT_LOADER="%{grub_efi_image}"\\\ | ||
| DISABLE_REMOVABLE_LOAD_OPTIONS=y\\\ | ||
| DESTDIR="%{buildroot}"\\\ | ||
| EFIDIR="BOOT"\\\ | ||
|
|
@@ -47,20 +81,40 @@ make\\\ | |
| %{nil} | ||
|
|
||
| %build | ||
| %shim_make | ||
| # Build shim twice using separate source-tree copies. Building in-tree ensures | ||
| # DEFAULT_LOADER propagates correctly to the preprocessor defines. | ||
| cp -a %{_builddir}/shim-%{shimver} %{_builddir}/build-grub | ||
| cp -a %{_builddir}/shim-%{shimver} %{_builddir}/build-systemd-boot | ||
|
|
||
| cd %{_builddir}/build-grub | ||
| %shim_make DEFAULT_LOADER="%{grub_efi_image}" | ||
|
|
||
| cd %{_builddir}/build-systemd-boot | ||
| %shim_make DEFAULT_LOADER="%{systemd_boot_efi_image}" | ||
|
|
||
| %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} | ||
|
|
||
| # Install grub-chaining shim at the default boot path, for backwards | ||
| # compatibility with image builds that expect to find it there. | ||
| find %{_builddir}/build-grub -name '%{shim_efi_image}' -exec \ | ||
| cp {} "%{buildroot}%{efidir}/%{boot_efi_image}" \; | ||
|
ginglis13 marked this conversation as resolved.
|
||
|
|
||
| find %{_builddir}/build-systemd-boot -name '%{shim_efi_image}' -exec \ | ||
| cp {} "%{buildroot}%{efidir}/%{shim_systemd_boot_efi_image}" \; | ||
|
|
||
| # MokManager is not affected by DEFAULT_LOADER; either build tree is fine. | ||
| find %{_builddir}/build-grub -name '%{mokm_efi_image}' -exec \ | ||
| cp {} "%{buildroot}%{efidir}/%{mokm_efi_image}" \; | ||
|
Comment on lines
+107
to
+108
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [P2] MokManager is copied only from
Concerns:
Suggested fix: either copy # MokManager is not affected by DEFAULT_LOADER; either build tree is fine.
find %{_builddir}/build-grub -name '%{mokm_efi_image}' -exec \
cp {} "%{buildroot}%{efidir}/%{mokm_efi_image}" \;Confidence: ~60%. |
||
|
|
||
| %files | ||
| %license COPYRIGHT | ||
| %{_cross_attribution_file} | ||
| %dir %{efidir} | ||
| %{efidir}/%{boot_efi_image} | ||
| %{efidir}/%{mokm_efi_image} | ||
|
|
||
| %files grub | ||
| %{efidir}/%{boot_efi_image} | ||
|
|
||
| %files systemd-boot | ||
| %{efidir}/%{shim_systemd_boot_efi_image} | ||
Uh oh!
There was an error while loading. Please reload this page.