From f01fef4016734096dc3df0f247cec5f9fe2cd8ed Mon Sep 17 00:00:00 2001 From: Philipp Rudo Date: Wed, 6 Sep 2023 10:49:38 +0200 Subject: [PATCH] kdump-lib: simplify _get_kdump_kernel_version Only check whether modules for a given kernel version are installed instead of searching for a kernel image. It's safer to assume that every kernel uses kernel modules compared to that it follows certain naming conventions. Furthermore it is much more lightweight and thus allows to determine the KDUMP_KERNELVER much earlier for every command in kdumpctl. Signed-off-by: Philipp Rudo Reviewed-by: Pingfan Liu --- kdump-lib.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kdump-lib.sh b/kdump-lib.sh index d314157..55c29bd 100755 --- a/kdump-lib.sh +++ b/kdump-lib.sh @@ -599,7 +599,7 @@ _get_kdump_kernel_version() _version_nondebug=${_version%+debug} _version_nondebug=${_version_nondebug%-debug} - if [[ -f "$(prepare_kdump_kernel "$_version_nondebug")" ]]; then + if _is_valid_kver "$_version_nondebug"; then dinfo "Use of debug kernel detected. Trying to use $_version_nondebug" echo "$_version_nondebug" else