From 9ec61f6c9bb15d7c987f57091f48df19dd920882 Mon Sep 17 00:00:00 2001 From: Tao Liu Date: Oct 20 2024 21:39:40 +0000 Subject: Return the correct exit code of rebuild initrd Resolves: RHEL-63047 Upstream: fedora Conflict: Yes, due to upstream commit d4e87721 ("kdumpctl: make do_estimate more robust") is not backported. commit f6e00948aba7c31f722af79ed72c4020868dcad7 Author: Tao Liu Date: Fri Oct 18 21:45:03 2024 +1300 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 Signed-off-by: Tao Liu --- diff --git a/kdumpctl b/kdumpctl index 40dcb1e..edf9d1b 100755 --- a/kdumpctl +++ b/kdumpctl @@ -142,6 +142,7 @@ rebuild_kdump_initrd() rebuild_initrd() { + local _ret if [[ ! -w $(dirname "$TARGET_INITRD") ]]; then derror "$(dirname "$TARGET_INITRD") does not have write permission. Cannot rebuild $TARGET_INITRD" return 1 @@ -152,8 +153,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=' '