LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 04-18-2003, 01:11 AM   #1
sakeeb
Member
 
Registered: Apr 2002
Posts: 270

Rep: Reputation: 31
kernel version dependancy


when i am trying to install my kernel module it produces the message like

the module is compiled for linux-2.4.3-18 and this kernel is linux-2.4.3-18custom.

i compiled the kernel from the same system with out any warning and errors

how can i overcome this?
 
Old 04-18-2003, 09:49 AM   #2
AltF4
Member
 
Registered: Sep 2002
Location: .at
Distribution: SuSE, Knoppix
Posts: 532

Rep: Reputation: 31
the answer should be in thread:
LinuxQuestions.org Forums > Programming > install my mod
(http://www.linuxquestions.org/questi...threadid=55381)

---------
probably you should compile with

root# gcc -c -I"/lib/modules/`uname -r`/build/include" hello.c

to get correct includes
------------
 
Old 04-20-2003, 10:50 PM   #3
revrendi
LQ Newbie
 
Registered: Mar 2003
Location: California, USA
Distribution: Linux from Scratch
Posts: 9

Rep: Reputation: 0
Guessing this is a Redhat system, not sure if other distros do quite the same thing. When you install the kernel source rpm it puts the source in place with a slightly tweeked Makefile. They tack that 'custom' onto the end of the EXTRAVERSION variable so that if you end up recompiling your kernel and installing it, by default it doesn't overwrite the working kernel you started out with. But it also means that if you've installed a kernel from RPM and kernel source from RPM, and then try to compile a module against the source, you get the error you've described. If that's what's happened to you, there are a couple of ways to go here:

-You can simply remove the 'custom' from the EXTRAVERSION in /usr/src/linux-2.4/Makefile and recompile your module and it'll probably work.
- Or you could compile a new kernel from the source you have and boot it, then load the module. Which isn't a bad idea, cause then you know source, config, and binary are in sync.
- Or you could insmod -f your module, which skips the kernel version check. If you have symbol versioning turned on it may still reject the module. But that means your source and binary kernels really are out of sync, and you have to fix that first.

If you didn't install both kernel and kernel source from RPM, you may be having a different issue. Check to make sure that the Makefile at the top level of your kernel source matches the output from 'uname -r', that seems to be what the module tools are complaining about. -- Rev
 
Old 04-26-2003, 07:10 AM   #4
sakeeb
Member
 
Registered: Apr 2002
Posts: 270

Original Poster
Rep: Reputation: 31
Ok now i understand the problem. The actual problem was i forgot to return 0 at the end of init_module and other problem was with version.h

thanx
 
  


Reply



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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Regarding distribution + kernel version + gcc version + glib version. JCipriani Linux - General 8 04-19-2008 02:54 PM
redhat fedora gcc version (compiled for 2.4.20) doesn't match kernel version 2.4.22 start1000 Linux - Software 0 03-16-2004 08:17 PM
apt - failed dependancy: linux-kernel-headers shack Linux - Software 0 12-19-2003 08:09 AM
Xfree prob radeon.o kernel module version is 1.1.1 but version 1.5.0 or newer needed. jimdaworm Slackware 0 10-01-2003 06:27 PM
Sample Driver Module incompatibility with Kernel version (or gcc version) jvs Linux - General 1 06-07-2002 01:40 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 12:09 AM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration