On Thu, Nov 24, 2022 at 09:15:25AM +0800, Lichen Liu wrote:
Currently _find_kernel_path_by_release uses grubby and grep to
find the kernel path, if both the normal kernel and it's debug
varient exist, the grep will give more than one kernel strings.
```
kernel="/boot/vmlinuz-5.14.0-139.kpq0.el9.s390x+debug"
kernel="/boot/vmlinuz-5.14.0-139.kpq0.el9.s390x"
```
This will cause an error when installing debug kernel.
```
The param "/boot/vmlinuz-5.14.0-139.kpq0.el9.s390x+debug
/boot/vmlinuz-5.14.0-139.kpq0.el9.s390x" is incorrect
```
Fixes: 945cbbd ("add helper functions to get kernel path by kernel release and the
path of current running kernel")
Signed-off-by: Lichen Liu <lichliu(a)redhat.com>
Reviewed-by: Philipp Rudo <prudo(a)redhat.com>
Patch merged, thanks!
---
kdumpctl | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/kdumpctl b/kdumpctl
index 7caaae5..63c78b0 100755
--- a/kdumpctl
+++ b/kdumpctl
@@ -1353,7 +1353,7 @@ _filter_grubby_kernel_str()
_find_kernel_path_by_release()
{
local _release="$1" _grubby_kernel_str _kernel_path
- _grubby_kernel_str=$(grubby --info ALL | grep "^kernel=.*$_release")
+ _grubby_kernel_str=$(grubby --info ALL | grep "^kernel=.*$_release\"$")
_kernel_path=$(_filter_grubby_kernel_str "$_grubby_kernel_str")
if [[ -z $_kernel_path ]]; then
derror "kernel $_release doesn't exist"
--
2.37.3
--
Best regards,
Coiby