LinuxQuestions.org
Visit the LQ Articles and Editorials section
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices

Reply
 
Search this Thread
Old 07-29-2003, 04:26 PM   #1
mvega
LQ Newbie
 
Registered: Jul 2003
Posts: 5

Rep: Reputation: 0
Question Compiling a kernel module results in "insmod" version


Hi

While I can compile and create a kernel loadable module
as shown below, I get a kernel version mismatch in the
final result as indicated by the insmod command. Can
someone look at the steps below and tell me where I can
reconcile this difference.

Thank You...

#####################################
# Phase 1: Preparing the kernel source files
# from my installation CD...
#####################################
root# rpm -iv kernel-source-2.4.18-14.i386.rpm
root# rpm -iv glibc-kernheaders-2.4-7.20.i386.rpm
root# cd /usr/src/linux-2.4
root# make menuconfig
(Comparing the Qlogic instructions on what to do
here to what came up, it turns out that
I did not have to modify anything here).
root# make dep
#####################################

#####################################
# Phase 2: Preparing the Qlogic source structure
# (i.e. this is the kernel module Im creating to
# drive a Qlogic qla2200 HBA).
######################################

root# mkdir -p /qla2x00
root# cd /qla2x00 (I then copied the source tarball (qla2x00-v6.04.00-dist.tgz) to this directory)
root# tar -xvzf qla2x00-v6.04.00-dist.tgz
root# cd qlogic (the above tar command created this new directory to cd into).
root# ./drvrsetup (i.e. /qla2200/qlogic/drvrsetup --
all this did was untar more source files into the current
directory, /qla2x00/qlogic)

root# pwd
/qla2x00/qlogic

root# make all SMP=1 OSVER=linux-2.4
cc -D__KERNEL__ -DMODULE -Wall -O -g -DUDEBUG -DLINUX -Dlinux -DINTAPI -DEXPORT_SYMTAB -DMODVERSIONS -include /usr/src/linux-2.4/include/linux/modversions.h -I/usr/src/linux-2.4/include -I/usr/src/linux-2.4/include/../drivers/scsi -falign-functions=2 -falign-jumps=2 -falign-loops=2 -Wall -Wstrict-prototypes -fomit-frame-pointer -fno-strength-reduce -pipe -DCONFIG_X86_LOCAL_APIC -fno-strict-aliasing -fno-common -mpreferred-stack-boundary=2 -march=i686 -D__SMP__ -DCONFIG_SMP -c qla2200.c -o qla2200.o
cc -D__KERNEL__ -DMODULE -Wall -O -g -DUDEBUG -DLINUX -Dlinux -DINTAPI -DEXPORT_SYMTAB -DMODVERSIONS -include /usr/src/linux-2.4/include/linux/modversions.h -I/usr/src/linux-2.4/include -I/usr/src/linux-2.4/include/../drivers/scsi -falign-functions=2 -falign-jumps=2 -falign-loops=2 -Wall -Wstrict-prototypes -fomit-frame-pointer -fno-strength-reduce -pipe -DCONFIG_X86_LOCAL_APIC -fno-strict-aliasing -fno-common -mpreferred-stack-boundary=2 -march=i686 -D__SMP__ -DCONFIG_SMP -c qla2300.c -o qla2300.o

roo# ls -la *.o
-rw-r--r-- 1 root root 622316 Jul 29 17:08 qla2200.o
-rw-r--r-- 1 root root 640068 Jul 29 17:08 qla2300.o

==================================================
Finally here is the problem (I could use the -f option to insmod,
but am not sure what consequence it will have later):
==================================================

root# insmod /qla2x00/qlogic/qla2200.o
/qla2x00/qlogic/qla2200.o: kernel-module version mismatch
/qla2x00/qlogic/qla2200.o was compiled for kernel version 2.4.18-14custom
while this kernel is version 2.4.18-14smp.

How can I get these versions to match up??? In the end, I guess I
need the qla2200.o version to be version 2.4.18-14smp.

Thanks In Advance,
Milton
 
Old 07-29-2003, 05:36 PM   #2
finegan
Guru
 
Registered: Aug 2001
Location: Dublin, Ireland
Distribution: Slackware
Posts: 5,700

Rep: Reputation: 57
If I'm remembering right, its getting its versioning info from the file:

/usr/src/linux/include/linux/version.h or modversion.h

Which you can edit to be what matches uname -r. Lemme guess, Mandrake? They assume if you want the kernel source for your kernel you're going to be compiling a custom kernel and ignore the fact that you may just be needing an out of kernel driver...

btw, you can probably get the kid to load with:

insmod -f qla2000.o

That'll force load over the silly mismatch.

Cheers,

Finegan
 
Old 07-30-2003, 09:03 AM   #3
mvega
LQ Newbie
 
Registered: Jul 2003
Posts: 5

Original Poster
Rep: Reputation: 0
Fabu... Finegan. The was exactly what I needed.
And it was "/usr/src/linux-2.4/include/linux/version.h".
BTW... RedHat

Thing are always simple when the right people get
involved.

Best Regards,
Milton
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
"Successful install" results in "Boot device not found" slackr007 Fedora 2 06-21-2005 04:05 PM
"Successful install" results in "Boot device not found" slackr007 Linux - Newbie 2 05-31-2005 08:02 PM
httpd: module "mod_perl.c" is not compatible with this version of Apache davidlarsen Linux - Software 2 08-25-2004 07:57 AM
kernel 2.6.0 debian "No module symbols loaded - kernel modules not enabled." toovato Linux - General 2 01-07-2004 07:56 PM
About "make install" and "insmod" captainstorm Linux - Newbie 3 07-14-2003 11:58 AM


All times are GMT -5. The time now is 07:41 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration