python-virt-firmware/0001-systemd-skip-boot-efi-in-case-BOOT_ROOT-looks-like-t.patch
Gerd Hoffmann e96defc415 backport bootctl fix for 99-uki-uefi-setup.install
Resolves: RHEL-84984

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2025-03-26 14:59:04 +01:00

33 lines
1.0 KiB
Diff

From ca385db4f74a4d542455b9d40c91c8448c7be90c Mon Sep 17 00:00:00 2001
From: Gerd Hoffmann <kraxel@redhat.com>
Date: Thu, 20 Mar 2025 09:04:32 +0100
Subject: [PATCH] systemd: skip /boot/efi in case $BOOT_ROOT looks like the ESP
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
systemd/99-uki-uefi-setup.install | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/systemd/99-uki-uefi-setup.install b/systemd/99-uki-uefi-setup.install
index 26c8c018683b..773491198433 100755
--- a/systemd/99-uki-uefi-setup.install
+++ b/systemd/99-uki-uefi-setup.install
@@ -16,7 +16,13 @@ ENTRY_TOKEN="$KERNEL_INSTALL_ENTRY_TOKEN"
BOOT_ROOT="$KERNEL_INSTALL_BOOT_ROOT"
UKI_DIR_BOOT="$BOOT_ROOT/EFI/Linux"
-UKI_DIR_ESP="`bootctl -p`/EFI/Linux"
+if test -d "$BOOT_ROOT/EFI/BOOT"; then
+ # looks like $BOOT_ROOT points to the ESP
+ UKI_DIR_ESP="$UKI_DIR_BOOT"
+else
+ # must find ESP mount point
+ UKI_DIR_ESP="`bootctl -p`/EFI/Linux"
+fi
LOADER_INFO="$(kernel-bootcfg --print-loader)"
case "$LOADER_INFO" in
--
2.49.0