[BusyBox] insmod and multiple versions clarification

Stewart Brodie stewart at metahusky.net
Thu Nov 20 11:24:54 UTC 2003


"Andrew Dennison" <andrew.dennison at motec.com.au> wrote:

> Stewart Brodie wrote:
> >
> > We do not have modprobe in our box.  Neither do we have a modules.dep
> > file - and from a brief look at the source code, the former doesn't do
> > anything without the latter.
> >
> > Something in the kernel's build process attempts to run depmod, but it
> > fails because it (presumably the x86 Linux binary) doesn't understand
> > the MIPS Linux kernel modules.
> >
> > It seems that I have to find the modules myself and pass the names
> > directly to insmod.
> 
> Or build a simple modules.dep in your build process?

I am not that familiar with the module dependency management.  How does that
file help (and presumably I'd have to add modprobe too)?

> A simple approach could be just to test if the file /lib/modules/`uname
> -r`/misc/"${prefix}${module}".o exists before running insmod?

Well, since I'd loading "official" kernel modules too, I'd have to do a find
operation over the whole /lib/modules because the kernel likes to put its
modules in a tree that reflects the kernel build tree's structure - which is
what prompted the question in the first place, because this is *almost*
exactly what insmod does.

In fact, it would be useful if the modules could be gzipped and
automatically decompressed by insmod.  Failing that, I suppose I could
modify my even more complex find command to locate .o.gz files and
decompress them to RAM disc for loading.


> > > ps: I think "external" modules normally go under /lib/modules/`uname
> > > -r`/misc/ at least that's where I started putting my custom modules
> > > them after doing some reading about this a while ago.
> >
> > Right, I might change our build system to put stuff in there instead
> > then. One difficulty my build system has is knowing where exactly to
> > install modules to.  How does it know what `uname -r` is going to be at
> > run-time on the target?
> 
> I keep my kernels in versioned directories and tell the build process
> which kernel to build against - simple and effective. I include a file
> called ".buildvars" in my Rules.make so I don't have to hack the makefile
> to build for a different kernel. Nothing unique, just ideas borrowed from
> other makefiles.

So you have to provide the version number explicitly to your build process?
If so, then I'm happy with my automatic detection.

-- 
Stewart Brodie



More information about the busybox mailing list