db7d74
#!/bin/sh
4a6108
#
4a6108
# The main kdump routine in capture kernel, bash may not be the
4a6108
# default shell. Any code added must be POSIX compliant.
db7d74
db7d74
. /lib/dracut-lib.sh
4a6108
. /lib/kdump-logger.sh
db7d74
. /lib/kdump-lib-initramfs.sh
db7d74
4a6108
#initiate the kdump logger
4a6108
if ! dlog_init; then
4a6108
	echo "failed to initiate the kdump logger."
4a6108
	exit 1
4a6108
fi
4a6108
4a6108
KDUMP_PATH="/var/crash"
4a6108
KDUMP_LOG_FILE="/run/initramfs/kexec-dmesg.log"
4a6108
CORE_COLLECTOR=""
4a6108
DEFAULT_CORE_COLLECTOR="makedumpfile -l --message-level 7 -d 31"
4a6108
DMESG_COLLECTOR="/sbin/vmcore-dmesg"
4a6108
FAILURE_ACTION="systemctl reboot -f"
4a6108
DATEDIR=$(date +%Y-%m-%d-%T)
4a6108
HOST_IP='127.0.0.1'
4a6108
DUMP_INSTRUCTION=""
4a6108
SSH_KEY_LOCATION="/root/.ssh/kdump_id_rsa"
4a6108
DD_BLKSIZE=512
4a6108
FINAL_ACTION="systemctl reboot -f"
4a6108
KDUMP_PRE=""
4a6108
KDUMP_POST=""
4a6108
NEWROOT="/sysroot"
4a6108
OPALCORE="/sys/firmware/opal/mpipl/core"
4a6108
KDUMP_CONF_PARSED="/tmp/kdump.conf.$$"
4a6108
4a6108
# POSIX doesn't have pipefail, only apply when using bash
4a6108
# shellcheck disable=SC3040
4a6108
[ -n "$BASH" ] && set -o pipefail
4a6108
db7d74
DUMP_RETVAL=0
db7d74
4a6108
kdump_read_conf > $KDUMP_CONF_PARSED
db7d74
4a6108
get_kdump_confs()
4a6108
{
4a6108
	while read -r config_opt config_val; do
4a6108
		# remove inline comments after the end of a directive.
4a6108
		case "$config_opt" in
4a6108
		path)
4a6108
			KDUMP_PATH="$config_val"
4a6108
			;;
4a6108
		core_collector)
4a6108
			[ -n "$config_val" ] && CORE_COLLECTOR="$config_val"
4a6108
			;;
4a6108
		sshkey)
4a6108
			if [ -f "$config_val" ]; then
4a6108
				SSH_KEY_LOCATION=$config_val
4a6108
			fi
4a6108
			;;
4a6108
		kdump_pre)
4a6108
			KDUMP_PRE="$config_val"
4a6108
			;;
4a6108
		kdump_post)
4a6108
			KDUMP_POST="$config_val"
4a6108
			;;
4a6108
		fence_kdump_args)
4a6108
			FENCE_KDUMP_ARGS="$config_val"
4a6108
			;;
4a6108
		fence_kdump_nodes)
4a6108
			FENCE_KDUMP_NODES="$config_val"
4a6108
			;;
4a6108
		failure_action | default)
4a6108
			case $config_val in
4a6108
			shell)
4a6108
				FAILURE_ACTION="kdump_emergency_shell"
4a6108
				;;
4a6108
			reboot)
4a6108
				FAILURE_ACTION="systemctl reboot -f && exit"
4a6108
				;;
4a6108
			halt)
4a6108
				FAILURE_ACTION="halt && exit"
4a6108
				;;
4a6108
			poweroff)
4a6108
				FAILURE_ACTION="systemctl poweroff -f && exit"
4a6108
				;;
4a6108
			dump_to_rootfs)
4a6108
				FAILURE_ACTION="dump_to_rootfs"
4a6108
				;;
4a6108
			esac
4a6108
			;;
4a6108
		final_action)
4a6108
			case $config_val in
4a6108
			reboot)
4a6108
				FINAL_ACTION="systemctl reboot -f"
4a6108
				;;
4a6108
			halt)
4a6108
				FINAL_ACTION="halt"
4a6108
				;;
4a6108
			poweroff)
4a6108
				FINAL_ACTION="systemctl poweroff -f"
4a6108
				;;
4a6108
			esac
4a6108
			;;
4a6108
		esac
4a6108
	done < "$KDUMP_CONF_PARSED"
4a6108
4a6108
	if [ -z "$CORE_COLLECTOR" ]; then
4a6108
		CORE_COLLECTOR="$DEFAULT_CORE_COLLECTOR"
4a6108
		if is_ssh_dump_target || is_raw_dump_target; then
4a6108
			CORE_COLLECTOR="$CORE_COLLECTOR -F"
4a6108
		fi
4a6108
	fi
4a6108
}
4a6108
4a6108
# store the kexec kernel log to a file.
4a6108
save_log()
db7d74
{
4a6108
	dmesg -T > $KDUMP_LOG_FILE
4a6108
4a6108
	if command -v journalctl > /dev/null; then
4a6108
		journalctl -ab >> $KDUMP_LOG_FILE
4a6108
	fi
4a6108
	chmod 600 $KDUMP_LOG_FILE
4a6108
}
db7d74
4a6108
# $1: dump path, must be a mount point
4a6108
dump_fs()
4a6108
{
4a6108
	ddebug "dump_fs _mp=$1"
4a6108
4a6108
	if ! is_mounted "$1"; then
4a6108
		dinfo "dump path '$1' is not mounted, trying to mount..."
4a6108
		if ! mount --target "$1"; then
4a6108
			derror "failed to dump to '$1', it's not a mount point!"
4a6108
			return 1
4a6108
		fi
4a6108
	fi
4a6108
4a6108
	# Remove -F in makedumpfile case. We don't want a flat format dump here.
4a6108
	case $CORE_COLLECTOR in
4a6108
	*makedumpfile*)
4a6108
		CORE_COLLECTOR=$(echo "$CORE_COLLECTOR" | sed -e "s/-F//g")
4a6108
		;;
4a6108
	esac
4a6108
4a6108
	_dump_fs_path=$(echo "$1/$KDUMP_PATH/$HOST_IP-$DATEDIR/" | tr -s /)
4a6108
	dinfo "saving to $_dump_fs_path"
4a6108
4a6108
	# Only remount to read-write mode if the dump target is mounted read-only.
4a6108
	_dump_mnt_op=$(get_mount_info OPTIONS target "$1" -f)
4a6108
	case $_dump_mnt_op in
4a6108
	ro*)
4a6108
		dinfo "Remounting the dump target in rw mode."
4a6108
		mount -o remount,rw "$1" || return 1
4a6108
		;;
4a6108
	esac
4a6108
4a6108
	mkdir -p "$_dump_fs_path" || return 1
4a6108
4a6108
	save_vmcore_dmesg_fs ${DMESG_COLLECTOR} "$_dump_fs_path"
4a6108
	save_opalcore_fs "$_dump_fs_path"
4a6108
4a6108
	dinfo "saving vmcore"
4a6108
	$CORE_COLLECTOR /proc/vmcore "$_dump_fs_path/vmcore-incomplete"
4a6108
	_dump_exitcode=$?
4a6108
	if [ $_dump_exitcode -eq 0 ]; then
4a6108
		mv "$_dump_fs_path/vmcore-incomplete" "$_dump_fs_path/vmcore"
4a6108
		sync
4a6108
		dinfo "saving vmcore complete"
4a6108
	else
4a6108
		derror "saving vmcore failed, exitcode:$_dump_exitcode"
4a6108
	fi
4a6108
4a6108
	dinfo "saving the $KDUMP_LOG_FILE to $_dump_fs_path/"
4a6108
	save_log
4a6108
	mv "$KDUMP_LOG_FILE" "$_dump_fs_path/"
4a6108
	if [ $_dump_exitcode -ne 0 ]; then
4a6108
		return 1
4a6108
	fi
4a6108
4a6108
	# improper kernel cmdline can cause the failure of echo, we can ignore this kind of failure
4a6108
	return 0
4a6108
}
db7d74
4a6108
# $1: dmesg collector
4a6108
# $2: dump path
4a6108
save_vmcore_dmesg_fs()
4a6108
{
4a6108
	dinfo "saving vmcore-dmesg.txt to $2"
4a6108
	if $1 /proc/vmcore > "$2/vmcore-dmesg-incomplete.txt"; then
4a6108
		mv "$2/vmcore-dmesg-incomplete.txt" "$2/vmcore-dmesg.txt"
4a6108
		chmod 600 "$2/vmcore-dmesg.txt"
4a6108
4a6108
		# Make sure file is on disk. There have been instances where later
4a6108
		# saving vmcore failed and system rebooted without sync and there
4a6108
		# was no vmcore-dmesg.txt available.
4a6108
		sync
4a6108
		dinfo "saving vmcore-dmesg.txt complete"
4a6108
	else
4a6108
		if [ -f "$2/vmcore-dmesg-incomplete.txt" ]; then
4a6108
			chmod 600 "$2/vmcore-dmesg-incomplete.txt"
4a6108
		fi
4a6108
		derror "saving vmcore-dmesg.txt failed"
4a6108
	fi
4a6108
}
db7d74
4a6108
# $1: dump path
4a6108
save_opalcore_fs()
4a6108
{
4a6108
	if [ ! -f $OPALCORE ]; then
4a6108
		# Check if we are on an old kernel that uses a different path
4a6108
		if [ -f /sys/firmware/opal/core ]; then
4a6108
			OPALCORE="/sys/firmware/opal/core"
4a6108
		else
4a6108
			return 0
4a6108
		fi
4a6108
	fi
4a6108
4a6108
	dinfo "saving opalcore:$OPALCORE to $1/opalcore"
4a6108
	if ! cp $OPALCORE "$1/opalcore"; then
4a6108
		derror "saving opalcore failed"
4a6108
		return 1
4a6108
	fi
4a6108
4a6108
	sync
4a6108
	dinfo "saving opalcore complete"
4a6108
	return 0
db7d74
}
db7d74
4a6108
dump_to_rootfs()
db7d74
{
4a6108
4a6108
	if [ "$(systemctl status dracut-initqueue | sed -n "s/^\s*Active: \(\S*\)\s.*$/\1/p")" = "inactive" ]; then
4a6108
		dinfo "Trying to bring up initqueue for rootfs mount"
4a6108
		systemctl start dracut-initqueue
4a6108
	fi
4a6108
4a6108
	dinfo "Clean up dead systemd services"
4a6108
	systemctl cancel
4a6108
	dinfo "Waiting for rootfs mount, will timeout after 90 seconds"
4a6108
	systemctl start --no-block sysroot.mount
4a6108
4a6108
	_loop=0
4a6108
	while [ $_loop -lt 90 ] && ! is_mounted /sysroot; do
4a6108
		sleep 1
4a6108
		_loop=$((_loop + 1))
4a6108
	done
4a6108
4a6108
	if ! is_mounted /sysroot; then
4a6108
		derror "Failed to mount rootfs"
4a6108
		return
4a6108
	fi
4a6108
4a6108
	ddebug "NEWROOT=$NEWROOT"
4a6108
	dump_fs $NEWROOT
db7d74
}
db7d74
4a6108
kdump_emergency_shell()
db7d74
{
4a6108
	ddebug "Switching to kdump emergency shell..."
4a6108
4a6108
	[ -f /etc/profile ] && . /etc/profile
4a6108
	export PS1='kdump:${PWD}# '
4a6108
4a6108
	. /lib/dracut-lib.sh
4a6108
	if [ -f /dracut-state.sh ]; then
4a6108
		. /dracut-state.sh 2> /dev/null
4a6108
	fi
4a6108
4a6108
	source_conf /etc/conf.d
4a6108
4a6108
	type plymouth > /dev/null 2>&1 && plymouth quit
4a6108
4a6108
	source_hook "emergency"
4a6108
	while read -r _tty rest; do
4a6108
		(
4a6108
			echo
4a6108
			echo
4a6108
			echo 'Entering kdump emergency mode.'
4a6108
			echo 'Type "journalctl" to view system logs.'
4a6108
			echo 'Type "rdsosreport" to generate a sosreport, you can then'
4a6108
			echo 'save it elsewhere and attach it to a bug report.'
4a6108
			echo
4a6108
			echo
4a6108
		) > "/dev/$_tty"
4a6108
	done < /proc/consoles
4a6108
	sh -i -l
4a6108
	/bin/rm -f -- /.console_lock
db7d74
}
db7d74
4a6108
do_failure_action()
db7d74
{
4a6108
	dinfo "Executing failure action $FAILURE_ACTION"
4a6108
	eval $FAILURE_ACTION
db7d74
}
db7d74
4a6108
do_final_action()
4a6108
{
4a6108
	dinfo "Executing final action $FINAL_ACTION"
4a6108
	eval $FINAL_ACTION
4a6108
}
4a6108
4a6108
do_dump()
4a6108
{
4a6108
	eval $DUMP_INSTRUCTION
4a6108
	_ret=$?
4a6108
4a6108
	if [ $_ret -ne 0 ]; then
4a6108
		derror "saving vmcore failed"
4a6108
	fi
4a6108
4a6108
	return $_ret
4a6108
}
4a6108
4a6108
do_kdump_pre()
4a6108
{
4a6108
	if [ -n "$KDUMP_PRE" ]; then
4a6108
		"$KDUMP_PRE"
4a6108
		_ret=$?
4a6108
		if [ $_ret -ne 0 ]; then
4a6108
			derror "$KDUMP_PRE exited with $_ret status"
4a6108
			return $_ret
4a6108
		fi
4a6108
	fi
4a6108
4a6108
	# if any script fails, it just raises warning and continues
4a6108
	if [ -d /etc/kdump/pre.d ]; then
4a6108
		for file in /etc/kdump/pre.d/*; do
4a6108
			"$file"
4a6108
			_ret=$?
4a6108
			if [ $_ret -ne 0 ]; then
4a6108
				derror "$file exited with $_ret status"
4a6108
			fi
4a6108
		done
4a6108
	fi
4a6108
	return 0
4a6108
}
4a6108
4a6108
do_kdump_post()
db7d74
{
4a6108
	if [ -d /etc/kdump/post.d ]; then
4a6108
		for file in /etc/kdump/post.d/*; do
4a6108
			"$file" "$1"
4a6108
			_ret=$?
4a6108
			if [ $_ret -ne 0 ]; then
4a6108
				derror "$file exited with $_ret status"
4a6108
			fi
4a6108
		done
4a6108
	fi
4a6108
4a6108
	if [ -n "$KDUMP_POST" ]; then
4a6108
		"$KDUMP_POST" "$1"
4a6108
		_ret=$?
4a6108
		if [ $_ret -ne 0 ]; then
4a6108
			derror "$KDUMP_POST exited with $_ret status"
4a6108
		fi
4a6108
	fi
4a6108
}
db7d74
4a6108
# $1: block target, eg. /dev/sda
4a6108
dump_raw()
4a6108
{
4a6108
	[ -b "$1" ] || return 1
db7d74
4a6108
	dinfo "saving to raw disk $1"
db7d74
4a6108
	if ! echo "$CORE_COLLECTOR" | grep -q makedumpfile; then
4a6108
		_src_size=$(stat --format %s /proc/vmcore)
4a6108
		_src_size_mb=$((_src_size / 1048576))
4a6108
		/kdumpscripts/monitor_dd_progress $_src_size_mb &
4a6108
	fi
db7d74
4a6108
	dinfo "saving vmcore"
4a6108
	$CORE_COLLECTOR /proc/vmcore | dd of="$1" bs=$DD_BLKSIZE >> /tmp/dd_progress_file 2>&1 || return 1
4a6108
	sync
db7d74
4a6108
	dinfo "saving vmcore complete"
4a6108
	return 0
db7d74
}
db7d74
4a6108
# $1: ssh key file
4a6108
# $2: ssh address in <user>@<host> format
db7d74
dump_ssh()
db7d74
{
4a6108
	_ret=0
4a6108
	_ssh_opt="-i $1 -o BatchMode=yes -o StrictHostKeyChecking=yes"
4a6108
	_ssh_dir="$KDUMP_PATH/$HOST_IP-$DATEDIR"
4a6108
	if is_ipv6_address "$2"; then
4a6108
		_scp_address=${2%@*}@"[${2#*@}]"
4a6108
	else
4a6108
		_scp_address=$2
4a6108
	fi
4a6108
4a6108
	dinfo "saving to $2:$_ssh_dir"
4a6108
4a6108
	cat /var/lib/random-seed > /dev/urandom
4a6108
	ssh -q $_ssh_opt "$2" mkdir -p "$_ssh_dir" || return 1
4a6108
4a6108
	save_vmcore_dmesg_ssh "$DMESG_COLLECTOR" "$_ssh_dir" "$_ssh_opt" "$2"
4a6108
	dinfo "saving vmcore"
4a6108
4a6108
	save_opalcore_ssh "$_ssh_dir" "$_ssh_opt" "$2" "$_scp_address"
4a6108
4a6108
	if [ "${CORE_COLLECTOR%%[[:blank:]]*}" = "scp" ]; then
4a6108
		scp -q $_ssh_opt /proc/vmcore "$_scp_address:$_ssh_dir/vmcore-incomplete"
4a6108
		_ret=$?
4a6108
		_vmcore="vmcore"
4a6108
	else
4a6108
		$CORE_COLLECTOR /proc/vmcore | ssh $_ssh_opt "$2" "umask 0077 && dd bs=512 of='$_ssh_dir/vmcore-incomplete'"
4a6108
		_ret=$?
4a6108
		_vmcore="vmcore.flat"
4a6108
	fi
4a6108
4a6108
	if [ $_ret -eq 0 ]; then
4a6108
		ssh $_ssh_opt "$2" "mv '$_ssh_dir/vmcore-incomplete' '$_ssh_dir/$_vmcore'"
4a6108
		_ret=$?
4a6108
		if [ $_ret -ne 0 ]; then
4a6108
			derror "moving vmcore failed, exitcode:$_ret"
4a6108
		else
4a6108
			dinfo "saving vmcore complete"
4a6108
		fi
4a6108
	else
4a6108
		derror "saving vmcore failed, exitcode:$_ret"
4a6108
	fi
4a6108
4a6108
	dinfo "saving the $KDUMP_LOG_FILE to $2:$_ssh_dir/"
4a6108
	save_log
4a6108
	if ! scp -q $_ssh_opt $KDUMP_LOG_FILE "$_scp_address:$_ssh_dir/"; then
4a6108
		derror "saving log file failed, _exitcode:$_ret"
4a6108
	fi
4a6108
4a6108
	return $_ret
db7d74
}
db7d74
4a6108
# $1: dump path
4a6108
# $2: ssh opts
4a6108
# $3: ssh address in <user>@<host> format
4a6108
# $4: scp address, similar with ssh address but IPv6 addresses are quoted
4a6108
save_opalcore_ssh()
4a6108
{
4a6108
	if [ ! -f $OPALCORE ]; then
4a6108
		# Check if we are on an old kernel that uses a different path
4a6108
		if [ -f /sys/firmware/opal/core ]; then
4a6108
			OPALCORE="/sys/firmware/opal/core"
4a6108
		else
4a6108
			return 0
4a6108
		fi
4a6108
	fi
4a6108
4a6108
	dinfo "saving opalcore:$OPALCORE to $3:$1"
4a6108
4a6108
	if ! scp $2 $OPALCORE "$4:$1/opalcore-incomplete"; then
4a6108
		derror "saving opalcore failed"
4a6108
		return 1
4a6108
	fi
4a6108
4a6108
	ssh $2 "$3" mv "$1/opalcore-incomplete" "$1/opalcore"
4a6108
	dinfo "saving opalcore complete"
4a6108
	return 0
db7d74
}
db7d74
4a6108
# $1: dmesg collector
4a6108
# $2: dump path
4a6108
# $3: ssh opts
4a6108
# $4: ssh address in <user>@<host> format
4a6108
save_vmcore_dmesg_ssh()
4a6108
{
4a6108
	dinfo "saving vmcore-dmesg.txt to $4:$2"
4a6108
	if $1 /proc/vmcore | ssh $3 "$4" "umask 0077 && dd of='$2/vmcore-dmesg-incomplete.txt'"; then
4a6108
		ssh -q $3 "$4" mv "$2/vmcore-dmesg-incomplete.txt" "$2/vmcore-dmesg.txt"
4a6108
		dinfo "saving vmcore-dmesg.txt complete"
4a6108
	else
4a6108
		derror "saving vmcore-dmesg.txt failed"
4a6108
	fi
db7d74
}
db7d74
db7d74
get_host_ip()
db7d74
{
4a6108
	if is_nfs_dump_target || is_ssh_dump_target; then
4a6108
		kdumpnic=$(getarg kdumpnic=)
4a6108
		if [ -z "$kdumpnic" ]; then
4a6108
			derror "failed to get kdumpnic!"
4a6108
			return 1
4a6108
		fi
4a6108
		if ! kdumphost=$(ip addr show dev "$kdumpnic" | grep '[ ]*inet'); then
4a6108
			derror "wrong kdumpnic: $kdumpnic"
4a6108
			return 1
4a6108
		fi
4a6108
		kdumphost=$(echo "$kdumphost" | head -n 1 | awk '{print $2}')
4a6108
		kdumphost="${kdumphost%%/*}"
4a6108
		if [ -z "$kdumphost" ]; then
4a6108
			derror "wrong kdumpnic: $kdumpnic"
4a6108
			return 1
4a6108
		fi
4a6108
		HOST_IP=$kdumphost
4a6108
	fi
4a6108
	return 0
db7d74
}
db7d74
4a6108
read_kdump_confs()
db7d74
{
4a6108
	if [ ! -f "$KDUMP_CONFIG_FILE" ]; then
4a6108
		derror "$KDUMP_CONFIG_FILE not found"
4a6108
		return
4a6108
	fi
4a6108
4a6108
	get_kdump_confs
4a6108
4a6108
	# rescan for add code for dump target
4a6108
	while read -r config_opt config_val; do
4a6108
		# remove inline comments after the end of a directive.
4a6108
		case "$config_opt" in
4a6108
		dracut_args)
4a6108
			config_val=$(get_dracut_args_target "$config_val")
4a6108
			if [ -n "$config_val" ]; then
4a6108
				config_val=$(get_mntpoint_from_target "$config_val")
4a6108
				DUMP_INSTRUCTION="dump_fs $config_val"
4a6108
			fi
4a6108
			;;
4a6108
		ext[234] | xfs | btrfs | minix | nfs)
4a6108
			config_val=$(get_mntpoint_from_target "$config_val")
4a6108
			DUMP_INSTRUCTION="dump_fs $config_val"
4a6108
			;;
4a6108
		raw)
4a6108
			DUMP_INSTRUCTION="dump_raw $config_val"
4a6108
			;;
4a6108
		ssh)
4a6108
			DUMP_INSTRUCTION="dump_ssh $SSH_KEY_LOCATION $config_val"
4a6108
			;;
4a6108
		esac
4a6108
	done < "$KDUMP_CONF_PARSED"
db7d74
}
db7d74
db7d74
fence_kdump_notify()
db7d74
{
4a6108
	if [ -n "$FENCE_KDUMP_NODES" ]; then
4a6108
		# shellcheck disable=SC2086
4a6108
		$FENCE_KDUMP_SEND $FENCE_KDUMP_ARGS $FENCE_KDUMP_NODES &
4a6108
	fi
db7d74
}
db7d74
4a6108
if [ "$1" = "--error-handler" ]; then
4a6108
	get_kdump_confs
4a6108
	do_failure_action
4a6108
	do_final_action
4a6108
4a6108
	exit $?
4a6108
fi
4a6108
4a6108
# continue here only if we have to save dump.
4a6108
if [ -f /etc/fadump.initramfs ] && [ ! -f /proc/device-tree/rtas/ibm,kernel-dump ] && [ ! -f /proc/device-tree/ibm,opal/dump/mpipl-boot ]; then
4a6108
	exit 0
4a6108
fi
4a6108
4a6108
read_kdump_confs
db7d74
fence_kdump_notify
db7d74
4a6108
if ! get_host_ip; then
4a6108
	derror "get_host_ip exited with non-zero status!"
4a6108
	exit 1
db7d74
fi
db7d74
db7d74
if [ -z "$DUMP_INSTRUCTION" ]; then
4a6108
	DUMP_INSTRUCTION="dump_fs $NEWROOT"
db7d74
fi
db7d74
4a6108
if ! do_kdump_pre; then
4a6108
	derror "kdump_pre script exited with non-zero status!"
4a6108
	do_final_action
4a6108
	# During systemd service to reboot the machine, stop this shell script running
4a6108
	exit 1
db7d74
fi
db7d74
make_trace_mem "kdump saving vmcore" '1:shortmem' '2+:mem' '3+:slab'
db7d74
do_dump
db7d74
DUMP_RETVAL=$?
db7d74
4a6108
if ! do_kdump_post $DUMP_RETVAL; then
4a6108
	derror "kdump_post script exited with non-zero status!"
db7d74
fi
db7d74
db7d74
if [ $DUMP_RETVAL -ne 0 ]; then
4a6108
	exit 1
db7d74
fi
db7d74
db7d74
do_final_action