views:

521

answers:

2

I try to insmod a linux kernel legacy module being ported by me. The following errors appear:

> sudo insmod camac-mx.ko
insmod: error inserting 'camac-mx.ko': -1 Invalid module format
dmesg |tail -n 1
[1312783.938299] camac_mx: disagrees about version of symbol module_layout

How do I fix this?

A: 

This indicates you have compiled the module against a different version of the kernel than is running. Note that even if the running kernel and kernel source have the same numerical value (e.g. both are 2.6.31-20-server), if the two use different configuration options, you may see this error. Also check if there are multiple versions of this module on the machine and ensure you are loading the correct one.

ctuffli
A: 

i encountered the same problem when inserting the module. The module is for the kernel 2.6.33.4 and also the kernel is 2.6.33.4.So i don't know how these two conflits with and the same error " disagrees about version of symbol module_layout " happended. What shall i do? how to solve it? I'm very confused.

cathy
The module compatibilty is determined not by the version string, but by kernel configuration (or symbols table (I don't know)). You should compile your module with the exactly the same configuration of kernel source as one used to compile our running kernel.
Basilevs
BTW, active kernel configuration may be obtained from /proc/config.gz.
Basilevs