[Toybox] Differences between modinfo in toybox and standard version

Rob Landley rob at landley.net
Mon Apr 22 17:36:18 PDT 2013


On 04/22/2013 05:40:28 PM, Isaac Dunham wrote:
> Hello,
> The kernel maps all occurences of '-' in module names to '_', so that  
> if you load a module such as snd-pcm-oss.ko or phc-k8.ko, it is  
> presented by lsmod and /proc/modules as module snd_pcm_oss or phc_k8.
> Modinfo from module-init-tools makes up for that by reversing the  
> logic and treating '-' and '_' as equivalent, while toybox takes only  
> the string passed.
> This can result in missing results that should be returned,  
> especially in commands like this:
> for m in `lsmod |cut -f 1 -d ' '`; do /sbin/modinfo $m; done
> (ie, anything that relies on lsmod's output to get a name for  
> modinfo).
> As far as I am aware, there are no modules that use both an  
> underscore and a
> hyphen in the filename.

Happy to accept patches, but I'm not currently up to speed on the  
corner cases of module loading and haven't got spare brain to fit it in  
just now. (If I read through it in the half hour this starbucks is  
still open, I won't finish and will forget what I read by morning.)

> Another difference is that standard modinfo is documented to accept a  
> filename
> as a parameter (modinfo /path/to/module.ko).
> 
> Thanks,
> Isaac Dunham

I only recently added toys/pending and there are a number of third  
party contributions I never did properly triage and clean up. (login.c  
is another one...)

Should I move them into pending so we can track them?

Right now my aboriginal linux build is the main real world test for  
this code, and it doesn't do a modular build. (It also doesn't use  
login, it does oneit straight to a shell prompt instead.) Presumably  
the people who contributed it are using it, but then it works for them  
pretty much by definition...

Thanks for the heads up,

Rob
 1366677378.0


More information about the Toybox mailing list