From 63fd0078dd0fd56bab5a430be29613b557e26db1 Mon Sep 17 00:00:00 2001 From: zhangzikang1992 Date: Thu, 5 Dec 2024 15:11:05 +0800 Subject: [PATCH] Fix "grep: warning: stray \ before -" --- kdump-lib.sh | 10 +++++----- kdumpctl | 4 ++-- kexec-tools.spec | 7 +++++-- 3 files changed, 12 insertions(+), 9 deletions(-) diff --git a/kdump-lib.sh b/kdump-lib.sh index efc1a37..9d0779d 100755 --- a/kdump-lib.sh +++ b/kdump-lib.sh @@ -44,7 +44,7 @@ is_nfs_dump_target() return 0; fi - if is_fs_type_nfs $(get_dracut_args_fstype "$(grep "^dracut_args .*\-\-mount" /etc/kdump.conf)"); then + if is_fs_type_nfs $(get_dracut_args_fstype "$(grep "^dracut_args .*--mount" /etc/kdump.conf)"); then return 0 fi @@ -127,7 +127,7 @@ get_user_configured_dump_disk() _target=$(egrep "^ext[234]|^xfs|^btrfs|^minix|^raw" /etc/kdump.conf 2>/dev/null |awk '{print $2}') [ -n "$_target" ] && echo $_target && return - _target=$(get_dracut_args_target "$(grep "^dracut_args .*\-\-mount" /etc/kdump.conf)") + _target=$(get_dracut_args_target "$(grep "^dracut_args .*--mount" /etc/kdump.conf)") [ -b "$_target" ] && echo $_target } @@ -448,19 +448,19 @@ is_wdt_mod_omitted() { # its correctness). is_mount_in_dracut_args() { - grep -q "^dracut_args .*\-\-mount" /etc/kdump.conf + grep -q "^dracut_args .*--mount" /etc/kdump.conf } # If $1 contains dracut_args "--mount", return get_dracut_args_fstype() { - echo $1 | grep "\-\-mount" | sed "s/.*--mount .\(.*\)/\1/" | cut -d' ' -f3 + echo $1 | grep "\--mount" | sed "s/.*--mount .\(.*\)/\1/" | cut -d' ' -f3 } # If $1 contains dracut_args "--mount", return get_dracut_args_target() { - echo $1 | grep "\-\-mount" | sed "s/.*--mount .\(.*\)/\1/" | cut -d' ' -f1 + echo $1 | grep "\--mount" | sed "s/.*--mount .\(.*\)/\1/" | cut -d' ' -f1 } check_crash_mem_reserved() diff --git a/kdumpctl b/kdumpctl index 00c0064..fc50b2a 100755 --- a/kdumpctl +++ b/kdumpctl @@ -227,7 +227,7 @@ check_config() return 1 } - nr=$(grep "^dracut_args .*\-\-mount" $KDUMP_CONFIG_FILE | grep -o "\-\-mount" | wc -l) + nr=$(grep "^dracut_args .*--mount" $KDUMP_CONFIG_FILE | grep -o "\--mount" | wc -l) [ $nr -gt 1 ] && { echo "Multiple mount targets specified in one \"dracut_args\"." return 1 @@ -492,7 +492,7 @@ check_dump_fs_modified() # if --mount argument present then match old and new target, mount # point and file system. If any of them mismatches then rebuild - echo $_dracut_args | grep "\-\-mount" &> /dev/null + echo $_dracut_args | grep "\--mount" &> /dev/null if [[ $? -eq 0 ]];then set -- $(echo $_dracut_args | awk -F "--mount '" '{print $2}' | cut -d' ' -f1,2,3) _old_dev=$1 diff --git a/kexec-tools.spec b/kexec-tools.spec index aed1acc..b7dd693 100644 --- a/kexec-tools.spec +++ b/kexec-tools.spec @@ -4,7 +4,7 @@ Name: kexec-tools Version: 2.0.26 -Release: 8 +Release: 9 License: GPLv2 Summary: The kexec/kdump userspace component URL: https://www.kernel.org/ @@ -295,9 +295,12 @@ done %endif %changelog -* Fri Sep 20 2024 chenguokai - 2.0.26-8 +* Fri Sep 20 2024 chenguokai - 2.0.26-9 - Fix multiple issues of riscv image format & initrd support +* Wed Aug 14 2024 zhangzikang - 2.0.26-8 +- Fix "grep: warning: stray \ before -" + * Tue Jul 30 2024 chenhaixiang - 2.0.26-7 - update makedumpfile to makedumpfile-1.7.4 -- Gitee