1
|
#!/bin/sh
|
2
|
# Based on:
|
3
|
# FreeBSD: src/etc/rc.d/dumpon,v 1.12.2.1.4.1 2010/06/14 02:09:06 kensmith Exp
|
4
|
|
5
|
# dumpon
|
6
|
|
7
|
dumpon_try()
|
8
|
{
|
9
|
if /sbin/dumpon "${1}" ; then
|
10
|
# Make a symlink in devfs for savecore
|
11
|
echo "Using ${1} for dump device."
|
12
|
ln -fs "${1}" /dev/dumpdev
|
13
|
return 0
|
14
|
fi
|
15
|
echo "Unable to specify $1 as a dump device."
|
16
|
return 1
|
17
|
}
|
18
|
|
19
|
# Enable dumpdev so that savecore can see it. Enable it
|
20
|
# early so a crash early in the boot process can be caught.
|
21
|
#
|
22
|
while read dev mp type more ; do
|
23
|
[ "${type}" = "swap" ] || continue
|
24
|
[ -c "${dev}" ] || continue
|
25
|
dumpon_try "${dev}" && works=true
|
26
|
done </etc/fstab
|
27
|
if [ "${works}" != "true" ]; then
|
28
|
echo "No suitable dump device was found." 1>&2
|
29
|
exit
|
30
|
fi
|
31
|
|
32
|
# ddb
|
33
|
if [ ! -z "`sysctl -Nq debug.ddb.scripting.scripts`" ]; then
|
34
|
/sbin/ddb /etc/ddb.conf
|
35
|
fi
|