[tulip-bug] tulip.c and pci-scan.c do not insmod after compile

Juhan Ernits juhan@cc.ioc.ee
Wed May 29 16:27:01 2002


On Wed, 29 May 2002, Carsten Cimander wrote:

> I compiled tulip.c using the command:
> # gcc -DMODULE -Wall -Wstrict-prototypes -O6 -c tulip.c
>  => no probs.
> 
> I compiled pci-scan.c using the command:
> # gcc -DMODULE -D__KERNEL__ -DEXPORT_SYMTAB -Wall -Wstrict-prototypes -O6 -c
> tulip.c
>  => no probs.
> 
> But insmod reported an unsuitable kernel???
> # insmod pci-scan.o
> 	pci-scan.o was compiled for kernel version 2.4.7
> 	while this kernel is version 2.4.17

Ensure that you have the appropriate kernel source (2.4.17) unpacked
and configured in /usr/src/linux. In my case I had all these loadable
module parameters enabled:

 [*] Enable loadable module support
 [*] Set version information on all symbols for modules
 [*] Kernel module loader  

Then I built the modules with the following lines:

gcc -DMODULE -D__KERNEL__ \
 -I/usr/include -I/usr/src/linux/include \
 -DMODVERSIONS -include /usr/src/linux/include/linux/modversions.h  \
 -DKBUILD_BASENAME=tulip -o tulip.o -O6 -c tulip.c
gcc -DMODULE -D__KERNEL__ \
 -DMODVERSIONS -include /usr/src/linux/include/linux/modversions.h  \
 -I/usr/src/linux/include -DKBUILD_BASENAME=pci-scan -o pci-scan.o -O6 -c
pci-scan.c


Hope that helps a bit,

Regards,

Juhan Ernits