diff --git a/kdump-lib.sh b/kdump-lib.sh index b079f27dccc7d715433024184a840176b14b5b0c..04429ef30a1bcba05a35966512603c9981df28f3 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 00c0064d4cd6ae2274ea6c1ba1fbcf6a01690e4f..fc50b2a7412a65604aba396deb835f4ce59617d0 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 fed2e4a5419c3e244bbd31a63005fd1c1aa4e824..334ed962b033293aeace5d6510c7f7603788b882 100644 --- a/kexec-tools.spec +++ b/kexec-tools.spec @@ -4,7 +4,7 @@ Name: kexec-tools Version: 2.0.26 -Release: 5 +Release: 6 License: GPLv2 Summary: The kexec/kdump userspace component URL: https://www.kernel.org/ @@ -299,6 +299,9 @@ done %endif %changelog +* Fri May 17 2024 Wenhua Huang - 2.0.26-6 +- Fix "grep: warning: stray \ before -" + * Mon May 13 2024 Wenhua Huang - 2.0.26-5 - Add loongarch iomem.h