I have the following bare-bones kernel module...
------------------------------------------------------ #ifndef __KERNEL__ #define __KERNEL__ #define MODULE #include
int init_module(void) { printk("Hello, World\n"); return 0; }
void cleanup_module(void) { printk("I'm outta here...\n"); }
#endif
------------------------------------------------------
I compile with...
[blah@localhost blah] gcc -O2 -Wall -D__KERNEL__ -DMODULE-I/usr/src/linux/include/ -c blah.c
So far no problems. I should point out that this module is intended for another system, and the sources at /usr/src/linux match that of the target. When I move blah.o to the other system, I get this...
bash-2.05# /sbin/insmod blah.o blah.o: couldn't find the kernel version the module was compiled for
Sure... let's try that again...
bash-2.05# /sbin/insmod -f blah.o blah.o: couldn't find the kernel version the module was compiled for
Could someone shed some light?? TIA