core/src/etc/rc.dumpon
Franco Fichtner 727453c076 src: move all files (again)
Make "src" the implicit "/usr/local" so that nobody can
sneak in weird files in the base file system or potentially
overwrite them.

This is the last time, I swear...  :)
2014-12-10 16:42:39 +01:00

33 lines
705 B
Bash
Executable File

#!/bin/sh
dumpon_try()
{
if /sbin/dumpon "${1}" ; then
# Make a symlink in devfs for savecore
echo "Using ${1} for dump device."
ln -fs "${1}" /dev/dumpdev
return 0
fi
echo "Unable to specify $1 as a dump device."
return 1
}
# Enable dumpdev so that savecore can see it. Enable it
# early so a crash early in the boot process can be caught.
#
while read dev mp type more ; do
[ "${type}" = "swap" ] || continue
[ -c "${dev}" ] || continue
dumpon_try "${dev}" && works=true
done </etc/fstab
if [ "${works}" != "true" ]; then
echo "No suitable dump device was found." 1>&2
exit
fi
# ddb
if [ ! -z "`sysctl -Nq debug.ddb.scripting.scripts`" ]; then
/sbin/ddb /usr/local/etc/ddb.conf
fi