4e045b6b43
loads before netstart this time. LKMs can be loaded at 3 strategic places in /etc/rc - before netstart, before "mount -a" and after all. "before netstart" works only if the /usr filesystem is local (or on NFS, if root is too). An additional field ("when") in lkm.conf controls when the LKM is loaded.
78 lines
1011 B
Plaintext
78 lines
1011 B
Plaintext
# $NetBSD: rc.lkm,v 1.2 1997/07/14 11:55:45 drochner 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
|
|
|
|
$cmd $path
|
|
done
|
|
|
|
) < /etc/lkm.conf
|