#!/sbin/runscript
# Copyright 1999-2002 Gentoo Technologies, Inc.
# Distributed under the terms of the GNU General Public License v2
# $Header: /home/cvsroot/gentoo-src/rc-scripts/init.d/localmount,v 1.11 2002/11/18 13:07:02 azarah Exp $


depend() {
	need checkfs
}

start() {
	# Mount local filesystems in /etc/fstab.
	ebegin "Mounting local filesystems"
	mount -at nocoda,nonfs,noproc,noncpfs,nosmbfs,noshm >/dev/null
	eend $? "Some local filesystem failed to mount"

	# Mount usbdevfs if kernel have support
	if [ -z "$(egrep 'usbdevfs' /proc/filesystems)" ]
	then
		# >/dev/null to hide errors from non-USB users
		modprobe usbcore &>/dev/null
	fi
	if [ -n "$(egrep 'usbdevfs' /proc/filesystems)" ] && [ -e /proc/bus/usb ] && \
	   [ ! -e /proc/bus/usb/devices ]
	then
		ebegin "Mounting USB device filesystem"
		mount -t usbdevfs usbdevfs /proc/bus/usb &>/dev/null
		eend $? "Failed to mount USB device filesystem"
	fi

	#swap on loopback devices, and other weirdnesses
	ebegin "Activating (possibly) more swap"
	/sbin/swapon -a &>/dev/null
	eend 0
}


# vim:ts=4
