Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/etc - Move critical filesystem mounting code into a shell fu...
details: https://anonhg.NetBSD.org/src/rev/7939f2ed36c8
branches: trunk
changeset: 467431:7939f2ed36c8
user: mellon <mellon%NetBSD.org@localhost>
date: Wed Mar 24 18:59:47 1999 +0000
description:
- Move critical filesystem mounting code into a shell function and put
that in rc.subr.
- Support critfs_require_network rc.conf variable.
diffstat:
etc/rc | 22 ++++++++--------------
etc/rc.subr | 23 ++++++++++++++++++++++-
2 files changed, 30 insertions(+), 15 deletions(-)
diffs (77 lines):
diff -r bd11aa872fd1 -r 7939f2ed36c8 etc/rc
--- a/etc/rc Wed Mar 24 18:50:07 1999 +0000
+++ b/etc/rc Wed Mar 24 18:59:47 1999 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: rc,v 1.119 1999/03/19 00:35:44 perry Exp $
+# $NetBSD: rc,v 1.120 1999/03/24 18:59:47 mellon Exp $
# originally from: @(#)rc 8.2 (Berkeley) 3/17/94
# System startup script run by init on autoboot
@@ -105,6 +105,10 @@
fi
fi
+if ! checkyesno critfs_require_network; then
+ mount_critical_filesystems
+fi
+
# set hostname, turn on network
echo 'starting network'
sh /etc/netstart
@@ -112,19 +116,9 @@
exit 1
fi
-for fs in /usr /var $critical_filesystems; do
- mount | (
- ismounted=no
- while read what _on on _type type; do
- if [ $on = $fs ]; then
- ismounted=yes
- fi
- done
- if [ $ismounted = no ]; then
- mount $fs >/dev/null 2>&1
- fi
- )
-done
+if checkyesno critfs_require_network; then
+ mount_critical_filesystems
+fi
# Network Address Translation...
if checkyesno ipnat && [ -f /etc/ipnat.conf ]; then
diff -r bd11aa872fd1 -r 7939f2ed36c8 etc/rc.subr
--- a/etc/rc.subr Wed Mar 24 18:50:07 1999 +0000
+++ b/etc/rc.subr Wed Mar 24 18:59:47 1999 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: rc.subr,v 1.5 1998/02/28 22:56:11 lukem Exp $
+# $NetBSD: rc.subr,v 1.6 1999/03/24 18:59:47 mellon Exp $
# functions used by various rc scripts
#
@@ -26,3 +26,24 @@
;;
esac
}
+
+#
+# mount_critical_filesystems
+# Go through the list of critical filesystems, checking each one
+# to see if it is mounted, and if it is not, mounting it.
+#
+mount_critical_filesystems() {
+ for fs in /usr /var $critical_filesystems; do
+ mount | (
+ ismounted=no
+ while read what _on on _type type; do
+ if [ $on = $fs ]; then
+ ismounted=yes
+ fi
+ done
+ if [ $ismounted = no ]; then
+ mount $fs >/dev/null 2>&1
+ fi
+ )
+ done
+}
Home |
Main Index |
Thread Index |
Old Index