# Version magic error in my modules or kernel

## sgentry6

usbcore: version magic '2.6.12-gentoo-r6 SMP preempt 586 4KSTACKS gcc-3.3' should be '2.6.12-gentoo-r6 SMP preempt PENTIUM4 4KSTACKS gcc-3.4'

This comes from my dmesg.  I have about 25 lines of this in my dmesg overall.  I have enabled the 4K stack in the kernel hacking section of the kernel config, I have tried building things like this in as modules rather than built in, removing them building a kernel then re-enabling, etc...  The things I have tried thus far though have not allowed me to fix these messages in my dmesg.

Any suggestions?

Thanks.

Forgot to mention, I did upgrade to the new compiler.  I did however follow the full guide and did a full emerge -e system and emerge -e world.

----------

## dgaffuri

You've changed the processor family in kernel config from MPENTIUM4 to M586 (in menu config is under Processor type and features), and modules are compiled with the old compiler. Probably you missed to run make modules_install.

If it's not the case ensure that you're using the new compiler with gcc-config, check processor type and recompile and reinstall kernel and modules. Remember to make clean before.

----------

## sgentry6

.config file

make.conf file

Here are my make.conf files and .config files for my kernel.  I have tried make && make modules_install after doing make clean.  Still getting these messages in my dmesg.

Running gcc-confg -l produces this output

 [1] i686-pc-linux-gnu-3.4.4 *

 [2] i686-pc-linux-gnu-3.4.4-hardened

 [3] i686-pc-linux-gnu-3.4.4-hardenednopie

 [4] i686-pc-linux-gnu-3.4.4-hardenednopiessp

 [5] i686-pc-linux-gnu-3.4.4-hardenednossp

----------

## dgaffuri

For which modules? Post

```
dmesg | grep 'version magic'
```

Probably you still have to rebuild some package after recompiling kernel. Try

```
module-rebuild list
```

to search for them (emerge module-rebuild if you can't find it).

BTW, make.conf have nothing to do with options used to compile kernel, so don't look there.

----------

## sgentry6

Module listing

dmesg | grep 'version magic' | awk -F : '{ print $1 }' >& list

I used this command to get the listing of the modules that have the version magic in the kernel.  If you need any more info let me know.

Running 

module-rebuild list give me

=media-tv/ivtv-0.4.0-r2

=app-misc/lirc-0.7.2

I included my make.conf file in case I mistakenly changed soemthing before I updated the compiler to 3.4.4

Thanks for the help guys.

----------

## dgaffuri

You're definitely doing something wrong while compiling kernel. Please try

```
mv /lib/modules/$(uname -r) /lib/modules/$(uname -r).save

cd /usr/src/linux

cp .config ..

make mrproper

mv ../.config .

make

make modules_install

make install (or manually copy the kernel in /boot, as you're used to)

module-rebuild rebuild
```

After rebooting successfully you may remove the saved modules directory.

----------

## sgentry6

I have a feeling that this is along the lines of what I need to do.  I am not sure what I have done to have those modules affected, I will try this as soon as I get home, and update everyone.

----------

## Cocobo-1

I have the exakt same problem and I have tried make mrproper and removed the /lib/modules stuff. Nothing helped. The modules are being compiled with an other config than the kernel.

----------

## sgentry6

Hope this doesn't double post, I just tried refreshing the page a couple of times, but my post hadn't shown up.

Anyhow.  I followed the instructions provided, and unfortunately those did not work.  I did that a couple of times, the first time simply using the .config file that I had, which didn't fix the issue.  The next time I deleted all .config files in my /usr/src/linux directory, and followed the steps once again.  

Since neither of those options worked I am going to emerge genkernel, and run genkernel all.

If this doesn't solve my problem I am not quite sure where to move onto next.  I guess I could move up to the 2.6.14-r2 or another version of the kernel, but I don't think that will ulitmately solve my problem.

----------

## dgaffuri

 *sgentry6 wrote:*   

> Since neither of those options worked I am going to emerge genkernel, and run genkernel all.

 

I doubt it will solve. It's should be something stupid. Try to check the output of

```
# modinfo -F vermagic usbcore

2.6.15-rc5 PENTIUMM gcc-4.0

# ls -l /lib/modules/$(uname -r)/kernel/drivers/usb/core/usbcore.ko

-rw-r--r--  1 root root 138043 Dec  4 22:19 /lib/modules/2.6.15-rc5/kernel/drivers/usb/core/usbcore.ko
```

----------

## Cocobo-1

Now I feel like an idiot. I tried to fix my system with a bootdisk and chroot to my system. I forgot to mount the /boot partition and I never got the new kernel but new modules  :Sad: 

----------

## sgentry6

```
modinfo -F vermagic usbcore

2.6.12-gentoo-r6 SMP preempt 586 4KSTACKS gcc-3.4

ls -l /lib/modules/$(uname -r)/kernel/drivers/usb/core/usbcore.ko

-rw-r--r--  1 root root 135867 Dec 15 17:41 /lib/modules/2.6.12-gentoo-r6/kernel/drivers/usb/core/usbcore.ko
```

Sorry it tooke me so long to get back on this.  I had forgotton genkernel does not boot my machine properly, system is back up and running on the last bootable kernel I had.

----------

## dgaffuri

Do you mean that modprobe works? I see that your module is compiled with gcc 3.4 now, even if using the 586 processor family instead of PENTIUM4, while it was gcc 3.3 in first post.

Just for information, the kernel version magic is built in include/linux/vermagic.h as

```
/* Simply sanity version stamp for modules. */

#ifdef CONFIG_SMP

#define MODULE_VERMAGIC_SMP "SMP "

#else

#define MODULE_VERMAGIC_SMP ""

#endif

#ifdef CONFIG_PREEMPT

#define MODULE_VERMAGIC_PREEMPT "preempt "

#else

#define MODULE_VERMAGIC_PREEMPT ""

#endif

#ifndef MODULE_ARCH_VERMAGIC

#define MODULE_ARCH_VERMAGIC ""

#endif

#define VERMAGIC_STRING                                                 \

        UTS_RELEASE " "                                                 \

        MODULE_VERMAGIC_SMP MODULE_VERMAGIC_PREEMPT                     \

        MODULE_ARCH_VERMAGIC                                            \

        "gcc-" __stringify(__GNUC__) "." __stringify(__GNUC_MINOR__)
```

and MODULE_ARCH_VERMAGIC is in include/asm-i386/module.h

```
#ifdef CONFIG_M386

#define MODULE_PROC_FAMILY "386 "

#elif defined CONFIG_M486

#define MODULE_PROC_FAMILY "486 "

#elif defined CONFIG_M586

#define MODULE_PROC_FAMILY "586 "

....

#elif CONFIG_MGEODEGX1

#define MODULE_PROC_FAMILY "GEODEGX1 "

#else

#error unknown processor family

#endif

#ifdef CONFIG_REGPARM

#define MODULE_REGPARM "REGPARM "

#else

#define MODULE_REGPARM ""

#endif

#ifdef CONFIG_4KSTACKS

#define MODULE_STACKSIZE "4KSTACKS "

#else

#define MODULE_STACKSIZE ""

#endif

#define MODULE_ARCH_VERMAGIC MODULE_PROC_FAMILY MODULE_REGPARM MODULE_STACKSIZE
```

----------

## sgentry6

Well this is annoying.  I edited the vermagic.h and module.h to indicate an error to display which type of processor and whether or not the SMP flag had been set.  I moved my modules directory and rebuilt the kernel.  

I expected to see some output when I made the kernel, but it made no difference.  There were no errors reported when building the new kernel, and I still get the version magic error.

To answer your question above I can modprobe modules that were created when I build the kernel.  

Could anyone host a valid 2.6.12-gentoo-r6 config file?  Im not looking for a custome made kernel, rather a file I could grab and then use to build a kernel with?  

I'm thinking I may have grabbed a .config file for an older kernel version - I don't think that should matter, but I think that these problems began when i issued the olee wget command on a .config file.

----------

## sgentry6

Anything else I should try?  Should I scrap the box and start over?

----------

## dirtbag

disable ccache out of /etc/make.conf

make clean && make in your /usr/src/linux dir, etc. with your new gcc version.

boot new kernel..

-db

----------

