insmod path search

Matteo Croce rootkit85 at yahoo.it
Fri May 25 16:57:52 UTC 2007


Hi,
after discussing a while my insmod patch in the bugtrack (http://bugs.busybox.net/view.php?id=1344)
i'm switching the discussion in the ML.
I use BusyBox in my router, an AR7 machine which runs OpenWrt.
OpenWrt devs decided to thrash the 2.4 AR7 port and keep only the 2.6,
so in the BusyBox options i removed the 2.2 and 2.4 old module support
and the result is that at boot time no module were loaded.
I investigated a bit and I noticed that OpenWrt 's scripts calls insmod without a full path, like "insmod tiatm"
since BusyBox's insmod scan the whole /lib/modules to find the right module.
Then I discovered that the code that scans /lib/modules is enabled only in 2.4 aware configs, so i've made the attached patch
to fix it, but in an ugly way.
Yann E. MORIN wrote:
> First of, we must decide wether its the job of insmod or not. Again, plain insmod from module-init-tools does NOT search for modules. Do we want to add this feature that the original code doesn't have? I guess no.
> Second, you're mostly duplicating code in your patch. Common code should lie in a function that gets called from everywhere it's needed. If we decide to incorporate this code, you'll have to refactor your patch.
> Ralf, are you subsribed to the BB mailing list? If so, we should switch there to see what people think about this issue.
I know that plain insmod from module-init-tools does NOT search for modules, but if it is not insmod jobwhy we do it in the 2.4 version?
On the other hand I agree with Yann that putting the common code in a function is the right way,
even if I don't really duplicate code, it gets compiled once due to some #ifdef (ugly too, i have to admit)
Cheers,
Matteo
-------------- next part --------------
A non-text attachment was scrubbed...
Name: insmod.diff
Type: text/x-diff
Size: 5327 bytes
Desc: not available
Url : http://lists.busybox.net/pipermail/busybox/attachments/20070525/fcb83cd1/attachment-0002.bin 


More information about the busybox mailing list