Hi Coiby,
On Wed, 24 May 2023 18:18:14 +0800
Coiby Xu <coxu(a)redhat.com> wrote:
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 <coxu(a)redhat.com>
Looks good to me.
Thanks!
Reviewed-by: Philipp Rudo <prudo(a)redhat.com>
---
- add comment for this nasty case [Philipp]
---
kdumpctl | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/kdumpctl b/kdumpctl
index 844fdad8..9c109daa 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()