2006-05-20 16:08:41

by George Nychis

[permalink] [raw]
Subject: cannot load *any* modules with 2.4 kernel

Hi,

I boot two kernels, a 2.6.9 kernel and just recently built a 2.4.32 kernel

In the 2.4.32 kernel I have =y for:
CONFIG_MODULES
CONFIG_MODVERSIONS
CONFIG_KMOD

I then build my kernel, with some modules, install the modules, and boot
my 2.4.32 kernel successfully

when i do lsmod, it is completely empty, no modules are loaded. This
only happens for my 2.4.32 kernel though, modules load fine in 2.6.9

If i try to manually insert with insmod or modprobe, i get unresolved
external symbols for things that I am sure should be resolved... for
example, i get unresolved external symbol for printk

I'll give some other common unresolved smybols and maybe someone can
point me in the right direction of what else i need to specify to you
guys so that you can help me out further.

prinkt
add_timer
dev_mc_add
CardServices
kfree
cpu_raise_softirq
free_irq
kmalloc

Thanks!
George


2006-05-20 16:27:35

by Willy Tarreau

[permalink] [raw]
Subject: Re: cannot load *any* modules with 2.4 kernel

Hi,

On Sat, May 20, 2006 at 12:10:18PM -0400, George Nychis wrote:
> Hi,
>
> I boot two kernels, a 2.6.9 kernel and just recently built a 2.4.32 kernel
>
> In the 2.4.32 kernel I have =y for:
> CONFIG_MODULES
> CONFIG_MODVERSIONS
> CONFIG_KMOD
>
> I then build my kernel, with some modules, install the modules, and boot
> my 2.4.32 kernel successfully
>
> when i do lsmod, it is completely empty, no modules are loaded. This
> only happens for my 2.4.32 kernel though, modules load fine in 2.6.9

What's your modutils version ? -> lsmod -V
You must use modutils and not modules-utils under 2.4, and I suspect
that if you jumped back from 2.6 to 2.4, you might not have the right
package. Note that modules-utils contains a wrapper to call the right
modutils when you are running 2.4, so you should really do lsmod -V
when running 2.4.

> If i try to manually insert with insmod or modprobe, i get unresolved
> external symbols for things that I am sure should be resolved... for
> example, i get unresolved external symbol for printk
>
> I'll give some other common unresolved smybols and maybe someone can
> point me in the right direction of what else i need to specify to you
> guys so that you can help me out further.
>
> prinkt
> add_timer
> dev_mc_add
> CardServices
> kfree
> cpu_raise_softirq
> free_irq
> kmalloc
>
> Thanks!
> George

Regards,
Willy

2006-05-21 00:04:07

by George Nychis

[permalink] [raw]
Subject: Re: cannot load *any* modules with 2.4 kernel

Okay, so heres what I did. I downloaded modutils version 2.4.27 and
extracted it to /usr/local/modutils

Then in my 2.4.32 kernel's Makefile, I changed the DEPMOD variable to
point to /usr/local/modutils/sbin/depmod

Then I build the kernel with:
make dep && make bzImage modules modules_install && make install

So then my initrd gets generated, I reboot to the 2.4.32 kernel, and
thats where i'm at now.

So then for instance I goto /lib/modules/2.4.32/net and do:
/usr/local/modutils/sbin/insmod 8390.o

and I see all those unresolved symbols

So maybe now that you have more info, we can figure something out.

Thanks!
George


Willy Tarreau wrote:
> Hi,
>
> On Sat, May 20, 2006 at 12:10:18PM -0400, George Nychis wrote:
>> Hi,
>>
>> I boot two kernels, a 2.6.9 kernel and just recently built a 2.4.32 kernel
>>
>> In the 2.4.32 kernel I have =y for:
>> CONFIG_MODULES
>> CONFIG_MODVERSIONS
>> CONFIG_KMOD
>>
>> I then build my kernel, with some modules, install the modules, and boot
>> my 2.4.32 kernel successfully
>>
>> when i do lsmod, it is completely empty, no modules are loaded. This
>> only happens for my 2.4.32 kernel though, modules load fine in 2.6.9
>
> What's your modutils version ? -> lsmod -V
> You must use modutils and not modules-utils under 2.4, and I suspect
> that if you jumped back from 2.6 to 2.4, you might not have the right
> package. Note that modules-utils contains a wrapper to call the right
> modutils when you are running 2.4, so you should really do lsmod -V
> when running 2.4.
>
>> If i try to manually insert with insmod or modprobe, i get unresolved
>> external symbols for things that I am sure should be resolved... for
>> example, i get unresolved external symbol for printk
>>
>> I'll give some other common unresolved smybols and maybe someone can
>> point me in the right direction of what else i need to specify to you
>> guys so that you can help me out further.
>>
>> prinkt
>> add_timer
>> dev_mc_add
>> CardServices
>> kfree
>> cpu_raise_softirq
>> free_irq
>> kmalloc
>>
>> Thanks!
>> George
>
> Regards,
> Willy
>
>

2006-05-21 05:51:12

by Willy Tarreau

[permalink] [raw]
Subject: Re: cannot load *any* modules with 2.4 kernel

On Sat, May 20, 2006 at 08:05:55PM -0400, George Nychis wrote:
> Okay, so heres what I did. I downloaded modutils version 2.4.27 and
> extracted it to /usr/local/modutils
>
> Then in my 2.4.32 kernel's Makefile, I changed the DEPMOD variable to
> point to /usr/local/modutils/sbin/depmod
>
> Then I build the kernel with:
> make dep && make bzImage modules modules_install && make install
>
> So then my initrd gets generated, I reboot to the 2.4.32 kernel, and
> thats where i'm at now.
>
> So then for instance I goto /lib/modules/2.4.32/net and do:
> /usr/local/modutils/sbin/insmod 8390.o
>
> and I see all those unresolved symbols

Hmmm 8390.o needs crc32.o (or maybe you built it into your kernel).
Could you please :
- grep 8390.o /lib/modules/2.4.32/modules.dep
- post the exact list of unresolved symbols that insmod outputs
- grep 2 or 3 of them in /proc/ksyms (eg: printk)
- post your .config so that we can find a way to reproduce your problem.

> So maybe now that you have more info, we can figure something out.

By the time you do this, it would also be interesting to retry without
CONFIG_MODVERSIONS. Oh, and please report your gcc and binutils versions
so that we can be as close as possible to your conditions when trying
to reproduce.

> Thanks!
> George

Regards,
willy

2006-05-21 06:58:43

by George Nychis

[permalink] [raw]
Subject: Re: cannot load *any* modules with 2.4 kernel

Thanks for all the help Willy,

Nothing from the grep:
[root@emu-5 net]# grep 8390.o /lib/modules/2.4.32/modules.dep
[root@emu-5 net]#

Exact list:
enable_irq
eth_type_trans
__kfree_skb
alloc_skb
ether_setup
crc32_le
kmalloc
cpu_raise_softirq
alloc_netdev
__out_of_line_bug
disable_irq_nosync
netif_rx
skb_over_panic
bitreverse
jiffies
softnet_data
prink
__const_udelay

Grepping 2 or 3:
[root@emu-5 net]# grep enable_irq /proc/ksyms
c010a5e0 enable_irq_R__ver_enable_irq
c0343610 matroxfb_enable_irq_R__ver_matroxfb_enable_irq
[root@emu-5 net]# grep printk /proc/ksyms
c011aee0 printk_R__ver_printk
[root@emu-5 net]# grep kmalloc /proc/ksyms
c0132c60 kmalloc_R__ver_kmalloc
c03c07e0 sock_kmalloc_R__ver_sock_kmalloc

binutils version: 2.15.92.0.2 20040927
gcc: 3.4.2 20041017

My .config can be found here:
http://www.andrew.cmu.edu/user/gnychis/.config

And I will try taking out CONFIG_MODVERSIONS support and let you know
how it goes!

By the way, i'm not keen on inserting 8390.o into the kernel, it was
simply the first thing i saw in my /lib/modules/2.4.32 directory, my
goal is to get any module at all to insert, because it seems none will
insert.

Thanks again!
George

Willy Tarreau wrote:
> On Sat, May 20, 2006 at 08:05:55PM -0400, George Nychis wrote:
>> Okay, so heres what I did. I downloaded modutils version 2.4.27 and
>> extracted it to /usr/local/modutils
>>
>> Then in my 2.4.32 kernel's Makefile, I changed the DEPMOD variable to
>> point to /usr/local/modutils/sbin/depmod
>>
>> Then I build the kernel with:
>> make dep && make bzImage modules modules_install && make install
>>
>> So then my initrd gets generated, I reboot to the 2.4.32 kernel, and
>> thats where i'm at now.
>>
>> So then for instance I goto /lib/modules/2.4.32/net and do:
>> /usr/local/modutils/sbin/insmod 8390.o
>>
>> and I see all those unresolved symbols
>
> Hmmm 8390.o needs crc32.o (or maybe you built it into your kernel).
> Could you please :
> - grep 8390.o /lib/modules/2.4.32/modules.dep
> - post the exact list of unresolved symbols that insmod outputs
> - grep 2 or 3 of them in /proc/ksyms (eg: printk)
> - post your .config so that we can find a way to reproduce your problem.
>
>> So maybe now that you have more info, we can figure something out.
>
> By the time you do this, it would also be interesting to retry without
> CONFIG_MODVERSIONS. Oh, and please report your gcc and binutils versions
> so that we can be as close as possible to your conditions when trying
> to reproduce.
>
>> Thanks!
>> George
>
> Regards,
> willy
>
>

2006-05-21 07:32:10

by Nick Warne

[permalink] [raw]
Subject: Re: cannot load *any* modules with 2.4 kernel

On 21/05/06, George Nychis <[email protected]> wrote:
> Okay, so heres what I did. I downloaded modutils version 2.4.27 and
> extracted it to /usr/local/modutils
>
> Then in my 2.4.32 kernel's Makefile, I changed the DEPMOD variable to
> point to /usr/local/modutils/sbin/depmod
>

Well thats a half-arsed way to do it. The kernel makefile could be
using the new /usr/local/sbin/depmod and the system the old
/sbin/depmod /sbin/insmod /sbin/modprobe etc.

Just install the new modutils to /usr/local/ and then add
/usr/local/sbin to your $PATH _before_ /sbin etc. so it is read
first.

Nick

2006-05-21 08:43:52

by Willy Tarreau

[permalink] [raw]
Subject: Re: cannot load *any* modules with 2.4 kernel

On Sun, May 21, 2006 at 03:00:39AM -0400, George Nychis wrote:
> Thanks for all the help Willy,
>
> Nothing from the grep:
> [root@emu-5 net]# grep 8390.o /lib/modules/2.4.32/modules.dep
> [root@emu-5 net]#
>
> Exact list:
> enable_irq
> eth_type_trans
> __kfree_skb
> alloc_skb
> ether_setup
> crc32_le
> kmalloc
> cpu_raise_softirq
> alloc_netdev
> __out_of_line_bug
> disable_irq_nosync
> netif_rx
> skb_over_panic
> bitreverse
> jiffies
> softnet_data
> prink
^^^^^^^

You copied the list by hand, didn't you ?
Are you sure there were not revision after the symbol names,
such as "printk_R1b7d4074" ?


> __const_udelay
>
> Grepping 2 or 3:
> [root@emu-5 net]# grep enable_irq /proc/ksyms
> c010a5e0 enable_irq_R__ver_enable_irq
> c0343610 matroxfb_enable_irq_R__ver_matroxfb_enable_irq
> [root@emu-5 net]# grep printk /proc/ksyms
> c011aee0 printk_R__ver_printk
> [root@emu-5 net]# grep kmalloc /proc/ksyms
> c0132c60 kmalloc_R__ver_kmalloc
> c03c07e0 sock_kmalloc_R__ver_sock_kmalloc
^^^^^^^^^^^^^^^^^^^

There should be and 'R' followed by 8 hex digits here. I remember I
already came across this once, but unfortunately I don't remember how
nor how I fixed it.

When I build from your .config, I have "printk_R1b7d4074" for example.
It is defined in include/linux/modules/printk.ver which is dynamically
generated during make dep :

#define __ver_printk 1b7d4074
#define printk _set_ver(printk)
#define __ver_acquire_console_sem f174ed48
#define acquire_console_sem _set_ver(acquire_console_sem)
#define __ver_console_print b714a981
#define console_print _set_ver(console_print)
#define __ver_console_unblank b857dfed
#define console_unblank _set_ver(console_unblank)
#define __ver_register_console 80c5241f
#define register_console _set_ver(register_console)
#define __ver_unregister_console d83dc0dd
#define unregister_console _set_ver(unregister_console)

So I suspect that this file was not included at all during build. Stupid
question : are you really sure that the bzImage you boot from has been
rebuilt and that you're not running an old one ? Have you performed a
"make distclean" before you have built the kernel for the first time
(save your .config before doing this).

Hmmm while I'm thinking about it, please also ensure that you have
'genksyms' somewhere in your path.

> binutils version: 2.15.92.0.2 20040927
> gcc: 3.4.2 20041017

Should be OK.

> My .config can be found here:
> http://www.andrew.cmu.edu/user/gnychis/.config
>
> And I will try taking out CONFIG_MODVERSIONS support and let you know
> how it goes!

I'm sure it will work.

> By the way, i'm not keen on inserting 8390.o into the kernel, it was
> simply the first thing i saw in my /lib/modules/2.4.32 directory, my
> goal is to get any module at all to insert, because it seems none will
> insert.

I understand, what I meant is that 8390 relies on crc32.o which might
or might not be included in the kernel. I wanted to identify the
possibility that some modules might have been missing.

> Thanks again!
> George

Regards,
Willy

2006-05-21 14:41:47

by George Nychis

[permalink] [raw]
Subject: Re: cannot load *any* modules with 2.4 kernel

Before I build i do:
PATH=/usr/local/modutils/sbin:$PATH

Therefore it must be reading it first, sorry I should have mentioned
this... just have done so much to try and get it to work I can't
remember it all :)

In response to Willy's post, yeah it was by hand, i can't get that comp
on the network yet :(

I will answer all your detailed questions and rebuild the kernel, but it
didn't have any revisions after names, I'll rebuild with that exact
.config i posted after a make clean mrproper to ensure its installing
the new kernel. Then I'll also try disabling modversion.

Thanks!
George


Nick Warne wrote:
> On 21/05/06, George Nychis <[email protected]> wrote:
>> Okay, so heres what I did. I downloaded modutils version 2.4.27 and
>> extracted it to /usr/local/modutils
>>
>> Then in my 2.4.32 kernel's Makefile, I changed the DEPMOD variable to
>> point to /usr/local/modutils/sbin/depmod
>>
>
> Well thats a half-arsed way to do it. The kernel makefile could be
> using the new /usr/local/sbin/depmod and the system the old
> /sbin/depmod /sbin/insmod /sbin/modprobe etc.
>
> Just install the new modutils to /usr/local/ and then add
> /usr/local/sbin to your $PATH _before_ /sbin etc. so it is read
> first.
>
> Nick
>

2006-05-21 15:34:40

by Nick Warne

[permalink] [raw]
Subject: Re: cannot load *any* modules with 2.4 kernel

On Sunday 21 May 2006 15:43, George Nychis wrote:
> Before I build i do:
> PATH=/usr/local/modutils/sbin:$PATH
>
> Therefore it must be reading it first, sorry I should have mentioned
> this... just have done so much to try and get it to work I can't
> remember it all :)

Well, yes, but as soon as you reboot and login that $PATH will be lost - you
need to add that in your .bashrc, or profile.d/ or whatever to make it
permanent.

I don't know what the issue is with the modules, but building against one
version of modutils and then running system with another version will surely
cause problems?

Nick
--
"Person who say it cannot be done should not interrupt person doing it."
-Chinese Proverb

2006-05-22 01:55:23

by Keith Owens

[permalink] [raw]
Subject: Re: cannot load *any* modules with 2.4 kernel

Willy Tarreau (on Sun, 21 May 2006 10:40:55 +0200) wrote:
>On Sun, May 21, 2006 at 03:00:39AM -0400, George Nychis wrote:
>> Grepping 2 or 3:
>> [root@emu-5 net]# grep enable_irq /proc/ksyms
>> c010a5e0 enable_irq_R__ver_enable_irq
>> c0343610 matroxfb_enable_irq_R__ver_matroxfb_enable_irq
>> [root@emu-5 net]# grep printk /proc/ksyms
>> c011aee0 printk_R__ver_printk
>> [root@emu-5 net]# grep kmalloc /proc/ksyms
>> c0132c60 kmalloc_R__ver_kmalloc
>> c03c07e0 sock_kmalloc_R__ver_sock_kmalloc
> ^^^^^^^^^^^^^^^^^^^
>
>There should be and 'R' followed by 8 hex digits here. I remember I
>already came across this once, but unfortunately I don't remember how
>nor how I fixed it.

Broken kernel build system in 2.4. It does not always build the module
version data correctly. Save your 2.4 .config, make mrproper
(critical), restore your .config then
make oldconfig
make dep
make bzImage modules
make modules_install
install

2006-05-22 13:18:41

by George Nychis

[permalink] [raw]
Subject: Re: cannot load *any* modules with 2.4 kernel

Okay, i *finally* got it booting and inserting modules!

the culprit was the modversions.

Thanks for everyones help!

- George