Can't find kernel modules after building ROM

Gday, folks! Building own android N rom, changed the kernel config to build some extra modules. After building from sources, found the appropriate *.ko files in out directory (out/product/kvim/obj/KERNEL_OBJ/drivers/ and so on), but after flashing the newbuilt rom can’t find them among the system files, maybe I should change some build rules, since some of kernel modules located at /system/lib directory, and there is no modules folder.

1 Like

Hi, elected:
I think you should modify the file device/khadas/kvim/Kernel.mk ,add your rules copy the ko files:

3 Likes

Thank you very much for the hint! Will give a try. Also maybe you know something how to enable init.d support (for kernel module loading upon system start), or there are something like modules list file which defines what modules to be loaded? Thank you in advance.

You can add some command in file “system/core/rootdir/init.rc”. Find “on boot” item and add the following:
chmod 0770 /system/lib/test.ko
insmod /system/lib/test.ko

1 Like

Brilliant! Trying to add an usbtouchscreen driver support for resistive egalax panel + usb controller, hope it will help. Btw is there any advanced documentation for ROM configuration, avialable properties and options? For example for adding Gapps package, hardware managing etc. It will be good to learn from manual instead of digging sources & config files.Thank you once more.

This may be some basic operations, if you have a problem can be raised in our community, we will try to help you solve the problem.You can also use Google to find some tutorials.:laughing:

If I could find some apropriate tutorials in google, I never asked for such at community forum. Previously I’ve made some builds for Orange Pi and may definetely say, that structure of source files totally differs from sources, provided by Khadas. Also learned documents from source.android.com, and didn’t find information needed, so I suppose, these guides are provided to a developers, who hv some commercial development kits or something similar. However, I can mistake). The community is a good solution, but I prefer to ask for help only after learning the documentations and it doesn’t mention something about occured problem.

Maybe you can recommend some materials to learn?

I am so sorry, I am in China, I don’t know much about foreign books.:roll_eyes:

If they are not written in English it’s not a problem, I’m sure anyway there is no good documentation in Russian)

To ensure community readability, I want to know have you solved your problem?
And if there are some other problems you can message to me.

1 Like

I’ll make a new build according to the information You’ve provided and will report)

And may u pls advice about init.d support?

You can also compile kernel modules separately,then use the “adb push” command to transfer the ko module to the system.

Made previously such way, but thing is in autoloading of them. Suppose I’ve made an mistake not editing the kernel.mk copy rules, and that’s why there was no module loading on boot