Answer the question
In order to leave comments, you need to log in
How to properly build a kernel module for armv7?
There is an ancient TV set-top box on android 4.2.2, I decided to make a console for retro games out of it. There are a lot of Chinese gempads in stock, which are defined as VID:PID 0079:0006 . But in my kernel on this console there is no module for them.
I found a piece of iron with the same A20 processor, kernel version and android version. There was also an instruction on how to compile this driver. I downloaded the sources, launched the assembly with parameters for cross-compilation:
./build.sh -p sun7i_android
The module was assembled, I threw it on the console - and there was a fiasco:
1|[email protected]:/system/vendor/modules # insmod hid-dr.ko
insmod: can't insert 'hid-dr.ko': invalid module format
[15483.755630] hid_dr: disagrees about version of symbol module_layout
[email protected]:/system/vendor/modules # uname -r
3.4.39+
[email protected]:/temp/1# modinfo hi704.ko
filename: hi704.ko
license: GPL
description: A low-level driver for Hynix HI704 sensors
author: raymonxiu
srcversion: D520B3B57CDA80DAE6AC278
alias: i2c:hi704
depends:
intree: Y
vermagic: 3.4.39+ SMP preempt mod_unload modversions ARMv7 p2v8
[email protected]:/temp/1# modinfo hid-dr.ko
filename: hid-dr.ko
license: GPL
srcversion: 633B2932308A266BBE5C934
alias: hid:b0003v00000079p00000011
alias: hid:b0003v00000079p00000006
depends:
intree: Y
vermagic: 3.4.39+ SMP preempt mod_unload modversions ARMv7 p2v8
Answer the question
In order to leave comments, you need to log in
I will answer myself, it turned out to assemble without swearing on insmod. I took the config from the prefix to /proc/config.gz
and edited the module assembly there. I built it with this config, not with arch/arm/ and insmod didn't swear anymore.
Perhaps someone will help.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question