Charles Steinkuehler wrote:
> > With a nice clean-up of modules, I can forsee a tree like this:
> >
> > /lib/modules/boot/* (in root.lrp)
> > /lib/modules/2.2.16/* (in a modules.lrp)
> > /lib/modules/2.2.19/* (in an alternate modules.lrp)
> Thanks. I play so much with LRP, I forget about stuff like modprobe. We
> should probably migrate towards the more conventional directory structure,
> to avoid unnecessary confusion, if nothing else.
Also, this kernel versioning means that you can load multiple kernel
version modules, and not get them tangled. However, busybox insmod
doesn't honor the traditional order; it does (last I checked) a form of
this:
MOD=${1%%.o}.o
insmod $(eval find /lib/modules -name "$MOD")
Rather than the more interesting and compatable:
insmod $(eval find /lib/modules/`uname -r` /lib/modules/2.2 /lib/modules
-name "$MOD")
(did that make sense?)
> I've seen this done before. I think a trick like this might be good for an
> install script (when creating a modules package), but I don't think we need
> to extend the module loading code to the running system. In addition to the
> extra script overhead, you've got to keep a modules.dep file around. Also,
> the modules.dep file is pretty human-readable...maybe we should just create
> this file and add a couple notes in a readme or howto (or comments in
> /etc/modules) on interpereting it...
I wonder if it would not do, to create a script to further read the
modules.dep file, and create a file listing ONLY dependencies with no
paths: this file would very likely be very short - and by its nature,
very accurate. Then you could refuse to load module X if module Y is
not yet loaded (via judicious use of lsmod and grep).
Let me take a quickie stab at it:
>From a configuration file:
modX: modY modZ
modA: modB
...script:
MOD=${modulename%%.o}.o
MDEP=/etc/modules.dep
deps () {
grep -q "$1" $MDEP 2> /dev/null
}
loaded () {
lsmod | grep -q "${1%%.o}" 2> /dev/null
}
get_deps () {
grep "$1" $MDEP | sed 's/^.*://'
}
dep_err () {
echo "modules: module $MOD depends on $i, which could not be loaded!"
1>&2
echo "modules: aborting..." 1>&2
exit 1
}
if deps "$MOD" ; then
for i in $(get_deps "$MOD") ; do
if ! loaded "${i%%.o}" ; then
insmod $i || dep_err
fi
done
insmod $MOD
fi
...well?
_______________________________________________
Leaf-devel mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/leaf-devel