diff --git a/0021-kdump-lib-use-EFI-var-to-find-UKI.patch b/0021-kdump-lib-use-EFI-var-to-find-UKI.patch new file mode 100644 index 0000000..f206b35 --- /dev/null +++ b/0021-kdump-lib-use-EFI-var-to-find-UKI.patch @@ -0,0 +1,46 @@ +From edb8363d7efedfdc964576e4e30bc67c8fbeb941 Mon Sep 17 00:00:00 2001 +From: Li Tian +Date: Wed, 24 Sep 2025 17:29:56 +0800 +Subject: [PATCH] kdump-lib: use EFI var to find UKI + +The UKI in ESP is not guaranteed to be named after machine ID. +Machine ID is unknown at the time image is built. Thus +builders like Image Builder names UKI 'fff...f-$(uname -r).efi'. +The StubImageIdentifier points the true loaded UKI. + +Signed-off-by: Li Tian +--- + kdump-lib.sh | 12 ++++++++++-- + 1 file changed, 10 insertions(+), 2 deletions(-) + +diff --git a/kdump-lib.sh b/kdump-lib.sh +index 639256c..232d065 100755 +--- a/kdump-lib.sh ++++ b/kdump-lib.sh +@@ -502,13 +502,21 @@ prepare_kexec_args() + prepare_kdump_kernel() + { + local kdump_kernelver=$1 +- local dir img boot_dirlist boot_imglist kdump_kernel machine_id ++ local dir img boot_dirlist boot_imglist kdump_kernel machine_id uki_img ++ local img_identifier_path="/sys/firmware/efi/efivars/StubImageIdentifier-4a67b082-0a4c-41cf-b6c7-440b29bb8c4f" + read -r machine_id < /etc/machine-id + ++ # UKI is not guaranteed named after machine ID. Use EFI var as reference. ++ if [[ -f $img_identifier_path ]]; then ++ uki_img=$(tr -cd '[:print:]/' < "$img_identifier_path" | sed 's/\\/\//g') ++ else ++ uki_img="EFI/Linux/$machine_id-$kdump_kernelver.efi" ++ fi ++ + boot_dirlist=${KDUMP_BOOTDIR:-"/boot /boot/efi /efi /"} + boot_imglist="$KDUMP_IMG-$kdump_kernelver$KDUMP_IMG_EXT \ + $machine_id/$kdump_kernelver/$KDUMP_IMG \ +- EFI/Linux/$machine_id-$kdump_kernelver.efi" ++ $uki_img" + + # The kernel of OSTree based systems is not in the standard locations. + if is_ostree; then +-- +2.52.0 + diff --git a/kdump-utils.spec b/kdump-utils.spec index dc1001e..6c824e3 100644 --- a/kdump-utils.spec +++ b/kdump-utils.spec @@ -28,6 +28,7 @@ Patch17: 0017-kdumpctl-clean-up-backup-restore-_default_initrd.patch Patch18: 0018-kdumpctl-add-comments-to-different-initrd-variables.patch Patch19: 0019-spec-drop-dependency-for-binutils.patch Patch20: 0020-kdump-lib-always-disable-systemd-gpt-auto-generator.patch +Patch21: 0021-kdump-lib-use-EFI-var-to-find-UKI.patch %ifarch ppc64 ppc64le