# Add additional swap files
#
# $FreeBSD: src/etc/rc.d/addswap,v 1.2 2002/10/12 10:31:31 schweikh Exp $
-# $DragonFly: src/etc/rc.d/addswap,v 1.5 2007/08/10 18:28:27 swildner Exp $
#
# PROVIDE: addswap
[Nn][Oo] | '')
;;
*)
- if [ -w "${swapfile}" -a -c /dev/vn0 ]; then
+ if [ -w "${swapfile}" ]; then
+ # load vn kernel module if needed
+ if [ ! -c /dev/vn0 ]; then
+ if kldload vn; then
+ info 'vn module loaded.'
+ else
+ err 1 'vn module failed to load.'
+ fi
+ fi
echo "Adding ${swapfile} as additional swap"
vnconfig -e vn0 ${swapfile} swap
fi
.\"
.\" $FreeBSD: src/share/man/man5/rc.conf.5,v 1.197 2003/07/28 13:56:00 mbr Exp $
.\"
-.Dd December 7, 2012
+.Dd February 18, 2013
.Dt RC.CONF 5
.Os
.Sh NAME
.Dq Li NO ,
no swapfile is installed, otherwise the value is used as the full
pathname to a file to use for additional swap space.
+The
+.Xr vn 4
+driver is needed for a swapfile and will be loaded if it is not
+already compiled into the kernel or loaded via
+.Xr loader.conf 5 .
.It Va apm_enable
.Pq Vt bool
If set to