Discussion:
insmod error
(too old to reply)
Michael Lodman
2003-12-16 17:43:47 UTC
Permalink
I need help with an insmod of a driver in Mandrake 9.2:

I get the following error:

driver.o: kernel-module version mismatch
driver.o was compiled for kernel version 2.4.22
while this kernel is version 2.4.22-10mdk.

What is going on and how do I correct this?
Dan Anderson
2003-12-16 19:07:47 UTC
Permalink
Post by Michael Lodman
driver.o: kernel-module version mismatch
driver.o was compiled for kernel version 2.4.22
while this kernel is version 2.4.22-10mdk.
What is going on and how do I correct this?
Try compiling a 2.4.22 kernel for your machine, install it as MyKernel
under LILO, and insmod into that. 2.4.22 != 2.4.22-10mdk.

-Dan
Robert Hallgren
2003-12-16 21:00:05 UTC
Permalink
On Tue, 16 Dec 2003 17:43:47 GMT,
Post by Michael Lodman
driver.o: kernel-module version mismatch
driver.o was compiled for kernel version 2.4.22
while this kernel is version 2.4.22-10mdk.
What is going on and how do I correct this?
Try using the insmod -f flag.

If you compile this module yourself, against kernel 2.4.22 source
you should have a look in the kernel source top Makefile. It might
contain something like this:

EXTRAVERSION = -10mdk

Try changing this to just plain:

EXTRAVERSION =

You might need to reconfigure your kernel source after this change



BR/ Robert
Michael Lodman
2003-12-16 21:01:56 UTC
Permalink
Post by Robert Hallgren
On Tue, 16 Dec 2003 17:43:47 GMT,
Post by Michael Lodman
driver.o: kernel-module version mismatch
driver.o was compiled for kernel version 2.4.22
while this kernel is version 2.4.22-10mdk.
What is going on and how do I correct this?
Try using the insmod -f flag.
If you compile this module yourself, against kernel 2.4.22 source
you should have a look in the kernel source top Makefile. It might
EXTRAVERSION = -10mdk
EXTRAVERSION =
You might need to reconfigure your kernel source after this change
Why would Mandrake ship the product with this problem?
Dan Anderson
2003-12-16 21:23:36 UTC
Permalink
Post by Michael Lodman
Post by Robert Hallgren
On Tue, 16 Dec 2003 17:43:47 GMT,
Post by Michael Lodman
driver.o: kernel-module version mismatch
driver.o was compiled for kernel version 2.4.22
while this kernel is version 2.4.22-10mdk.
What is going on and how do I correct this?
Try using the insmod -f flag.
If you compile this module yourself, against kernel 2.4.22 source
you should have a look in the kernel source top Makefile. It might
EXTRAVERSION = -10mdk
EXTRAVERSION =
You might need to reconfigure your kernel source after this change
Why would Mandrake ship the product with this problem?
If you're compiling the kernel module yourself then,
technically speaking, Mandrake didn't ship the product with this
problem. Remember to install the *mandrake* kernel sources. I would
be you're probably making a mistakes and not getting something right.

Mandrake did, FWIW, ship 9.2 early because everyone wanted
things from the RC badly (and plus they're not exactly in a great
financial situation), so if you run Mandrake Update on a fresh 9.2
distribution you'll find a hundred patches or something similarly
obscene.

-Dan
Dave Lister
2003-12-16 21:36:05 UTC
Permalink
Post by Dan Anderson
Post by Michael Lodman
Post by Robert Hallgren
On Tue, 16 Dec 2003 17:43:47 GMT,
Post by Michael Lodman
driver.o: kernel-module version mismatch
driver.o was compiled for kernel version 2.4.22
while this kernel is version 2.4.22-10mdk.
What is going on and how do I correct this?
Try using the insmod -f flag.
If you compile this module yourself, against kernel 2.4.22 source
you should have a look in the kernel source top Makefile. It might
EXTRAVERSION = -10mdk
EXTRAVERSION =
You might need to reconfigure your kernel source after this change
Why would Mandrake ship the product with this problem?
If you're compiling the kernel module yourself then,
technically speaking, Mandrake didn't ship the product with this
problem. Remember to install the *mandrake* kernel sources. I would
be you're probably making a mistakes and not getting something right.
Mandrake did, FWIW, ship 9.2 early because everyone wanted
things from the RC badly (and plus they're not exactly in a great
financial situation), so if you run Mandrake Update on a fresh 9.2
distribution you'll find a hundred patches or something similarly
obscene.
I didn't recompile the kernel module. This is a straight load of 9.2, and
then compiling the little driver. Whatever errors exist are in the
distribution. I will try the update and see if that helps.
--
Un-elect Dubya in 2004
Michael Lodman
2003-12-16 21:37:52 UTC
Permalink
Post by Dan Anderson
Post by Michael Lodman
Post by Robert Hallgren
On Tue, 16 Dec 2003 17:43:47 GMT,
Post by Michael Lodman
driver.o: kernel-module version mismatch
driver.o was compiled for kernel version 2.4.22
while this kernel is version 2.4.22-10mdk.
What is going on and how do I correct this?
Try using the insmod -f flag.
If you compile this module yourself, against kernel 2.4.22 source
you should have a look in the kernel source top Makefile. It might
EXTRAVERSION = -10mdk
EXTRAVERSION =
You might need to reconfigure your kernel source after this change
Why would Mandrake ship the product with this problem?
If you're compiling the kernel module yourself then,
technically speaking, Mandrake didn't ship the product with this
problem. Remember to install the *mandrake* kernel sources. I would
be you're probably making a mistakes and not getting something right.
Mandrake did, FWIW, ship 9.2 early because everyone wanted
things from the RC badly (and plus they're not exactly in a great
financial situation), so if you run Mandrake Update on a fresh 9.2
distribution you'll find a hundred patches or something similarly
obscene.
I didn't recompile the kernel module. This is a straight load of 9.2, and
then compiling the little driver. Whatever errors exist are in the
distribution. I will try the update and see if that helps.
blah
2003-12-18 22:00:56 UTC
Permalink
On Tue, 16 Dec 2003 17:43:47 GMT, Michael Lodman
Post by Michael Lodman
driver.o: kernel-module version mismatch
driver.o was compiled for kernel version 2.4.22
while this kernel is version 2.4.22-10mdk.
What is going on and how do I correct this?
All distributions(well I can't say all, at least the ones that I have
used) ship with the kernel configured to only load modules compiled at
the same time as that kernel. If you want to have no problems
recompile the kernel. I can't remember the exact wording but it's one
of the first options when you do a make config/menuconfig/xconfig.
Ravi
2003-12-26 23:03:52 UTC
Permalink
Post by blah
On Tue, 16 Dec 2003 17:43:47 GMT, Michael Lodman
Post by Michael Lodman
driver.o: kernel-module version mismatch
driver.o was compiled for kernel version 2.4.22
while this kernel is version 2.4.22-10mdk.
What is going on and how do I correct this?
All distributions(well I can't say all, at least the ones that I have
used) ship with the kernel configured to only load modules compiled at
the same time as that kernel. If you want to have no problems
recompile the kernel. I can't remember the exact wording but it's one
of the first options when you do a make config/menuconfig/xconfig.
hi all,
I also have the same kind of problem, but I am using RedHat 9.0 and
kernel is 2.4.20-8, I get error message saying

module is compiled for 2.4.20 and your kernel is 2.4.20-8. If i
recompile the
kernel how can I specify the new kernel in GRUB. And is there any
other way to solve this problem instead of recompiling it.

I have tried specifing -I option with path in gcc while compiling
module.

Thank you,
Ravi
Ross Axe
2003-12-27 16:00:52 UTC
Permalink
Post by Ravi
Post by blah
On Tue, 16 Dec 2003 17:43:47 GMT, Michael Lodman
Post by Michael Lodman
driver.o: kernel-module version mismatch
driver.o was compiled for kernel version 2.4.22
while this kernel is version 2.4.22-10mdk.
What is going on and how do I correct this?
All distributions(well I can't say all, at least the ones that I have
used) ship with the kernel configured to only load modules compiled at
the same time as that kernel. If you want to have no problems
recompile the kernel. I can't remember the exact wording but it's one
of the first options when you do a make config/menuconfig/xconfig.
hi all,
I also have the same kind of problem, but I am using RedHat 9.0 and
kernel is 2.4.20-8, I get error message saying
module is compiled for 2.4.20 and your kernel is 2.4.20-8. If i
recompile the
kernel how can I specify the new kernel in GRUB. And is there any
other way to solve this problem instead of recompiling it.
I have tried specifing -I option with path in gcc while compiling
module.
Thank you,
Ravi
I have only limited Mandrake experience (and *no* RH) but it looks like
your modules were compiled for a vanilla kernel but you're both using
MDK/RH specific kernels (specifically, the EXTRAVERSION variable has
been bet in the kernels makefile). I guess you could try getting any
updates that are available for the modules on the MDK/RH sites, making
sure the update matches your kernel. Otherwise, compile a kernel, it's
not hard.

cd /usr/src/linux-2.4.18(or whatever)
make oldconfig
make dep
make install modules modules_install

Then you just reboot and you're done. If you want to reconfigure
anything in the kernel, them use `make menuconfig' instead of `make
oldconfig'. Also, note that the `make dep' stage only needs to be done
when you compile a kernel for the first time, or after an upgrade or patch.

HTH,
Ross
mayur24
2004-01-05 09:45:23 UTC
Permalink
Post by Ross Axe
Post by Ravi
Post by blah
On Tue, 16 Dec 2003 17:43:47 GMT, Michael Lodman
Post by Michael Lodman
driver.o: kernel-module version mismatch
driver.o was compiled for kernel version 2.4.22
while this kernel is version 2.4.22-10mdk.
What is going on and how do I correct this?
All distributions(well I can't say all, at least the ones that I have
used) ship with the kernel configured to only load modules compiled at
the same time as that kernel. If you want to have no problems
recompile the kernel. I can't remember the exact wording but it's one
of the first options when you do a make config/menuconfig/xconfig.
hi all,
I also have the same kind of problem, but I am using RedHat 9.0 and
kernel is 2.4.20-8, I get error message saying
module is compiled for 2.4.20 and your kernel is 2.4.20-8. If i
recompile the
kernel how can I specify the new kernel in GRUB. And is there any
other way to solve this problem instead of recompiling it.
I have tried specifing -I option with path in gcc while compiling
module.
Thank you,
Ravi
I have only limited Mandrake experience (and *no* RH) but it looks like
your modules were compiled for a vanilla kernel but you're both using
MDK/RH specific kernels (specifically, the EXTRAVERSION variable has
been bet in the kernels makefile). I guess you could try getting any
updates that are available for the modules on the MDK/RH sites, making
sure the update matches your kernel. Otherwise, compile a kernel, it's
not hard.
cd /usr/src/linux-2.4.18(or whatever)
make oldconfig
make dep
make install modules modules_install
Then you just reboot and you're done. If you want to reconfigure
anything in the kernel, them use `make menuconfig' instead of `make
oldconfig'. Also, note that the `make dep' stage only needs to be done
when you compile a kernel for the first time, or after an upgrade or patch.
HTH,
Ross
This should work on any distro
gcc -O2 -DMODULE -D__KERNEL__ -isystem /lib/modules/`uname -r`/build/include
-W -Wall -c <module_name.c>
bye,mayur.

Loading...