#!/bin/sh
# Begin $rc_base/init.d/mountkernfs

# Rewritten by Gerard Beekmans  - gerard@linuxfromscratch.org

. /etc/sysconfig/rc
. $rc_functions

case "$1" in
	start)
		echo -n "Mounting kernel-based file systems:"

		if [ ! -e /proc/mounts ]; then
			echo -n " /proc"
			mount -n /proc || failed=1
		fi

		# This should be mounted on a 2.6 kernel.
		if grep -q '[[:space:]]sysfs' /proc/filesystems; then
			if [ -d /sys -a ! -d /sys/block ]; then
				echo -n " /sys"
				mount -n /sys || failed=1
			fi
		fi

		echo
		(exit $failed)
		evaluate_retval
		;;
	*)
		echo "Usage: $0 {start}"
		exit 1
		;;
esac

# End $rc_base/init.d/mountkernfs
