From 3b7ff08c71d06bf586c4428be9def1684973dd49 Mon Sep 17 00:00:00 2001 From: Philipp Rudo Date: Thu, 30 Mar 2023 11:44:38 +0200 Subject: [PATCH] kernel.spec: Fix UKI naming to comply with BLS Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2187671 Upstream Status: RHEL-only ARK: 4359f657a649 ("kernel.spec: Fix UKI naming to comply with BLS") The Boot Loader Specification (BLS) [1] suggests that type #2 entries (UKIs) shall have the same names like type #1 entries with the exception of the suffix being .efi instead of .conf. In particular this means that the name for installed UKIs should be -.efi. The same naming convention is used by kernel-installs 90-uki-copy.install [2] in systemd v253. Adjust the workaround to install UKIs in the kernel.spec to follow the same naming convention in order to prevent breaking user space tools that rely on it. [1] https://uapi-group.org/specifications/specs/boot_loader_specification/ [2] https://github.com/systemd/systemd/blob/v253/src/kernel-install/90-uki-copy.install Signed-off-by: Philipp Rudo --- redhat/kernel.spec.template | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/redhat/kernel.spec.template b/redhat/kernel.spec.template index e73a14f02865..c65493dd4b1f 100755 --- a/redhat/kernel.spec.template +++ b/redhat/kernel.spec.template @@ -3237,10 +3237,12 @@ touch %{_localstatedir}/lib/rpm-state/%{name}/installing_core_%{KVERREL}%{?-v:+% %define kernel_uki_virt_scripts() \ %{expand:%%posttrans %{?1:%{1}-}uki-virt}\ mkdir -p /boot/efi/EFI/Linux\ -cp /lib/modules/%{KVERREL}%{?1:+%{1}}/vmlinuz-virt.efi /boot/efi/EFI/Linux/vmlinuz-%{KVERREL}%{?1:+%{1}}-virt.efi\ +entry_token=$(kernel-install inspect | grep KERNEL_INSTALL_ENTRY_TOKEN: | cut -d ' ' -f2)\ +cp /lib/modules/%{KVERREL}%{?1:+%{1}}/vmlinuz-virt.efi /boot/efi/EFI/Linux/${entry_token}-%{KVERREL}%{?1:+%{1}}.efi\ %{nil}\ %{expand:%%postun %{?1:%{1}-}uki-virt}\ -rm -f /boot/efi/EFI/Linux/vmlinuz-%{KVERREL}%{?1:+%{1}}-virt.efi\ +entry_token=$(kernel-install inspect | grep KERNEL_INSTALL_ENTRY_TOKEN: | cut -d ' ' -f2)\ +rm -f /boot/efi/EFI/Linux/${entry_token}-%{KVERREL}%{?1:+%{1}}.efi\ %{nil} # @@ -3539,7 +3541,7 @@ fi %if "%{3}" != "rt" && "%{3}" != "rt-debug"\ %{expand:%%files %{?3:%{3}-}uki-virt}\ /lib/modules/%{KVERREL}%{?3:+%{3}}/%{?-k:%{-k*}}%{!?-k:vmlinuz}-virt.efi\ -%ghost /%{image_install_path}/efi/EFI/Linux/%{?-k:%{-k*}}%{!?-k:vmlinuz}-%{KVERREL}%{?3:+%{3}}-virt.efi\ +%ghost /%{image_install_path}/efi/EFI/Linux/%{?-k:%{-k*}}%{!?-k:*}-%{KVERREL}%{?3:+%{3}}.efi\ %endif\ %endif\ %if %{?3:1} %{!?3:0}\