how to compile a module with a newer version of the linux kernel?
Hi,
I am trying to write a custom module. The Linux kernel version is 2.6.6-1.435. For some reason, the source code version installed in my notebook was 2.6.5-1.358. Although I could compile my module, I could not loaded using insmod due to an error with VERMAGIC.
I decided to download the version which corresponds to the installed kernel version. After downloading the source code, I did:
root% rpm -Uvh kernel-sourcecode-2.6.6-1.435.2.3.noarch.rpm
The problem now is that the module does not compile. These are some of the errors I get:
------
[root@phy2-dhcp230 new]# make -C /usr/src/linux-2.6.6-1.435.2.3/ SUBDIRS=$PWD modules
make: Entering directory `/usr/src/linux-2.6.6-1.435.2.3'
Makefile:434: .config: No such file or directory
CC [M] /home/fvarela/bu/linux/drivers/v26/new/newkhello.o
In file included from include/linux/module.h:9,
from /home/fvarela/bu/linux/drivers/v26/new/newkhello.c:1:
include/linux/config.h:4:28: linux/autoconf.h: No such file or directory
In file included from include/linux/module.h:10,
from /home/fvarela/bu/linux/drivers/v26/new/newkhello.c:1:
include/linux/sched.h:4:37: asm/param.h: No such file or directory
In file included from include/linux/types.h:13,
from include/linux/capability.h:16,
from include/linux/sched.h:7,
from include/linux/module.h:10,
from /home/fvarela/bu/linux/drivers/v26/new/newkhello.c:1:
include/linux/posix_types.h:47:29: asm/posix_types.h: No such file or directory
In file included from include/linux/capability.h:16,
from include/linux/sched.h:7,
from include/linux/module.h:10,
from /home/fvarela/bu/linux/drivers/v26/new/newkhello.c:1:
include/linux/types.h:14:23: asm/types.h: No such file or directory
In file included from include/linux/capability.h:16,
from include/linux/sched.h:7,
------
I guess this has something to do with the installation of the new source code, and maybe in particular, with the #include sentences that I use that maybe are still pointing to the old source:
#include <linux/module.h>
#include <linux/config.h>
#include <linux/init.h>
1.- What else do I need to do in order to compile my module with the newer version of the kernel source?
2.- Will I gain anything if I compile the new version of the kernel?
Thanx,
F.
|