Bug 20070

Summary: Incorrect /usr/include/linux/version.h
Product: [Retired] Red Hat Linux Reporter: jgregor
Component: kernelAssignee: Michael K. Johnson <johnsonm>
Status: CLOSED NOTABUG QA Contact: Brock Organ <borgan>
Severity: medium Docs Contact:
Priority: high    
Version: 7.0CC: arjan
Target Milestone: ---   
Target Release: ---   
Hardware: i686   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2000-10-31 07:35:29 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description jgregor 2000-10-31 01:06:01 UTC
I need to compile and install a linux module. I can compile a module, but
when I use insmod to install it, I get the following error message:

root@joshua simple]# insmod hello.o
hello.o: kernel-module version mismatch
	hello.o was compiled for kernel version 2.4.0-0.26
	while this kernel is version 2.2.16-22.

I see that version.h (there are more) is not the same as the compiled
kernel:
[root@joshua simple]# uname -a
Linux joshua 2.2.16-22 #1 Tue Aug 22 16:49:06 EDT 2000 i686 unknown

This is not a problem with Redhat 6.2, just with 7.0

Comment 1 Arjan van de Ven 2000-10-31 07:35:27 UTC
This is 100% correct behavior. /usr/include/linux contains the glibc headers,
not the kernel headers. You must pass -I/usr/src/linux/include to the kgcc line
with witch you compile your module. (-O2 -D__KERNEL__ are also needed of
course). That this worked for Red Hat 6.2 is pure coincidence (well, almost :) 
because the kernel and glibc headers matched there.