Hi All,
I am having some issues compiling kernel modules against the pre-built OpenSUSE kernel.
Whenever I compile a module and try to load it, I get something like:
insmod fs/smbfs/smbfs.ko
insmod: error inserting 'fs/smbfs/smbfs.ko': -1 Invalid module format
It doesn’t actually matter what the module is, they all do the same thing. I have tried the above mentioned smbfs, I’ve also tried:
- vmware kernel module
- nVidia
- VirtualBox
However, if I compile the entire kernel (and boot from it), the individual module loads fine.
This behavior is consistent across a significant number of machines and installations (>6). As I recall, when I first started using SuSE at around version 9.2, I could successfully compile modules against the supplied kernel. Somewhere around version 10.x (possibly 10.1) it changed. Similarly, I’ve used RedHat / Fedora / CentOS extensively over the years, and compiling modules always worked on them.
For the past few years I’ve actually been compiling the entire kernel so that I can then compile the individual module. That’s starting to wear a little thin.
NB. When I do make my own kernel, even just doing a make all after a make cloneconfig, the resulting kernel and modules are significantly different in size to the supplied ones. eg:
-rw-r--r-- 1 root root 3.3M Jan 29 01:26 vmlinuz-2.6.31.12-0.1-xen
-rw-r--r-- 1 root root 3.2M Feb 21 12:48 vmlinuz-2.6.31.8-0.2-xen
To me, this seems to indicate that there is something different about how the supplied kernel was built compared to the ones I build locally. I have no idea what though.
I do recall some times when I was using RedHat that I couldn’t compile modules for a specific kernel release. In those cases, the supplied kernel had been compiled with a different version of gcc than was supplied with the distro, so the resulting modules weren’t right for the kernel. Does anyone know what compiler / version is used to build the standard OpenSUSE kernel?
I have following kernel related packages installed:
- kernel-desktop-2.6.31.12-0.1.1.x86_64
- kernel-desktop-devel-2.6.31.12-0.1.1.x86_64
- kernel-default-2.6.31.12-0.1.1.x86_64
- kernel-source-2.6.31.12-0.1.1.noarch
- kernel-xen-devel-2.6.31.12-0.1.1.x86_64
- kernel-xen-2.6.31.12-0.1.1.x86_64
- kernel-default-devel-2.6.31.12-0.1.1.x86_64
- linux-kernel-headers-2.6.31-3.4.noarch
- kernel-debug-devel-2.6.31.12-0.1.1.x86_64
- kernel-syms-2.6.31.12-0.1.1.x86_64
Before trying to compile a module I do:
- make clean
- make cloneconfig
- make prepare
- make modules_prepare
Does anyone have any thoughts on how to successfully compile individual modules without compiling the entire kernel as well?