insmod: Invalid module format error


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers insmod: Invalid module format error
# 1  
Old 02-02-2012
insmod: Invalid module format error

I have open suse kernel kernel 3.1.0-1.2-desktop on which I used kernel source 3.1.10-1.2 downloaded from kernel.org.

The module gets built.
While loading a kernel module I am getting Invalid module format error with description "first_driver: no symbol version for module_layout"

The following are the logs:
Code:
linux-k2kj:/home/rkpsuse/FirstDriver # insmod first_driver.ko 
insmod: error inserting 'first_driver.ko': -1 Invalid module format

linux-k2kj:/home/rkpsuse/FirstDriver # modinfo first_driver.ko 
filename:       first_driver.ko
description:    My First Driver
author:         Emertxe Info. Tech
license:        GPL
srcversion:     C4CCFC5DA59927FA4A479E6
depends:        
vermagic:       3.1.10-1.2-desktop SMP preempt mod_unload modversions 686 

linux-k2kj:/home/rkpsuse/FirstDriver # uname -r
3.1.0-1.2-desktop

dmesg
first_driver: no symbol version for module_layout

I guess this is because of mismatching kernel versions.

Cannot I use kernel source 3.1.10-1.2-desktop on kernel 3.1.0-1.2-desktop?
Where can I get the kernel source for 3.1.0-1.2-desktop

How to resolve this issue?
# 2  
Old 02-02-2012
You should be using suse's kernel source, not kernel.org's kernel source. They probably have their own patches and changes which make building your own drivers from a custom kernel and having them work with your existing one difficult.
This User Gave Thanks to Corona688 For This Post:
# 3  
Old 02-02-2012
Thanks Coronna for the reply.
Where can I find the suse kernel source?

Are the sites:
kernel-source-3.1.0-1.2.1.noarch.rpm openSUSE 12.1 Free Download

or

RPM resource kernel-source

fine to download the suse kernel source?
# 4  
Old 02-02-2012
I'd be shocked if SUSE didn't have a way to download packages itself, instead of forcing you to install random RPM's trawled manually from the internet in the hope they're the "right" ones.
# 5  
Old 02-03-2012
I have linux installed in vmware which is not connected to net and so I have to manually download the source.

---------- Post updated 02-03-12 at 01:03 PM ---------- Previous update was 02-02-12 at 08:56 PM ----------

Now I have open suse kernel kernel 3.1.0-1.2-desktop and its kernel source.

Again the module gets built.
While loading a kernel module I am getting Invalid module format error with description "first_driver: no symbol version for module_layout"

The following are the logs:
Code:
linux-k2kj:/home/rkpsuse/Emertxe/CourseTemplates/FirstDriver # insmod first_driver.ko 
insmod: error inserting 'first_driver.ko': -1 Invalid module format

linux-k2kj:/home/rkpsuse/Emertxe/CourseTemplates/FirstDriver # modinfo first_driver.ko 
filename:       first_driver.ko
description:    My First Driver
author:         Emertxe Info. Tech
license:        GPL
srcversion:     C4CCFC5DA59927FA4A479E6
depends:        
vermagic:       3.1.0-1.2-desktop SMP preempt mod_unload modversions 686 

linux-k2kj:/home/rkpsuse/Emertxe/CourseTemplates/FirstDriver # dmesg | tail
[ 8797.391736] first_driver: no symbol version for module_layout

linux-k2kj:/home/rkpsuse/Emertxe/CourseTemplates/FirstDriver # uname -r
3.1.0-1.2-desktop

FYI I have compiled the kernel as follows:
Make mrprpoper
make menuconfig
Make
Make modules
Make modules_install
Make install

Am I missing something?
How to resolve this issue?
# 6  
Old 02-03-2012
Did you build your new kernel starting with the same options your original kernel was built with? They may be available in /proc/config.gz. They may also be stored under /boot somewhere, as config-kernelname. Kernel settings can drastically alter the way the kernel works so, if you don't build the kernel with the right options, the module won't match the kernel, and the kernel will rightly refuse to load it.

Code:
modprobe config # might not be necessary
gunzip < /proc/config.gz > .config
make menuconfig

This User Gave Thanks to Corona688 For This Post:
 
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. IP Networking

Insmod custom module fails with message : disagrees about version of symbol ...

Hello : I want to make a netfilter conntrack module for myself. So I copy all the source code about netfilter conntrack from kernel source tree to my external directory. It can be insmod after compiled. Then I add some members to the struct nf_conn, and it 's compiled successfully. However, it... (1 Reply)
Discussion started by: 915086731
1 Replies

2. Ubuntu

Monitor issues Invalid Format

Hello Folks, Monitor took a crap on me so I bought a new flat screen. Im running Ubuntu 12 recieving an invalid format after the GUI login screen. How do I go about trying to change the resolution. FYI old monitor blew smoke so reconnecting it is not an option. From I understand their is no... (3 Replies)
Discussion started by: Fingerz
3 Replies

3. Shell Programming and Scripting

perl module to convert xlsx format to xls format

Hi Folks, I have written a perl script that reads data from excel sheet(.xls) using Spreadsheet::ParseExcel module. But the problem is this module doesn't work for excel sheets with extension .xlsx. I have gone through Spreadsheet::XLSX module with which we can read from .xlsx file directly.... (1 Reply)
Discussion started by: giridhar276
1 Replies

4. UNIX for Dummies Questions & Answers

insmod error: disagrees about version of symbol module_layout

When I try to insert a simple kernel module I get the following error > insmod: error inserting 'test.ko': -1 Invalid module format > in dmesg I see: disagrees about version of symbol module_layout I have following kernel which I downloaded using apt-get: uname -r 2.6.32-24-generic ... (0 Replies)
Discussion started by: rupeshkp728
0 Replies

5. Web Development

Invalid command 'Order', perhaps misspelled or defined by a module not included in the server config

I have Apache v2.0.63 on Solaris 10 (x86 on VM). While starting the apache server, facing the following exception - Invalid command 'Order', perhaps misspelled or defined by a module not included in the server configuration Googling says to add the entry LoadModule authz_host_module... (0 Replies)
Discussion started by: poga
0 Replies

6. AIX

module has an invalid magic number

Hello everybody: I have a trouble running an application which connects to an Oracle server, I got this message: Dependent module /opt/oracle/product/10.2/lib/libclntsh.so could not be loaded. The module has an invalid magic number. Running ldd MyApp doesn't report missing symbols, I've... (1 Reply)
Discussion started by: edgarvm
1 Replies

7. UNIX for Dummies Questions & Answers

insmod error - no such device

Hi Everyone, I am relatively new to Linux. After about three months of trying to compile a driver for a ESDCAN card, I finally found a version and kernel that worked. I am running Slackware V12.0 with kernel version 2.6.24.5-smp. When I use insmod to insert the driver file (esdcan-pci331.ko),... (1 Reply)
Discussion started by: Brian-UOIT
1 Replies

8. Programming

Much time in insmod of huge kernel module

I'm using Linux-2.6.14. My application is having one kernel module of large size(approx 8MB), insmoding of that kernel module is taking pretty much time(approx 8Mins). Is there a way to reduce the insmod time? I tried even by modprobe also. (0 Replies)
Discussion started by: ptprabu
0 Replies

9. IP Networking

insmod: a module named e1000 already exists

Hi I'm trying to change the configuration of the adapter, especially values revelant with Tx and Rx. Following appropiate manual i tried insmod command , but as a result i've got: insmod: a module named e1000 already exists Does anyone know the solution? (0 Replies)
Discussion started by: admart
0 Replies
Login or Register to Ask a Question