kdump-utils/0001-Return-the-correct-exit-code-of-rebuild-initrd.patch

45 lines
1.1 KiB
Diff
Raw Normal View History

From f6e00948aba7c31f722af79ed72c4020868dcad7 Mon Sep 17 00:00:00 2001
From: Tao Liu <ltao@redhat.com>
Date: Fri, 18 Oct 2024 21:45:03 +1300
Subject: [PATCH] Return the correct exit code of rebuild initrd
Resolves: https://issues.redhat.com/browse/RHEL-63047
The exit code of rebuild_initrd() should be either of
rebuild_kdump/fadump_initrd(), rather than set_vmcore_creation_status(),
otherwise it will cause a regression when rebuild initrd fails.
Fixes: 88525ebf ("Introduce vmcore creation notification to kdump")
Signed-off-by: Tao Liu <ltao@redhat.com>
---
kdumpctl | 3 +++
1 file changed, 3 insertions(+)
diff --git a/kdumpctl b/kdumpctl
index 82b7fb1..0140eeb 100755
--- a/kdumpctl
+++ b/kdumpctl
@@ -173,6 +173,7 @@ rebuild_kdump_initrd()
rebuild_initrd()
{
+ local _ret
dinfo "Rebuilding $TARGET_INITRD"
if [[ ! -w $(dirname "$TARGET_INITRD") ]]; then
@@ -185,8 +186,10 @@ rebuild_initrd()
else
rebuild_kdump_initrd
fi
+ _ret=$?
set_vmcore_creation_status 'clear' "$VMCORE_CREATION_STATUS"
+ return $_ret
}
#$1: the files to be checked with IFS=' '
--
2.40.1