13 desc="Dump kernel corefiles from swap to disk"
14 start_cmd="dumpon_start"
15 stop_cmd="dumpon_stop"
22 if [ -n "${dumppubkey}" ]; then
23 warn "The dumppubkey variable is deprecated. Use dumpon_flags."
24 flags="${flags} -k ${dumppubkey}"
26 /sbin/dumpon ${flags} "${1}"
28 # Make a symlink in devfs for savecore
29 ln -fs "${1}" /dev/dumpdev
32 warn "unable to specify $1 as a dump device"
36 dumpon_warn_unencrypted()
38 if [ -n "${dumppubkey}" ]; then
41 for flag in ${dumpon_flags}; do
42 if [ $flag = -k ]; then
46 warn "Kernel dumps will be written to the swap partition without encryption."
51 # Enable dumpdev so that savecore can see it. Enable it
52 # early so a crash early in the boot process can be caught.
59 dev=$(/bin/kenv -q dumpdev)
60 if [ -n "${dev}" ] ; then
64 while read dev mp type more ; do
65 [ "${type}" = "swap" ] || continue
68 dumpon_warn_unencrypted
72 [ -c "${dev}" ] || continue
73 dumpon_try "${dev}" 2>/dev/null && return 0
75 echo "No suitable dump device was found." 1>&2
80 dumpon_try "${dumpdev}"