[Toybox] Differences between modinfo in toybox and standard version
Isaac Dunham
idunham at lavabit.com
Mon Apr 22 15:40:28 PDT 2013
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.
Another difference is that standard modinfo is documented to accept a filename as a parameter (modinfo /path/to/module.ko).
Thanks,
Isaac Dunham
1366670428.0
More information about the Toybox
mailing list