#!/sbin/sh
#	Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T
#	  All Rights Reserved

#	THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF AT&T
#	The copyright notice above does not evidence any
#	actual or intended publication of such source code.

#
#	Copyright (c) 1991, Sun Microsystems Inc.
#

#ident	"@(#)standardmounts	1.4	94/04/07 SMI"

#
# Add physical swap.
#
/sbin/swapadd -1

#
# Check and remount the / (root) file system. For NFS mounts, force the
# llock option on.
#
exec < ${vfstab}; readvfstab "/"
checkfs ${fsckdev} ${fstype} ${mountp}
checkopt "llock" ${mntopts}
mntopts="remount"
if [ "X${otherops}" != "X" ]
then
	mntopts="${mntopts},${otherops}"
fi
if [ "${fstype}" = "nfs" -o "${fstype}" = "cachefs" ]
then
	mntopts="${mntopts},llock"
fi
/sbin/mount -m -o ${mntopts} ${mountp}
mntlist="${mntlist}${special} /\n"

#
# Check and remount the /usr file system (formerly mounted read-only).
#
exec < ${vfstab}; readvfstab "/usr"
if [ "${mountp}" ]
then
	if [ "${fstype}" = "cachefs" ]
	then
		/sbin/mount -m -F cachefs -O -o ${mntopts} ${special} ${mountp}
	else
		checkopt "ro" ${mntopts}
		if [ "X${option}" != "Xro" ]
		then
			checkfs ${fsckdev} ${fstype} ${mountp}
			if [ "${mntopts}" != "-" ]
			then
				mntopts="remount,${mntopts}"
			else
				mntopts="remount"
			fi
			/sbin/mount -m -o ${mntopts} ${mountp}
		fi
	fi
	mntlist="${mntlist}${special} ${mountp}\n"
fi

#
# Check and mount the /usr/kvm file system.
#
exec < ${vfstab}; readvfstab "/usr/kvm"
if [ "${mountp}" ]
then
	checkfs ${fsckdev} ${fstype} ${mountp}
	if [ "${mntopts}" != "-" ]
	then
		/sbin/mount -m -o ${mntopts} ${mountp}
	else
		/sbin/mount -m ${mountp}
	fi
	mntlist="${mntlist}${special} ${mountp}\n"
fi


#
# Mount /proc and the fd file systems if mount points for them exist.
#
exec < ${vfstab}; readvfstab "/proc"
if [ "${mountp}" -a -d /proc ]
then
	/sbin/mount -m /proc > /dev/null 2>&1
	mntlist="${mntlist}/proc /proc\n"
fi

exec < ${vfstab}; readvfstab "/dev/fd"
if [ "${mountp}" -a -d /dev/fd ]
then
	/sbin/mount -m /dev/fd > /dev/null 2>&1
	mntlist="${mntlist}fd /dev/fd\n"
fi

