diff options
author | des <des@FreeBSD.org> | 2004-09-20 17:48:45 +0000 |
---|---|---|
committer | des <des@FreeBSD.org> | 2004-09-20 17:48:45 +0000 |
commit | c93358b0a61cdb766f72fd9b8409fe78679080dd (patch) | |
tree | 6dbce246baa8e63ca2a3ec71f69beef1ced7688d | |
parent | 3054c2e132bd86bf01028a2da882c4f8385f2147 (diff) | |
download | FreeBSD-src-c93358b0a61cdb766f72fd9b8409fe78679080dd.zip FreeBSD-src-c93358b0a61cdb766f72fd9b8409fe78679080dd.tar.gz |
If $dumpdev is set to AUTO, use the first suitable swap partition listed
in /etc/fstab, or print an error message if no suitable device was found.
MFC after: 4 weeks
-rw-r--r-- | etc/rc.d/dumpon | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/etc/rc.d/dumpon b/etc/rc.d/dumpon index 8e81134..5bb202e 100644 --- a/etc/rc.d/dumpon +++ b/etc/rc.d/dumpon @@ -22,6 +22,16 @@ dumpon_start() case ${dumpdev} in [Nn][Oo] | '') ;; + [Aa][Uu][Tt][Oo]) + memsize=$((`/sbin/sysctl -n hw.physmem` / 1024)) + while read dev mp type more ; do + [ "${type}" = "swap" ] || continue + [ -c "${dev}" ] || continue + /sbin/dumpon -v "${dev}" 2>/dev/null && return 0 + done </etc/fstab + echo "No suitable dump device was found." 1>&2 + return 1 + ;; *) /sbin/dumpon -v ${dumpdev} ;; |