How to use modprobe.conf or modprobe.d

1,114 views
Skip to first unread message

Huy Minh Bui

unread,
May 10, 2020, 9:42:54 AM5/10/20
to Android-x86
Is there any solution to load modules with modprobe.conf or put rules in modprobe.d like Linux ?
Since there are modules that I want to set modules parameters. Or I have to add it in init.sh ?

Chih-Wei Huang

unread,
May 10, 2020, 10:31:15 AM5/10/20
to Android-x86
Huy Minh Bui <buin...@gmail.com> 於 2020年5月10日 週日 下午9:43寫道:
> Is there any solution to load modules with modprobe.conf or put rules in modprobe.d like Linux ?
> Since there are modules that I want to set modules parameters. Or I have to add it in init.sh ?

Try to use /system/bin/modprobe.

In Android 8 (oreo-x86) and 9 (pie-x86), we have two versions
of modprobe, /sbin/modprobe and /system/bin/modprobe.
The former implemented in ueventd is the default one,
while the latter is implemented in toybox.
Reading code of toybox, it should support modprobe.conf and modprobe.d.
But I didn't try. You may try yourself.

In Android 10 (q-x86) only the toybox version is available.

--
Chih-Wei
Android-x86 project
http://www.android-x86.org

Huy Minh Bui

unread,
May 14, 2020, 8:45:43 AM5/14/20
to Android-x86
What about nougat ? I saw it only have the busybox version (1.22) and tried but it didn't work.

Chih-Wei Huang

unread,
May 14, 2020, 9:21:16 AM5/14/20
to Android-x86
Huy Minh Bui <buin...@gmail.com> 於 2020年5月14日 週四 下午8:45寫道:
>
> What about nougat ? I saw it only have the busybox version (1.22) and tried but it didn't work.

The toybox of Android Nougat doesn't support modprobe.

Huy Minh Bui

unread,
May 14, 2020, 10:40:32 AM5/14/20
to Android-x86
I see, but why busybox isn't work though ?
I'll test with newer Android later.

Chih-Wei Huang

unread,
May 14, 2020, 11:28:40 AM5/14/20
to Android-x86
Huy Minh Bui <buin...@gmail.com> 於 2020年5月14日 週四 下午10:40寫道:
>
> I see, but why busybox isn't work though ?

According to the code, it should work.
You just didn't use it. Did you?

/system/xbin/modprobe

I forgot to mention that.
So indeed we have three versions of modprobe. :p
(in Android 8 / 9)

> I'll test with newer Android later.

youling 257

unread,
Oct 23, 2020, 12:29:12 PM10/23/20
to Android-x86
I delete /system/xbin/modprobe、/system/bin/modprobe 、/sbin/modprobe、/system/xbin/insmod、/system/bin/insmod,it still can load modules.
I want to load amdgpu module options si_support=1 gartsize=256, but load amdgpu not used modprobe and insmod, it use uevent insmod_by_dep,
how to use modules options?

在 2020年5月14日星期四 UTC+8下午11:28:40,Chih-Wei Huang写道:

youling 257

unread,
Oct 23, 2020, 12:46:38 PM10/23/20
to Android-x86
[ 2309.547170] usb 1-4.1: new full-speed USB device number 14 using xhci_hcd
[ 2309.633809] audit: type=1400 audit(1603470944.873:2087): avc: denied { open } for pid=1443 comm="ueventd" path="/system/lib/modules/5.9.0-android-x86_64+/modules.dep" dev="sda2" ino=6029873 scontext=u:r:ueventd:s0 tcontext=u:object_r:system_data_file:s0 tclass=file permissive=1
[ 2309.633863] audit: type=1400 audit(1603470944.873:2088): avc: denied { sys_module } for pid=1443 comm="ueventd" capability=16 scontext=u:r:ueventd:s0 tcontext=u:r:ueventd:s0 tclass=capability permissive=1
[ 2309.633895] audit: type=1400 audit(1603470944.873:2089): avc: denied { module_load } for pid=1443 comm="ueventd" path="/system/lib/modules/5.9.0-android-x86_64+/kernel/drivers/hid/hid-multitouch.ko" dev="sda2" ino=6030304 scontext=u:r:ueventd:s0 tcontext=u:object_r:system_data_file:s0 tclass=system permissive=1
[ 2309.634680] input: ILITEK ILITEK-TP as /devices/pci0000:00/0000:00:14.0/usb1/1-4/1-4.1/1-4.1:1.0/0003:222A:0001.0007/input/input23

what's the ueventd {sys_module} and {module_load} ?


在 2020年5月14日星期四 UTC+8下午11:28:40,Chih-Wei Huang写道:
Huy Minh Bui <buin...@gmail.com> 於 2020年5月14日 週四 下午10:40寫道:
Message has been deleted

AXON

unread,
Oct 23, 2020, 2:28:12 PM10/23/20
to Android-x86
I believe the `init` executable inside `ramdisk.img` (relatively `/android/init`) itself has an applet of modprobe which it uses interally, if you symlink it as modprobe in another path then it will also act like modprobe externally.

youling 257

unread,
Oct 23, 2020, 9:14:26 PM10/23/20
to Android-x86
delete all the modprobe, rmmod  hid_multitouch, replug usb touchscreen, ueventd can auto load hid-multitouch, it not  use modprobe at all.
uevented load amdgpu module not use modprobe! 

在 2020年10月24日星期六 UTC+8上午2:28:12,AXON写道:

AXON

unread,
Oct 24, 2020, 1:47:08 AM10/24/20
to Android-x86
Oh, I see, and that's still the `init` executable which runs in the background, so autoloading makes sense now.

crw

unread,
Oct 25, 2020, 10:33:18 AM10/25/20
to Android-x86
So then it's possible to virtually load any driver we want, without having to build the kernel from source? Like in linux where you could install drivers without having to build the kernel.
Message has been deleted

crw

unread,
Oct 25, 2020, 10:52:59 AM10/25/20
to Android-x86
With the included wifi driver 5ghz band doesn't work. And all HP laptops in the past few years have accelerometers (HP 3D DriveGuard receives notifications from the integrated accelerometer and protects the hard drive (HDD) by automatically "parking the heads" to reduce the risk of damage if the notebook is accidentally dropped or is abruptly impacted by another object.) Linux lets me use that as an joystick for games. Playing android games with that is amazing.
It would be nice to load user-supplied modules and have the kernel accept them. kernel won't accept those user-supplied modules if secure boot is enabled.

Huy Minh Bui

unread,
Oct 25, 2020, 1:55:23 PM10/25/20
to Android-x86
You will have to make something similar to dkms and then port a lot of development tools like make, gcc, binutils, etc. Not to mention you have to export the kernel headers out and put it into system. 
Vào lúc 21:33:18 UTC+7 ngày Chủ Nhật, 25 tháng 10, 2020, crw đã viết:
Reply all
Reply to author
Forward
Message has been deleted
0 new messages