-
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
base: develop
Are you sure you want to change the base?
Changes from all commits
074c607
f78470a
3d20fd3
3fce109
7a7e783
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%{_cross_efi_arch}.efi | ||||||
| %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,32 @@ 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 | ||||||
|
Comment on lines
+33
to
+34
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.
Suggested change
Contributor
Author
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. I actually wrote this one comment. Usually, we do the strong |
||||||
| Requires: %{name} | ||||||
| Provides: %{name}(shim-efi) = 1: | ||||||
| Conflicts: %{_cross_os}image-feature(uki-image) | ||||||
|
|
||||||
| %description grub | ||||||
| %{summary}. | ||||||
|
|
||||||
| %package systemd-boot | ||||||
| Summary: Shim built to chain-load systemd-boot | ||||||
| Requires: %{name} | ||||||
| Requires: %{_cross_os}image-feature(uki-image) | ||||||
| Provides: %{name}(shim-efi) = 0: | ||||||
|
Comment on lines
+36
to
+46
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. [P1] Epoch-only Both subpackages declare a versioned virtual provide with only an Epoch and an empty version string:
The base package has an unversioned The normal RPM syntax is
Suggested fix: either drop the versioned Provides entirely and rely on the image-feature Conflicts/Requires (which are what really determine selection today), or make it well-formed and document the intent, e.g.: Provides: %{name}(shim-efi) = 1:%{version}-%{release}
...
Provides: %{name}(shim-efi) = 0:%{version}-%{release}with a comment explaining it is a tie-breaker for the shim-grub default. Confidence: ~70%. |
||||||
| Conflicts: %{_cross_os}image-feature(no-uki-image) | ||||||
|
|
||||||
| %description systemd-boot | ||||||
| %{summary}. | ||||||
|
Comment on lines
+31
to
+50
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] The two subpackages are designed to be mutually exclusive, but nothing in the spec directly prevents co-installation. Mutual exclusion is only enforced transitively through the
The two subpackages install into disjoint paths ( Scenario: a variant recipe that lists both If the intent really is "exactly one", encoding it in the spec is stronger than delegating it to image-feature discipline in downstream recipes. Suggested fix: add mutual Conflicts to make the invariant explicit: %package grub
...
Conflicts: %{name}-systemd-boot
Conflicts: %{_cross_os}image-feature(uki-image)
%package systemd-boot
...
Conflicts: %{name}-grub
Conflicts: %{_cross_os}image-feature(no-uki-image)Alternatively, document in a comment that mutual exclusion is intentionally delegated to image-feature declarations upstream of this spec. Confidence: ~55%. |
||||||
|
|
||||||
| %prep | ||||||
| %{gpgverify} --data=%{S:0} --signature=%{S:1} --keyring=%{S:2} | ||||||
| %autosetup -n shim-%{shimver} -p1 | ||||||
|
|
@@ -38,7 +64,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 +72,39 @@ 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}" \; | ||||||
|
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. any reason these all changed from
Contributor
Author
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.
|
||||||
|
|
||||||
| find %{_builddir}/build-systemd-boot -name '%{shim_efi_image}' -exec \ | ||||||
| cp {} "%{buildroot}%{efidir}/%{shim_systemd_boot_efi_image}" \; | ||||||
|
|
||||||
| find %{_builddir}/build-grub -name '%{mokm_efi_image}' -exec \ | ||||||
| cp {} "%{buildroot}%{efidir}/%{mokm_efi_image}" \; | ||||||
|
Comment on lines
+97
to
+98
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} | ||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks like you could interpolate these variables e.g.