Linux: kernel vermagic not corresponding

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Linux: kernel vermagic not corresponding

3,215 Views
mirogliopaolo
Contributor II

Dear Sirs,

i tried to compile a customized kernel module for the BSP, but there is something strange: when i try to load module with insmod it says "invalid module format".

I discovered that if i run from arm command 'uname -r' version is as following:

3.0.35-2026-geaaf30e

but if i check on the /lib/modules/ folder ltib generated

3.0.35-2310-gc27cb38

how it is possible? I'm building the module using the properly environment variables and the kernel source used is ./ltib/rpm/BUILD/linux-3.0.35/ so i cannot figure out how it can be...problem is also verified when i try command as following:

root@freescale /lib/modules$ modinfo mymodule.ko

modinfo: can't open '/lib/modules/3.0.35-2026-geaaf30e/modules.dep': No such file or directory

If any idea please let me know, thanks for support!

Best Regards

Miroglio Paolo


Labels (2)
0 Kudos
Reply
3 Replies

1,585 Views
LeonardoSandova
Specialist I

Hi Paolo,

if you recompile the kernel separately (not using LTIB), I believe you get the issue you are observing. You got two options

1. Do all the kernel changes and run just './ltib' (not ./ltib -p kernel -sc*) and use the rootfs and rootfs/boot/uImage

2. Compile your kernel, either manually (makes) or with ltib (as show above) BUT you need to rename /lib/modules based on the uname -a string.

let me know if it works for you.

Leo

0 Kudos
Reply

1,585 Views
mirogliopaolo
Contributor II

Dear Leo,

sorry if i didn't replied anymore, problem was solved days ago.

I thought kernel must be placed in /boot but with my configuration it must be stored before partition by using dd.

Now vermagic works...

0 Kudos
Reply

1,585 Views
mirogliopaolo
Contributor II

Dear Leo,

i'm not compiling the kernel separately but using the ltib built-in kernel 3.0.35.

Problem still persists, even if i rebuilt kernel, lib folder on rootfs is created with a vermagic, while system have another.

Renaming /lib/modules folder is not a solution, because all .ko modules have the wrong vermagic and claims the invalid module format.

I'll continue to investigate...Thank you.

Paolo

0 Kudos
Reply