Bug 15670 - modprobe applet doesn't work properly
Summary: modprobe applet doesn't work properly
Status: RESOLVED FIXED
Alias: None
Product: Busybox
Classification: Unclassified
Component: Other (show other bugs)
Version: 1.35.x
Hardware: All Linux
: P5 major
Target Milestone: ---
Assignee: unassigned
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-06-26 12:03 UTC by Ivan Castell
Modified: 2023-11-27 14:49 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:


Attachments
config file (31.89 KB, application/octet-stream)
2023-06-26 12:03 UTC, Ivan Castell
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Ivan Castell 2023-06-26 12:03:53 UTC
Created attachment 9616 [details]
config file

We use "modprobe" applet to load kernel modules.

$ ls -l /sbin/modprobe 
lrwxrwxrwx    1 root   root  14 Jun 26 11:00 /sbin/modprobe -> ../bin/busybox

$ uname -r
4.9.88

$ find /lib/modules/4.9.88/ | grep extra
/lib/modules/4.9.88/extra
/lib/modules/4.9.88/extra/lcd.ko
/lib/modules/4.9.88/extra/pot.ko

$ cat /lib/modules/4.9.88/modules.dep | grep extra
extra/lcd.ko:
extra/pot.ko:

Both kernel drivers load PERFECT using modprobe applet of busybox 1.27.2:

$ /bin/busybox
BusyBox v1.27.2 (2022-02-02 15:18:49 CET) multi-call binary.

$ /bin/busybox modprobe lcd
$ /bin/busybox modprobe pot
$ lsmod
Module                  Size  Used by    Tainted: G  
lcd                     4141  0 
pot                     1930  0 

But when using 1.35, 1.36 and 1.36.1 versions (not tested with other versions), only "pot" is loading, but not "lcd":

$ /bin/busybox
BusyBox v1.36.1 (2023-06-26 11:42:55 UTC) multi-call binary.

$ /bin/busybox modprobe  pot
$ /bin/busybox modprobe  lcd
$ lsmod
Module                  Size  Used by    Tainted: G  
pot                     1930  0 

Retcode is 0 in all cases:

$  /bin/busybox modprobe  lcd
$ echo $?
0

In all cases, the "lcd" driver can be properly loaded using insmod:

$ ls -l /sbin/insmod 
lrwxrwxrwx    1 root     root   14 Jun 26 11:00 /sbin/insmod -> ../bin/busybox

$ insmod /lib/modules/4.9.88/extra/lcd.ko 
$ lsmod
Module                  Size  Used by    Tainted: G  
lcd                     4141  0 
pot                     1930  0 

If you need more information, please let me know. Thank you!
Comment 1 Ivan Castell 2023-11-27 14:49:14 UTC
The problem was related with a built-int kernel module with exactly the same name as external kernel module "lcd.ko". As internal built-in kernel module was already loaded, the external kernel module with exactly the same name was not loaded again.

We could fix this just renaming the kernel module lcd.ko to lcd-2.ko and executing depmod -a. After that, modprobe applet worked as expected.

So, this ticket can be closed as fixed. The problem is not related with busybox. In fact, busybox was working fine and doing the expected.

Thank you so much for your work with this fantastic tool!