12 desc="Dump kernel corefiles from swap to disk"
13 start_cmd="dumpon_start"
14 stop_cmd="dumpon_stop"
21 if [ -n "${dumppubkey}" ]; then
22 warn "The dumppubkey variable is deprecated. Use dumpon_flags."
23 flags="${flags} -k ${dumppubkey}"
25 /sbin/dumpon ${flags} "${1}"
27 # Make a symlink in devfs for savecore
28 ln -fs "${1}" /dev/dumpdev
31 warn "unable to specify $1 as a dump device"
35 dumpon_warn_unencrypted()
37 if [ -n "${dumppubkey}" ]; then
40 for flag in ${dumpon_flags}; do
41 if [ $flag = -k ]; then
45 warn "Kernel dumps will be written to the swap partition without encryption."
50 # Enable dumpdev so that savecore can see it. Enable it
51 # early so a crash early in the boot process can be caught.
56 [Aa][Uu][Tt][Oo] | '')
58 dev=$(/bin/kenv -q dumpdev)
59 if [ -n "${dev}" ] ; then
63 if [ -z ${dumpdev} ] ; then
66 while read dev mp type more ; do
67 [ "${type}" = "swap" ] || continue
70 dumpon_warn_unencrypted
74 [ -c "${dev}" ] || continue
75 dumpon_try "${dev}" 2>/dev/null && return 0
77 echo "No suitable dump device was found." 1>&2
82 dumpon_try "${dumpdev}"