After introducing 64k variant kernel on aarch64, an example kernel name looks like "vmlinuz-5.14.0-316.el9.aarch64+64k". To match the plus symbol, it demands an escape charater.
Signed-off-by: Pingfan Liu piliu@redhat.com --- kdumpctl | 2 ++ 1 file changed, 2 insertions(+)
diff --git a/kdumpctl b/kdumpctl index 20ed7bf..5c55a6a 100755 --- a/kdumpctl +++ b/kdumpctl @@ -1406,6 +1406,8 @@ _filter_grubby_kernel_str() _find_kernel_path_by_release() { local _release="$1" _grubby_kernel_str _kernel_path + + _release=$(echo "$_release" | sed 's/+/+/g') _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
Sorry for a mistake. Please see the comments inline below.
On Wed, May 24, 2023 at 9:21 PM Pingfan Liu piliu@redhat.com wrote:
After introducing 64k variant kernel on aarch64, an example kernel name looks like "vmlinuz-5.14.0-316.el9.aarch64+64k". To match the plus symbol, it demands an escape charater.
Signed-off-by: Pingfan Liu piliu@redhat.com
kdumpctl | 2 ++ 1 file changed, 2 insertions(+)
diff --git a/kdumpctl b/kdumpctl index 20ed7bf..5c55a6a 100755 --- a/kdumpctl +++ b/kdumpctl @@ -1406,6 +1406,8 @@ _filter_grubby_kernel_str() _find_kernel_path_by_release() { local _release="$1" _grubby_kernel_str _kernel_path
_release=$(echo "$_release" | sed 's/+/\+/g')
^^^should be 's/+/\+/g' Which can escape the backslash
Thanks,
Pingfan
_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
-- 2.31.1 _______________________________________________ kexec mailing list -- kexec@lists.fedoraproject.org To unsubscribe send an email to kexec-leave@lists.fedoraproject.org Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/ List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines List Archives: https://lists.fedoraproject.org/archives/list/kexec@lists.fedoraproject.org Do not reply to spam, report it: https://pagure.io/fedora-infrastructure/new_issue
Hi Pingfan,
This function _find_kernel_path_by_release is getting more complex. Could you add some unit tests cases for it?
On Wed, May 24, 2023 at 11:39:33PM +0800, Pingfan Liu wrote:
Sorry for a mistake. Please see the comments inline below.
On Wed, May 24, 2023 at 9:21 PM Pingfan Liu piliu@redhat.com wrote:
After introducing 64k variant kernel on aarch64, an example kernel name looks like "vmlinuz-5.14.0-316.el9.aarch64+64k". To match the plus symbol, it demands an escape charater.
Signed-off-by: Pingfan Liu piliu@redhat.com
kdumpctl | 2 ++ 1 file changed, 2 insertions(+)
diff --git a/kdumpctl b/kdumpctl index 20ed7bf..5c55a6a 100755 --- a/kdumpctl +++ b/kdumpctl @@ -1406,6 +1406,8 @@ _filter_grubby_kernel_str() _find_kernel_path_by_release() { local _release="$1" _grubby_kernel_str _kernel_path
_release=$(echo "$_release" | sed 's/+/\+/g')
^^^should be 's/+/\+/g' Which can escape the backslash
Thanks,
Pingfan
_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
-- 2.31.1 _______________________________________________ kexec mailing list -- kexec@lists.fedoraproject.org To unsubscribe send an email to kexec-leave@lists.fedoraproject.org Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/ List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines List Archives: https://lists.fedoraproject.org/archives/list/kexec@lists.fedoraproject.org Do not reply to spam, report it: https://pagure.io/fedora-infrastructure/new_issue
kexec mailing list -- kexec@lists.fedoraproject.org To unsubscribe send an email to kexec-leave@lists.fedoraproject.org Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/ List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines List Archives: https://lists.fedoraproject.org/archives/list/kexec@lists.fedoraproject.org Do not reply to spam, report it: https://pagure.io/fedora-infrastructure/new_issue
On Thu, Jun 1, 2023 at 10:20 AM Coiby Xu coxu@redhat.com wrote:
Hi Pingfan,
This function _find_kernel_path_by_release is getting more complex. Could you add some unit tests cases for it?
Sure, I will add it along with V2.
Thanks,
Pingfan