On Wed, Mar 14, 2001 at 04:53:10PM -0600, Cory Steers wrote:
I didn't have any version string defined. Here's a snippet of my source code:
#define MODULE #define __KERNEL__
#include
#include #include #include #include #include #include #include However, this Tony's suggestion did prompt me to find some additional information. My /usr/include/linux/version.h contains:
#include
#if defined(__module__smp) #define UTS_RELEASE "2.4.0-0.26smp" #else #define UTS_RELEASE "2.4.0-0.26" #endif #define LINUX_VERSION_CODE 132096 #define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c)) Which seems to be why I'm getting the code compiled for 2.4.0, instead of 2.4.2. Also note that /usr/src/linux-2.4.0/include/linux/version.h contains:
#define UTS_RELEASE "2.4.0" #define LINUX_VERSION_CODE 132096 #define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))
Which is similar, but different to /usr/include/linux/version.h. /usr/src/linux-2.4.2/include/linux/version.h contains:
#define UTS_RELEASE "2.4.2" #define LINUX_VERSION_CODE 132098 #define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))
... which is what I want, I just don't know how to get it. My /usr/src/linux points to /usr/src/linux-2.4.2. Why didn't /usr/include/linux get update? Did I miss a step with my kernel upgrade?
/usr/include/linux is a link and in your case it points to 2.4.0 tree, not 2.4.2. All you need to do is ln -sf /usr/src/linux-..... to point it to the right place. -Kastus
Thanks.
-----Original Message----- From: tony@tcapp.com [mailto:tony@tcapp.com] Sent: Wednesday, March 14, 2001 12:04 PM To: Cory Steers Subject: Re: [SLE] compiles for wrong kernel version
change the version string in the source code to match the kernel you are compiling for. Also try insmod -f module.o
At 08:25 AM 3/14/01 -0600, you wrote:
I've been running 2.4.0 for a few weeks. I recently pulled down 2.4.2, compiled it, and installed it. Things are working fine. However, I was playing around with a kernel module. After I compile the source with gcc, and try to load it up with insmod, I get the following error:
kernel-module version mismatch test.o was compiled for kernel version 2.4.0-0.26 while this kernel is version 2.4.2.
Any ideas on why I'm compiling for kernel version 2.4.0 when I'm running kernel 2.4.2?
Thanks, Cory
-- To unsubscribe send e-mail to suse-linux-e-unsubscribe@suse.com For additional commands send e-mail to suse-linux-e-help@suse.com Also check the FAQ at http://www.suse.com/support/faq