add rc.lkm and lkm.conf, to be run from /etc/rc.

This commit is contained in:
mrg 1997-01-05 11:47:53 +00:00
parent a9efb63860
commit 52a5311c49
2 changed files with 67 additions and 0 deletions

6
etc/lkm.conf Normal file
View File

@ -0,0 +1,6 @@
# $NetBSD: lkm.conf,v 1.1 1997/01/05 11:47:53 mrg Exp $
#
# see lkm.conf(5) for details. path will look in /lkm and /usr/lkm.
#
# path options entry postinstall output
#/lkm/if_ipl.o - - - -

61
etc/rc.lkm Normal file
View File

@ -0,0 +1,61 @@
# $NetBSD: rc.lkm,v 1.1 1997/01/05 11:47:53 mrg Exp $
#
# this script loads any LKM's that are required.
[ -s /etc/lkm.conf ] && (
while read path options entry postinstall output; 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
$cmd $path
done
) < /etc/lkm.conf