PDA

View Full Version : How does insmod know the arch? [solved]



pfc
05-05-2006, 12:56 PM
Hi folks,

I've been reading the HOWTOs and many posts in this forum but I haven't found how to solve my problem.

I need a i586 Knoppix, for that reason I decided to recompile the kernel. After that, I recompiled cloop, unionfs, modutils and busybox. I also moved all the new modules needed to the initRAMFS.
When I try to boot from the new iso I get:


insmod: error inserting 'cloop.ko': -1 Invalid module format


Using busybox I found out that Knoppix is expecting i386 modules


dmesg
cloop: version magic '2.6.12 SMP preempt 586 gcc-3.3' should be '2.6.12 SMP preempt 386 gcc-3.3'


Where does insmod get that should be from? I haven't found any file in initRAMFS where it says which is the arch.
And, after mounting /proc, I found out that in kcore it says that my system is 2.6.12 SMP preempt 586 gcc-3.3

What's wrong?

Regards
pfc

tr
05-05-2006, 05:58 PM
dmesg
cloop: version magic '2.6.12 SMP preempt 586 gcc-3.3' should be '2.6.12 SMP preempt 386 gcc-3.3'



The answer is very simple.
You MUST compile modules with the same kernel version and with the same compiler version as you compiled the kernel. This means that you can't boot to your new kernel and compile modules from it. Of course you should test that new kernel works but go then back and compile the modules you need with your old kernel.


-tapsa-

pfc
05-05-2006, 08:53 PM
What you say, is what I did (I probably didn't expained very well).

I recompiled the kernel and modules with the same kernel version and compiler. My new Kernel and modules are i586, but when I boot he asks me for i386 modules.

pfc

pfc
05-07-2006, 04:24 PM
Here is what I was doing wrong:
As it says in the HOWTO I copied the vmlinuz-2.X.Y file to master/boot/isolinux, but I didn't realised that I had to overwrite the previous Kernel called 'linux'.