I am trying to compile panel-ilitek-ili9881c.c driver on the i.MX 8M Nano DDR4 EVK board, however I do not see kernel headers for:
5.10.9-1.0.0+g32513c25d8c7 <----- obtained by running $ uname -r
The Linux installed on the board is:
NAME="NXP i.MX Release Distro"
PRETTY_NAME="NXP i.MX Release Distro 5.10-gatesgarth (gatesgarth)"
I need to compile only this (one) kernel module (driver).
I cross-compiled it on another dedicated Linux machine (x86_64) but when tried to load in 5.10.9-1.0.0+g32513c25d8c I was getting 'module format error' because the module is compiled against different kernel.
What are the exact steps to build (compile) and load one module, driver for this Linux kernel 5.10.9-1.0.0+g32513c25d8c7 present on the board?
The driver is included in the 4.14.98 BSP of part of the Mini,
However if you want to create a module:
Thanks, Bio_TICFSL, for your answer.
My goal is to cross-compile “panel-ilitek-ili9881c” driver against kernel “5.10.9-1.0.0+g32513c25d8c7 ” provided by NXP with “NXP i.MX Release Distro 5.10-gatesgarth (gatesgarth)” on another dedicated Linux machine, not on i.MX 8M Nano EVK. My goal is to build this kernel on this dedicated machine.
As I understand, I need to exactly match vermagic for this module to match the following string (obtained from other modules on i.MX 8M Nano running modinfo):
“vermagic=5.10.9-1.0.0+g32513c25d8c7 SMP preempt mod_unload modversions aarch64”.
From your answer the “5.10.35v from codeaurora” will not serve the purpose because vermagic right away will not match. So, I have to target kernel “5.10.9-1.0.0+g32513c25d8c7“.
1. Will it be correct to use and build kernel 5.10.9v to compile the module against and then load it to the “5.10.9-1.0.0+g32513c25d8c7 ” kernel? I built 5.10.y kernel but it did not give correct vermagic for the module. Can you please provide link to page where I can download 5.10.9v kernel? I tried kernel.org and https://lore.kernel.org/stable/?q=5.10.9v but search returned no results.
2. In order to build the module and then load it, all the kernel settings must be the same so I copied /proc/config.gz from kernel “5.10.9-1.0.0+g32513c25d8c7 ” from Nano EVK and used it on my Linux machine for cross-compile it with 5.10.y kernel, but getting “disagrees about version of symbol module_layout” and “Exec format error” errors. What is the correct approach?
3. As I understand, to avoid the “disagrees about version of symbol module_layout” and “Exec format error” errors my vermagic must exactly match “5.10.9-1.0.0+g32513c25d8c7 SMP preempt mod_unload modversions aarch64”, so how “5.10.9v” will match, as you suggested?
I hacked .ko binary file by inserting missing strings in vermagic but still getting these errors when trying to load module using insmod and modprobe. In another attempt I modified top level Makefile to include 5.10.9-1.0.0+g32513c25d8c7 and vermagic showed that string (when running modinfo on module) after build, but still getting the same errors.
4. Where I can download kernel source “5.10.9-1.0.0+g32513c25d8c7“ from?