summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--etc/defaults/rc.conf2
-rw-r--r--etc/rc.d/tmp4
-rw-r--r--etc/rc.d/var4
-rw-r--r--etc/rc.subr6
-rw-r--r--share/man/man5/rc.conf.532
5 files changed, 41 insertions, 7 deletions
diff --git a/etc/defaults/rc.conf b/etc/defaults/rc.conf
index 9909ff8..4d79265 100644
--- a/etc/defaults/rc.conf
+++ b/etc/defaults/rc.conf
@@ -40,8 +40,10 @@ pccard_ether_delay="5" # Delay before trying to start dhclient in pccard_ether
removable_interfaces="" # Removable network interfaces for /etc/pccard_ether.
tmpmfs="AUTO" # Set to YES to always create an mfs /tmp, NO to never
tmpsize="20m" # Size of mfs /tmp if created
+tmpmfs_flags="-S -o noexec,nosuid,nodev" # Extra mdmfs options for the mfs /tmp
varmfs="AUTO" # Set to YES to always create an mfs /var, NO to never
varsize="32m" # Size of mfs /var if created
+varmfs_flags="-S" # Extra mount options for the mfs /var
populate_var="AUTO" # Set to YES to always (re)populate /var, NO to never
local_startup="/usr/local/etc/rc.d /usr/X11R6/etc/rc.d" # startup script dirs.
script_name_sep=" " # Change if your startup scripts' names contain spaces
diff --git a/etc/rc.d/tmp b/etc/rc.d/tmp
index 0c7a460..9b0d74b 100644
--- a/etc/rc.d/tmp
+++ b/etc/rc.d/tmp
@@ -42,7 +42,7 @@ load_rc_config $name
#
case "${tmpmfs}" in
[Yy][Ee][Ss])
- mount_md ${tmpsize} /tmp
+ mount_md ${tmpsize} /tmp "${tmpmfs_flags}"
chmod 01777 /tmp
;;
[Nn][Oo])
@@ -56,7 +56,7 @@ case "${tmpmfs}" in
echo "dropping into shell, ^D to continue anyway."
/bin/sh
else
- mount_md ${tmpsize} /tmp
+ mount_md ${tmpsize} /tmp "${tmpmfs_flags}"
chmod 01777 /tmp
fi
fi
diff --git a/etc/rc.d/var b/etc/rc.d/var
index 7a4baf4..1e506c0 100644
--- a/etc/rc.d/var
+++ b/etc/rc.d/var
@@ -61,7 +61,7 @@ _populate_var()
#
case "${varmfs}" in
[Yy][Ee][Ss])
- mount_md ${varsize} /var
+ mount_md ${varsize} /var "${varmfs_flags}"
;;
[Nn][Oo])
;;
@@ -69,7 +69,7 @@ case "${varmfs}" in
if (/bin/mkdir -p /var/.diskless 2> /dev/null); then
rmdir /var/.diskless
else
- mount_md ${varsize} /var
+ mount_md ${varsize} /var "${varmfs_flags}"
fi
esac
diff --git a/etc/rc.subr b/etc/rc.subr
index bce5491..e032149 100644
--- a/etc/rc.subr
+++ b/etc/rc.subr
@@ -1289,12 +1289,12 @@ devfs_mount_jail()
# as close as possible between 5-current and 4-stable.
# $1 = size
# $2 = mount point
-# $3 = (optional) bytes-per-inode
+# $3 = (optional) extra mdmfs flags
mount_md() {
if [ -n "$3" ]; then
- bpi="-i $3"
+ flags="$3"
fi
- /sbin/mdmfs $bpi -s $1 -M md $2
+ /sbin/mdmfs $flags -s $1 -M md $2
}
fi
diff --git a/share/man/man5/rc.conf.5 b/share/man/man5/rc.conf.5
index 730f534..3bc1985 100644
--- a/share/man/man5/rc.conf.5
+++ b/share/man/man5/rc.conf.5
@@ -240,6 +240,22 @@ is not writable.
Controls the size of a created
.Pa /tmp
memory file system.
+.It Va tmpmfs_flags
+Extra options passed to the
+.Xr mdmfs 8
+utility when the memory file system for
+.Pa /tmp
+is created.
+The default is
+.Dq Li -S -o noexec,nosuid,nodev ,
+which inhibits the use of softupdates on
+.Pa /tmp
+to waste as little space as possible and mounts the memory file system
+.Dq Li noexec,nosuid,nodev .
+See
+.Xr mdmfs 8
+for other options you can use in
+.Li tmpmfs_flags .
.It Va varmfs
Controls the creation of a
.Pa /var
@@ -255,6 +271,21 @@ is not writable.
Controls the size of a created
.Pa /var
memory file system.
+.It Va varmfs_flags
+Extra options passed to the
+.Xr mdmfs 8
+utility when the memory file system for
+.Pa /var
+is created.
+The default is
+.Dq Li -S ,
+which inhibits the use of softupdates on
+.Pa /var
+to waste as little space as possible.
+See
+.Xr mdmfs 8
+for other options you can use in
+.Li varmfs_flags .
.It Va populate_var
Controls the automatic population of the
.Pa /var
@@ -3109,6 +3140,7 @@ device and the mount point will be changed.
.Xr kldxref 8 ,
.Xr lpd 8 ,
.Xr mdconfig 8 ,
+.Xr mdmfs 8 ,
.Xr mountd 8 ,
.Xr moused 8 ,
.Xr mrouted 8 ,
OpenPOWER on IntegriCloud