[PATCH] Fix error message display for rmmod

Dan Fandrich dan at coneharvesters.com
Mon Sep 27 19:36:57 UTC 2010


On Sat, Sep 25, 2010 at 02:40:52PM +0200, Denys Vlasenko wrote:
> Is this a problem? Standard "modprobe -r" doesn't work at all
> with empty /lib/modules/`uname -r`/. This is simply is not a supported
> way of using modules.

That may be a limitation of modprobe -r, but it's quite unexpected with
rmmod.

I'm working on an embedded system that has just a handful of modules that
are explicitly loaded at boot time. There's no need for a dependencies file
or even a /lib/modules/X directory. 

> But yes, rmmod'ing and then complaining about it is confusing.
> I think I just fixed this by:
> 
> http://git.busybox.net/busybox/commit/?id=5b3151c201f4a67e998ec054d653e8177679d505
> 
> can you confirm?

That patch solves that erroneous message nicely--thanks.

> > modprobe from module-init-tools does show an error message if
> > NON_LOADED_MODULE is also not found in modules.dep (this is assuming
> > modules.dep exists or it gives another error):
> > 
> > $ sudo modprobe -r xyzzy
> > FATAL: Module xyzzy not found.
> > $
> 
> Making "small rmmod" compatible with this case means making it read
> modules.dep.bb even though module is not found in /proc/modules,
> i.e. to do useless work.

I'd be happy if rmmod gave an error if it ended up removing nothing,
whether in modules.dep.bb or not. Those semantics would be my preference,
since neither exactly matches mainstream modprobe, anyway.

> Can you list the fixes you'd like to see to "small" modprobe, ordered by
> severity of the problem? Not all of them look equally important...

You've fixed the one that bugged me the most. The only other one I really
think needs to be fixed is rmmod's failure to run when /lib/modules/`uname`/
doesn't exist.  Looking for that directory is another case of rmmod
doing useless work. A close second would be rmmod's tendency to create an
new, empty modules.dep.bb in /lib/modules/`uname`/ upon successful module
deletion.  These are major differences in behaviour between busybox rmmod
and mainstream rmmod (the last one seems just as strange a behaviour for
modprobe -r, too).

>>> Dan


More information about the busybox mailing list