kdumpctl: Use only first match in _find_kernel_path_by_release()#153
Open
ddstreet wants to merge 1 commit into
Open
kdumpctl: Use only first match in _find_kernel_path_by_release()#153ddstreet wants to merge 1 commit into
ddstreet wants to merge 1 commit into
Conversation
Running 'grubby --info ALL' (or even for a specific kernel version)
can return multiple entries for the same kernel version/release
(usually with different append parameters, initrds, etc), so when
grepping for a specific kernel version/release, we need to use only
the first match.
This results in kdumpctl failing with the error message (from grubby):
"The param $KERNELPATH\n$KERNELPATH is incorrect"
replacing $KERNELPATH with the actual vmlinuz path.
This bug is hidden when /boot is a separate partition, because the
grubby script has regex ("/${param##*/}" = "${bls_linux[$i]}") which
strips all duplicate lines and base path, and successfully matches
"/vmlinuz-*".
This is reproducable by simply moving the /boot contents into a normal
dir in the rootfs (instead of separate fs).
Contributor
There was a problem hiding this comment.
Code Review
This pull request modifies the kdumpctl script to optimize the kernel path lookup within the _find_kernel_path_by_release function. Specifically, it adds the -m 1 flag to the grep command to ensure that only the first matching kernel entry is returned from the grubby output. I have no feedback to provide as there were no review comments to evaluate.
ddstreet
added a commit
to ddstreet/azurelinux
that referenced
this pull request
Apr 22, 2026
When /boot is not a separate partition, kdumpctl will fail to operate on any specific kernel version if it is listed multiple times in the BLS loader entries (for example, with different append parameters). This fixes it to use only the first matching entry to determine the kernel image path. Taken from (not yet merged) upstream PR: rhkdump/kdump-utils#153
christopherco
pushed a commit
to microsoft/azurelinux
that referenced
this pull request
Apr 25, 2026
When /boot is not a separate partition, kdumpctl will fail to operate on any specific kernel version if it is listed multiple times in the BLS loader entries (for example, with different append parameters). This fixes it to use only the first matching entry to determine the kernel image path. Taken from (not yet merged) upstream PR: rhkdump/kdump-utils#153
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Running 'grubby --info ALL' (or even for a specific kernel version) can return multiple entries for the same kernel version/release (usually with different append parameters, initrds, etc), so when grepping for a specific kernel version/release, we need to use only the first match.
This results in kdumpctl failing with the error message (from grubby):
"The param $KERNELPATH\n$KERNELPATH is incorrect"
replacing $KERNELPATH with the actual vmlinuz path.
This bug is hidden when /boot is a separate partition, because the grubby script has regex (
"/${param##*/}" = "${bls_linux[$i]}") which strips all duplicate lines and base path, and successfully matches "/vmlinuz-*".This is reproducable by simply moving the /boot contents into a normal dir in the rootfs (instead of separate fs).