[OpenAFS] openafs kernel module on Fedora Core 6 [Load Failure]

Marcus Watts mdw@umich.edu
Tue, 23 Jan 2007 05:52:35 -0500


"Anirbid Banerjee" <anirbid.banerjee@gmail.com> writes:
...
> I have installed Fedora Core 6.0 (2.6.18-1.2798.fc6 #1 SMP i686 i686
> i386 GNU/Linux) on my system. I installed the kernel source from
> kernel-devel-2.6.18-1.2798.fc6.i686.rpm.I tried getting an appropriate
> AFS client for this system. Unfortunately I could not find any, so I
> started building one myself.
> 
> Except for commenting out a few of these lines #include <linux/config.h>
> in the openafs-1.4.2 source tree, (I learnt that
> /include/linux/config.h is officially removed from source trees higher
> than 2.6.18) I didnt make any significant changes. The package builds
> fine alongwith the kernel module, but I cannot modprobe the module
> into the kernel.
> 
> This is what it says:
> $ modprobe libafs
> 
> FATAL: Error inserting libafs
> (/lib/modules/2.6.18-1.2798.fc6/kernel/fs/openafs/libafs.ko): Invalid
> module format
> 
> $dmesg | tail -1
> libafs: version magic '2.6.18-1.2798.fc6 SMP mod_unload 686 REGPARM
> 4KSTACKS gcc-4.1' should be '2.6.18-1.2798.fc6 SMP mod_unload 586
> REGPARM 4KSTACKS gcc-4.1'
> 
> I am not getting any idea how to tackle this problem. Please suggest.
...

Judging by that string, the kernel you are running was compiled with a
slightly different configuration which might be nothing more than
different compiler options.
586 != 686
Perhaps you can find and use a kernel-devel-2.6.18-1.2798.fc6.i586.rpm
Or perhaps you install and use a "kernel-2.6.18-1.2798.fc6.i686.rpm",
if such a thing exists.  Otherwise you're going to have to modify
something to match compiler options between what you build and what
you're running, either in the configured kernel build tree, or in the
openafs build process.

For the openafs end, it looks like in vanilla openafs builds,
	src/cf/linux-test5.m4
contains a logic to set P5PLUS_KOPTS to something that might
contain -march=pentium .  I'm not positive that's your problem,
since the dmesg output suggests that your libafs is 686 & your
linux is 586.  Maybe the error message is inverted.  If you experiment
with changing this, be sure to run "regen.sh" and "make distclean"
on the result before attempting to build libafs.  With any luck,
future versions of openafs will have logic to set "LINUX_KCC"
and "LINUX_KCFLAGS" from 2.6 makefile magic, at which point your
problem might go away, assuming that this is your problem.

>From the linux end, look in the first 100 lines of .config for
CONFIG_M686 CONFIG_M586 etc.  You'll have to decide how you want
to manage changing this.
You might also want to experiment with
CONFIG_MODULE_SRCVERSION_ALL CONFIG_MODVERSIONS

If you want to play fast & dirty, you could try using "bvi" on your
built module, find "SMP mod_unload"...  and change 586 to 686
(or visa-versa).  This would be wrong however, and won't work at all
if you really do have a pentium I processor.  It might get you something
that works however.

					-Marcus Watts