Add modules in Source Build

59 views
Skip to first unread message

Bastien Chanot

unread,
Jun 24, 2019, 11:50:11 AM6/24/19
to Android-x86
Hi everyone ! I hope you are fine !

I'm here to ask you if you know how to add modules in the sources code of Android x86 and launch it automatically ?

It works, the module is compiled and available with a modprobe, but i don't find how to enable the automatic launch of the module ?

I tried to set the module dedicated Kconfig a "default y", i can see ths modules is on 'y' when i check the /proc/config.gz, but the module still don't load alone.

I wish to add the automatically load in the sources file, because i don't wanna launch the modprobe each time i run Android. I don't want to just editing /etc/init.sh once the Android is running. Just know the fact i really have to add the automated launch of it at the build time x).

I'm sure its so simple like a basic script in a good folder, but i really don't find --" xD

(i'm using 8.1 r2, in case of its useful x))

Thanks for your answers !
Regards, Bastien

Chih-Wei Huang

unread,
Jun 24, 2019, 10:38:20 PM6/24/19
to Android-x86
Bastien Chanot <chanot....@gmail.com> 於 2019年6月24日 週一 下午11:50寫道:
>
> Hi everyone ! I hope you are fine !
>
> I'm here to ask you if you know how to add modules in the sources code of Android x86 and launch it automatically ?
>
> I followed steps on this tutorial : https://abdullahyousafzaii.wordpress.com/2015/08/02/how-to-write-a-kernel-module-for-android/
> It works, the module is compiled and available with a modprobe, but i don't find how to enable the automatic launch of the module ?
>
> I tried to set the module dedicated Kconfig a "default y", i can see ths modules is on 'y' when i check the /proc/config.gz, but the module still don't load alone.

How did you know?

If you set it to y, it's built-in in the kernel.
Then you won't see the module in lsmod, of course.

You should check /sys/module/.

> I wish to add the automatically load in the sources file, because i don't wanna launch the modprobe each time i run Android. I don't want to just editing /etc/init.sh once the Android is running. Just know the fact i really have to add the automated launch of it at the build time x).
>
> I'm sure its so simple like a basic script in a good folder, but i really don't find --" xD
>
> (i'm using 8.1 r2, in case of its useful x))

The modules will be auto loaded in these cases:

* On booting, uevented detects the hardware and load the
corresponding modules (drivers) for all known peripherals.
* At runtime, the userspace programs request features
implemented in some modules, then the kernel will auto
load them. (e.g., mount a specific filesystem)

Except the cases (maybe others I don't know),
you have to load the module manually.

What's your module exactly?


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

Bastien Chanot

unread,
Jun 26, 2019, 7:18:26 AM6/26/19
to Android-x86
Hi !


How did you know?

If you set it to y, it's built-in in the kernel.
Then you won't see the module in lsmod, of course.

You should check /sys/module/.
Yeah i knew that, that why im asking..

I got my module folder only after made a modprobe  of him.
The modules will be auto loaded in these cases:

* On booting, uevented detects the hardware and load the
   corresponding modules (drivers) for all known peripherals.
* At runtime, the userspace programs request features
  implemented in some modules, then the kernel will auto
  load them. (e.g., mount a specific filesystem)

Except the cases (maybe others I don't know),
you have to load the module manually.

What's your module exactly?

My module is a virtual touchscreen module.

But i found my answer, i just added line i needed in the init.sh before the build and my module is correctly loaded =).

Thanks for your help.

Regards, Bastien

Le mardi 25 juin 2019 04:38:20 UTC+2, Chih-Wei Huang a écrit :
Bastien Chanot <chanot...@gmail.com> 於 2019年6月24日 週一 下午11:50寫道:

Chih-Wei Huang

unread,
Jun 26, 2019, 10:19:56 AM6/26/19
to Android-x86
Bastien Chanot <chanot....@gmail.com> 於 2019年6月26日 週三 下午7:18寫道:
>
> Hi !
>> How did you know?
>>
>> If you set it to y, it's built-in in the kernel.
>> Then you won't see the module in lsmod, of course.
>>
>> You should check /sys/module/.
>
> Yeah i knew that, that why im asking..
>
> I got my module folder only after made a modprobe of him.

Then that means your driver is not built-in.
Even you set it to y, sometimes the build system will
change it to m due to some reasons.
For example, it depends on some modules which are not built-in.
Reply all
Reply to author
Forward
0 new messages