diff --git a/dracut-kdump.sh b/dracut-kdump.sh index 8d169c4..df27227 100755 --- a/dracut-kdump.sh +++ b/dracut-kdump.sh @@ -93,7 +93,6 @@ dump_raw() monitor_dd_progress $_src_size_mb & - CORE_COLLECTOR=`echo $CORE_COLLECTOR | sed -e's/\(^makedumpfile\)\(.*$\)/\1 -F \2/'` $CORE_COLLECTOR /proc/vmcore | dd of=$1 bs=$DD_BLKSIZE >> /tmp/dd_progress_file 2>&1 || return 1 return 0 } @@ -138,6 +137,11 @@ is_ssh_dump_target() grep -q "^net.*@" $conf_file } +is_raw_dump_target() +{ + grep -q "^raw" $conf_file +} + read_kdump_conf() { if [ ! -f "$conf_file" ]; then @@ -205,7 +209,9 @@ read_kdump_conf if [ -z "$CORE_COLLECTOR" ];then CORE_COLLECTOR=$DEFAULT_CORE_COLLECTOR - is_ssh_dump_target && CORE_COLLECTOR="$CORE_COLLECTOR -F" + if is_ssh_dump_target || is_raw_dump_target; then + CORE_COLLECTOR="$CORE_COLLECTOR -F" + fi fi if [ -z "$DUMP_INSTRUCTION" ]; then diff --git a/mkdumprd b/mkdumprd index f6ba6e1..accae0e 100644 --- a/mkdumprd +++ b/mkdumprd @@ -96,16 +96,23 @@ is_ssh_dump_target() grep -q "^net.*@" $conf_file } +is_raw_dump_target() +{ + grep -q "^raw" $conf_file +} + # $1: core_collector config value verify_core_collector() { if grep -q "^raw" $conf_file && [ "${1%% *}" != "makedumpfile" ]; then echo "Warning: specifying a non-makedumpfile core collector, you will have to recover the vmcore manually." fi - if is_ssh_dump_target && [ "${1%% *}" = "makedumpfile" ]; then - ! strstr "$1" "-F" && { - echo "The specified dump target needs makedumpfile \"-F\" option." - exit 1 - } + if is_ssh_dump_target || is_raw_dump_target; then + if [ "${1%% *}" = "makedumpfile" ]; then + ! strstr "$1" "-F" && { + echo "The specified dump target needs makedumpfile \"-F\" option." + exit 1 + } + fi fi }