insmod not working by module name in Linux 2.4.30 / MIPS

Rob Landley rob at landley.net
Tue Sep 28 21:21:26 UTC 2010


On Tuesday 28 September 2010 16:15:28 RiCH Busybox wrote:
> On Tue, 2010-09-28 at 09:23 +1000, Stuart Longland wrote:
> > On Mon, Sep 27, 2010 at 09:40:05PM +0100, RiCH Busybox wrote:
> > > On Mon, 2010-09-27 at 07:49 +1000, Stuart Longland wrote:
> > > > Have you perhaps tried 'modprobe'?  My understanding is that insmod
> > > > always did require the full path (from memory this has been the case
> > > > since modutils days in kernel 2.0), and that 'modprobe' was the tool
> > > > if you just wanted to recall a module by name rather than by file.
> > >
> > > Hi Stuart, thanks for your reply
> > >
> > > modprobe works fine loading/unloading, using just the module name
> > > modinfo works fine just using module name
> > > rmmod works fine just using module name
> > > insmod doesn't work using the module name (however it does in busybox
> > > <= 1.0.1)
> > >
> > > I admit to knowing very little about it, but seems if rmmod can cope
> > > with module name then insmod should also be able to?
> > >
> > > Unfortunately as it did work, this firmware has been built assuming it
> > > does and as I said its hard coded into a binary (sysinit)  ...
> > > Even if technically insmod shouldnt work is there a way it can be
> > > easily patched to be backwards compatible?
> >
> > It did work in official busybox-1.0.1, or it worked in the busybox-1.0.1
> > sources as supplied with the firmware?
> >
> > In any case, a bit of shell voodoo will probably do what you want:
> >
> > #!/bin/ash
> >
> > if [ -f "$1" ]; then
> > 	exec busybox insmod "$@"
> > else
> > 	exec busybox modprobe "$@"
> > fi
> >
> > Call that /sbin/insmod, and set permissions as appropriate.  Unless of
> > course the binary expects to call 'busybox insmod' directly instead of
> > via the symlink, that should work.
>
> Hi Stuart,
> Thanks for your reply,
> It worked in busybox-1.1.0.5VT that is bundled with buildable firmware,
> I also tried v1.01 copying config file over (which is presumably v1.0.1,
> the naming convention changed for some reason on this release) and works
> fine also.
> (Some others like 1.1.1 dont seem to function, the router gets stuck
> booting when its handed over from uboot)
> I just tried 1.11.2 (again just copying config file, doing a make
> menuconfig ,save and exit without altering anything, and everything to
> my amazement works!
>
> I can only assume this along with the fact the insmod.c actually
> mentions it should work on 2.4 kernels by using just the module name
> that 1.17.2 does have a bug.
>
> When I get more time I will try newer and newer builds to see where it
> broke.

The modprobe support for 2.4 kernels is a legacy feature that isn't really 
very well tested.

Considering that the 2.4 kernel maintainer has essentially declared the 2.4 
kernel series dead, busybox is unlikely to suddenly start putting more effort 
into regression testing it.

  http://lwn.net/Articles/403649/

Rob
-- 
GPLv3: as worthy a successor as The Phantom Menace, as timely as Duke Nukem 
Forever, and as welcome as New Coke.


More information about the busybox mailing list