There are NO such file or directory errors when executing insmod on Android Kernel

I followed the steps in the forum ( http://www.schaeuffelhut.de/wordpress/?p=237&cpage=1#comment-384 ) to get the Linux kernel source code and compile my module. The google nexus kernel version is exactly the same as on the forum. First, I tested my test module hello-1.ko, which was successfully installed on an Android device. But when I install my ec.ko module on an Android device using insmod, I get the following error.

apurva @ apurva-Inspiron-1464: ~ / $ adb shell
$ cd sdcard / data / ec
$ ls
ec.ko
$ su
# insmod ec.ko
insmod: init_module 'ec.ko' failed (no such file or directory)
#

It is clear that the ec.ko file is present. But I'm not sure why it does not select the file. I did the same for hi-1.ko and it absorbs insmod very well. There is no permission, and ec.ko gets the same permission that was obtained by hello-1.ko.

Now this leads me to the question: Are there certain limitations of the kernel module in the Android device, because this module receives insmod in Ubuntu. The next step for me is to find the beat and sample method and check which lines in ec.c are causing the problem. Meanwhile, if you have any suggestion, please let me know.

+4
source share
1 answer

You can check the dmesg log to see if something can help you. I also ran into the same problem. The next is how I solved this problem. I installed my module on an Android device using the insmod command, but received the same error message as you. I checked dmesg at the time, and I got the following: Unknown character "XXX" (I forgot the name of the function). I used the command - cat / proc / kallsyms | grep "XXX" to find this character, but I did not find anything. The reason for this problem is that the feature is deprecated in AndroidM. Finally, I fixed this problem by annotating the function.

0
source

Source: https://habr.com/ru/post/1399593/


All Articles