How do you compile a module for another kernel version than the one running???

How do you compile a module for another kernel version than the one running???

Post by Fredric Moreniu » Tue, 17 Jul 2001 21:14:40



I am trying to compile a module for kernel version 2.2.17, but the machine
I do the compilation on has a 2.2.14-5.0 source tree. I downloaded the
2.2.17 source tree and compiled with

gcc -O2 -I/usr/src/linux2.2.17/include/ -Wall -DMODULE -D__KERNEL__
-DLINUX -c source.c

where /usr/src/linux2.2.17/ is where I put the source tree and source.c is
the module source file. The above produces a .o file, but when I try to
load it in the 2.2.17 kernel it says that it is complied for the
2.2.14-5.0 kernel.
How should this be done to make it work?

Regards,
Fredric Morenius

 
 
 

1. How do you compile a module for another kernel version than the one running??

I am trying to compile a module for kernel version 2.2.17, but the machine
I do the compilation on has a 2.2.14-5.0 source tree by default. I
downloaded the 2.2.17 source tree and compiled with

gcc -O2 -I/usr/src/linux2.2.17/include/ -Wall -DMODULE -D__KERNEL__
-DLINUX -c source.c

where /usr/src/linux2.2.17/ is where I put the source tree and source.c is
the module source file. The above produces a .o file, but when I try to  
load it in the 2.2.17 kernel it says that it is complied for the
2.2.14-5.0 kernel.
How should this be done to make it work?

Regards,
Fredric Morenius

2. IPCP: timout sending Config-Requests

3. Module Programming: module version vs. kernel version

4. FIREWALL SECURITY HELP

5. Question #2 - Different versions of kernel modules compile using vac

6. HP PCL- Postscript converter

7. couldn't find the kernel version the module was compiled for ?

8. --- for unix gurus------ how to count characters in a file without using wc?

9. How to compile a loadable module for an older kernel version!???

10. insmod: 'couldn't find the kernel version the module was compiled for'

11. Compiling kernel with module version support disabled

12. compiling modules for a different kernel version?

13. Question running C++ compiled application on newer OS version versus on older OS versions of AIX?