I'm using CentOS-6.5 and default kernel is 2.6.32-431.11.2.el6.x86_64. I downloaded 2.6.32 and built that kernel (under /lib/modules/2.6.32).
I wrote a module for simple hello world program. This program is working under below case:
Makefile: /lib/modules/$(shell uname -r)/build (default kernel)
$ sudo insmod hello.ko
$ dmesg
module inserted..
hello world..
My program is not working for below case:
Makefile: /lib/modules/3.2.32/build (newly built kernel)
$ sudo insmod hello.ko
insmod: error inserting 'hello.ko': -1 Invalid module format
dmesg:
hello: disagrees about version of symbol module_layout
I tried modprobe for both cases it is showing below error
FATAL: Module hello not found.
How compile my module with 2.6.32 kernel?