# [Closed: Module versioning] insmod: Invalid module format

## TJNII

My kernel is adamantly refusing to insmod my modules.  I haven't rebooted this system (This system needs high uptime, that is a last resort) but that is the only option I can think of at this point.  I have recompiled the kernel (make clean && make) and reinstalled the modules (make modules_install).  Am I missing something obvious here?

```
TJNIILB linux # file /lib/modules/2.6.36-gentoo-r8/kernel/drivers/usb/serial/usbserial.ko

/lib/modules/2.6.36-gentoo-r8/kernel/drivers/usb/serial/usbserial.ko: ELF 64-bit LSB relocatable, IA-64, version 1 (SYSV), not stri

pped

TJNIILB linux # insmod /lib/modules/2.6.36-gentoo-r8/kernel/drivers/usb/serial/usbserial.ko

insmod: error inserting '/lib/modules/2.6.36-gentoo-r8/kernel/drivers/usb/serial/usbserial.ko': -1 Invalid module format

TJNIILB linux # ls -l ../

total 3

lrwxrwxrwx  1 root root   22 Apr 25 23:06 linux -> linux-2.6.36-gentoo-r8

drwxr-xr-x 24 root root 1680 Feb  8 19:09 linux-2.6.31-gentoo-r7

drwxr-xr-x 24 root root 1616 May 16 16:22 linux-2.6.36-gentoo-r8

drwxr-xr-x  7 root root  168 Aug 11  2010 rpm

TJNIILB linux # uname -a

Linux TJNIILB 2.6.36-gentoo-r8 #5 SMP Wed May 4 08:21:03 MDT 2011 ia64 31 GenuineIntel GNU/Linux

TJNIILB linux #

```

----------

## genterminl

The error is some mismatch between the running kernel and the compiled module, so recompiling the kernel shouldn't matter.  Did you make any (significant?) changes to the kernel configuration since your last reboot?

Do you have any running modules? (lsmod)  Can you insmod or modprobe any other modules?

Note the insmod man page says "Only the most general of error messages are reported: as the work of trying to link the module is now done inside the kernel, the dmesg usually gives more information about errors."  Is there anything relevant in dmesg or /var/log/messages?

----------

## TJNII

No, no major changes.  I'll double check by diffing /proc.config.gz against .config, but it should be exactly the same.  In fact the modules built with this kernel binary failed this way.  My current theory is that I turned on module versioning as it seemed like a good idea, but I think that has blown up on me.  Dmesg isn't saying anything when I try and ismod.  I haven't tried modules other than usbserial and the FTDI module.  I haven't tried unloading and reloading any of the modules loaded at boot, as that has the potential to bring this box to its knees.

Just to make sure I haven't missed a memo, we're still supposed to build the 2.6 kernels by issuing only "make" and then "make modules_install" yes?  (This is obviously with a proper .config and doesn't include copying the kernel image to to /boot or the bootloader)

----------

## Jaglover

Yes, I think there is also make modules target after you add a module in config.

----------

## TJNII

All right, thanks.  I just wanted to make sure I wasn't doing something stupid.

I VPNed into the box and rechecked my dmesg.  There is damning evidence I missed this afternoon:

```
usbserial: disagrees about version of symbol module_layout

ftdi_sio: disagrees about version of symbol module_layout

usbserial: disagrees about version of symbol module_layout

ftdi_sio: disagrees about version of symbol module_layout

usbserial: disagrees about version of symbol module_layout

ftdi_sio: disagrees about version of symbol module_layout

usbserial: disagrees about version of symbol module_layout

```

(Must have had a overzealous grep or something.  Anyways...)

So the needle is pointing at module versioning.

Not much I can do about that now, I'll have to compile it out the next time I can schedule downtime.

----------

## Jaglover

Did you try forcing module loading?

----------

## TJNII

 *Jaglover wrote:*   

> Did you try forcing module loading?

 

No, but not because I didn't think of it.  I added support for forced module unloading, but not forced module loading.

Another setting I'll toggle on the next round of kernels.

----------

