#!/bin/sh

PREREQ=""
prereqs()
{
	echo "$PREREQ"
}
case $1 in
# get pre-requisites
prereqs)
	prereqs
	exit 0
	;;
esac

grep -q kdump_needed /proc/cmdline || exit 0

log_begin_msg "Saving vmcore for kernel crash"

mount $rootmnt -o remount,rw
# Delete it if the copy fails, mainly to keep from filling up filesystems
# by accident.
cp --sparse=always /proc/vmcore $rootmnt/var/crash/vmcore || rm -f \
	$rootmnt/var/crash/vmcore
umount $rootmnt
reboot

log_end_msg
