I ask a question because I have been trying to solve problems with the keyboard for quite a long time without success. I want to understand how Android kernel modules are compiled. The task is to connect the USB WiFi adapter from Android via OTG and manage the terminal interface. But as an example for teaching fits perfectly. After reading many articles on the subject, I never came close to a solution.
But from what I read, I learned that:
- There are two options: build the module into the kernel when compiling, or compile and load it separately (if it is possible that the kernel will support this property).
- The software required for compilation is: Android NDK, SDK.
- You need the source kernels for which the modules are compiled (You can use a clean kernel similar in version and architecture, the version must match up to the second digit after the dot).
- Get the kernel assembly file with the device. (/proc/config.gz)
But that's all, I don't know what to do next. The device I use for testing Xiaomi Mi A1 (Android One) i.e. there are no problems with the kernel sources, plus active support for LineageOS, which is currently the main OS. Module sources that I want to build on GitHub marked "Android Support".
I don’t understand the procedure, is there a way to assemble like assembling a PC, i.e. for desktop it's just make, make install?! But I have no idea what to do in my situation.
If anyone has comments on the above, inaccuracies, errors, or any additional information, please let us know. It is also a very important question how to check whether the kernel supports loading modules on the fly or what needs to be corrected for such features, although without a ready-made module this is not so important, but still ?!
I would be glad for any information, I can’t figure it out myself anymore. information in various sources varies and there is no universal assembly method.