#!/bin/sh
#
# (C) Copyright 1993, 1994 Mike Jagdis (jaggy@purplet.demon.co.uk)
#

. /etc/init.d/LIB
mount=`pathof mount`

# Special case for /usr. If /usr is a separate filesystem (as it might
# be if it is intended to be shareable) we want to mount it early as
# we might depend on it being there for some of what follows.
usrspec=`awk '/^\/dev/ && $2 == "/usr"' /etc/fstab 2> /dev/null`
set -- $usrspec
usrdev=$1
usrtype=$3
if [ -n "$usrdev" ]; then
	# If no /fastboot file exists then we fsck the usr fs first.
	if [ -z "$CHECKFS" ] && [ -f /fastboot -o -f /etc/fastboot -o -n "$FASTBOOT" ]; then
		echo "FAST BOOT: usr filesystem *not* checked" > /dev/console
	else
		echo "Checking usr filesystem on $usrdev..." > /dev/console
		(dofscheck $usrdev $usrtype > $CTTY 2>&1 < $CTTY)
	fi
	$mount /usr
fi
