[BACK]Return to rc.lkm CVS log [TXT][DIR] Up to [cvs.NetBSD.org] / src / etc

File: [cvs.NetBSD.org] / src / etc / Attic / rc.lkm (download)

Revision 1.3, Fri Jul 18 23:38:52 1997 UTC (22 years, 8 months ago) by perry
Branch: MAIN
CVS Tags: netbsd-1-3-base, netbsd-1-3-RELEASE, netbsd-1-3-PATCH003-CANDIDATE2, netbsd-1-3-PATCH003-CANDIDATE1, netbsd-1-3-PATCH003-CANDIDATE0, netbsd-1-3-PATCH003, netbsd-1-3-PATCH002, netbsd-1-3-PATCH001, netbsd-1-3-BETA, netbsd-1-3
Changes since 1.2: +2 -1 lines

fix 3885 from Matthias Scheler -- print out the name of each loaded module

#	$NetBSD: rc.lkm,v 1.3 1997/07/18 23:38:52 perry Exp $
#
# this script loads any LKM's that are required.

[ -s /etc/lkm.conf ] && (
	while read path options entry postinstall output when; do
		cmd='modload '

		case $path in
		\#*|"")
			continue
			;;
		/*)
			;;
		*)
			if [ -f "/lkm/$path" ]; then
				path="/lkm/$path"
			elif [ -f "/usr/lkm/$path" ]; then
				path="/usr/lkm/$path"
			else
				echo "couldn't find module $path";
			fi
			;;
		esac

		case $options in
		-)
			;;
		*)
			cmd="$cmd $options"
			;;
		esac

		case $entry in
		-)
			;;
		*)
			cmd="$cmd -e $entry"
			;;
		esac

		case $postinstall in
		-)
			;;
		*)
			cmd="$cmd -p $postinstall"
			;;
		esac

		case $output in
		-)
			;;
		*)
			cmd="$cmd -o $output"
			;;
		esac

		case $when in
		-)
			when=BEFORENET
			;;
		[A-Z]*)
			;;
		*)
			echo "invalid \"when\" field in /etc/lkm.conf - $path not loaded!"
			continue
			;;
		esac

		if [ $when != $lkmstage ]; then
			continue
		fi

		echo -n "`basename $path .o`: "
		$cmd $path
	done

) < /etc/lkm.conf