From cdc0253a3cc1ea4522fa5ac89eb109bd96095548 Mon Sep 17 00:00:00 2001 From: Coiby Xu Date: Fri, 21 Apr 2023 19:09:51 +0800 Subject: [PATCH] Let _update_kernel_cmdline return the correct return code Currently, for non-s390x systems, the return code is 1 even when _update_kernel_cmdline is correctly executed. This makes callers like reset_crashkernel_after_update fail to print a message if a kernel has its crashkernel updated. Fix it by put the code inside if block for s390x. Signed-off-by: Coiby Xu Reviewed-by: Philipp Rudo --- kdumpctl | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/kdumpctl b/kdumpctl index 844fdad..9c109da 100755 --- a/kdumpctl +++ b/kdumpctl @@ -1445,7 +1445,11 @@ _update_kernel_cmdline() grubby --args="fadump=$_fadump_val" --update-kernel "$_kernel_path" fi fi - [[ -f /etc/zipl.conf ]] && zipl > /dev/null + + # Don't use "[[ CONDITION ]] && COMMAND" which returns 1 under false CONDITION + if [[ -f /etc/zipl.conf ]]; then + zipl > /dev/null + fi } _valid_grubby_kernel_path()