Hi,
On Mon, 8 May 2023 19:46:38 -0500
Jeremy Linton <jeremy.linton(a)arm.com> wrote:
The default systemd-boot installed kernels on fedora end up in the
form:
/boot/efi/36b54597c46383/6.4.0-0.rc0.20230427git6e98b09da931.5.fc39.aarch64/linux
Where the kernel version is a directory containing the kernel (linux)
and the initrd. Thus _find_kernel_path_by release needs to be a bit less
strict and allow some futher characters on the grubby (really bootctl)
output.
Signed-off-by: Jeremy Linton <jeremy.linton(a)arm.com>
Personally I would prefer to get rid of grubby altogether. But for the
time being I think this is a valid workaround.
Reviewed-by: Philipp Rudo <prudo(a)redhat.com>
---
v1-v2: Change to extended grep regex and add a one or more pattern
to match a single "\filename" following the kernel revision
kdumpctl | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/kdumpctl b/kdumpctl
index 2c647d6..18a7d62 100755
--- a/kdumpctl
+++ b/kdumpctl
@@ -1318,7 +1318,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 -E
"^kernel=.*$_release(\/\w+)?\"$")
_kernel_path=$(_filter_grubby_kernel_str "$_grubby_kernel_str")
if [[ -z $_kernel_path ]]; then
ddebug "kernel $_release doesn't exist"