1
0
mirror of https://git.FreeBSD.org/src.git synced 2025-01-27 16:39:08 +00:00

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
This commit is contained in:
Dag-Erling Smørgrav 2004-09-20 17:48:45 +00:00
parent daf889f9c8
commit 5a70daa23f
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=135525

View File

@ -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}
;;