# kernel-2.6.9 (needs unknown symbol) [RESOLVED]

## kirchner

i recently installed gentoo 2004.2 on a quantex pentium III 500 MHz laptop and 2004.3 on a toshiba satellite p25-477 pentium 4 1.4 GHz laptop and a homemade amd duron 750 MHz desktop.  the quantex and desktop are working great.  i'm having trouble with the kernel on the toshiba, on which i've installed gentoo twice.

the first time went fine.  i rolled my own kernel and got xorg-x11 working and everything.  then i decided to tackle some issues i was having with my usb mouse and usb memory stick.  this of course involved rolling and re-rolling the kernel.  eventually, "something happened" and my kernel just stopped working.  i would move the newly compiled kernel to /boot/, restart the machine, and the kernel wouldnt load.  after the GRUB screen, the kernel load screen would come up and immediately reboot.  some sort of message would pop up about the kernel loading, but it went away too quickly for me to read it.

next, i booted from the minimal livecd, chrooted, and tried compiling that way.  that's when i noticed that when i ran "make" after configuring the kernel, i got several lines like the following:

*** Warning: "free_pages" [fs/vfat/vfat.ko] undefined!

*** Warning: "iput" [fs/vfat/vfat.ko] undefined!

*** Warning: "kfree" [fs/vfat/vfat.ko] undefined!

and then i ran make modules_install:

WARNING: /lib/modules/2.6.9-gentoo-r6/kernel/fs/vfat/vfat.ko needs unknown symbol kfree

WARNING: /lib/modules/2.6.9-gentoo-r6/kernel/fs/vfat/vfat.ko needs unknown symbol iput

WARNING: /lib/modules/2.6.9-gentoo-r6/kernel/fs/vfat/vfat.ko needs unknown symbol free_pages

there *seems* to be a correspondence between these warnings, but i'm not certain.  

after determining that this kernel compilation was going nowhere, i started over with gentoo 2004.3.  installation went fine.  this time i went with genkernel just to see what would happen.  after some time, i decided to tweak the kernel because i knew that genkernel tended to create bloated kernels.  i used genkernel --menuconfig all and rebooted.  the same kernel issues described above occured.  i booted from the livecd, chrooted, and ran genkernel again and had a look at the /var/log/genkernel.log file.  it's quite messy; filled with warnings such as those noted above.  it it can be found here (note: it's just over 1.2 MB):

http://jessekirchner.com/genkernel.log

any help/suggestions would be much appreciated.

thank you.

jesse k.Last edited by kirchner on Wed Apr 27, 2005 8:09 pm; edited 1 time in total

----------

## deathdruid

Save your .config, do "make mrproper" in the kernel source directory, and try "make" again. Do you still get the errors?

----------

## kirchner

i've tried deleting the .config and using the kernel-config-2.6 from genkernel.  i've also tried make mrproper.  i've also tried using the configuration from the livecd by gunzipping and copying /proc/config.gz to /usr/src/linux/.config.

----------

## daff

I am having the seemingly exact same problems. Doesn't matter which kernel i use (gentoo-dev-sources 2.6.8 and 2.6.9), every compile (make) ends in a lot of messages like these:

```

*** Warning: "mod_timer" [drivers/char/rtc.ko] undefined!

*** Warning: "jiffies" [drivers/char/rtc.ko] undefined!

*** Warning: "preempt_schedule" [drivers/char/rtc.ko] undefined!

*** Warning: "kill_fasync" [drivers/char/rtc.ko] undefined!

*** Warning: "__wake_up" [drivers/char/rtc.ko] undefined!

*** Warning: "__kmalloc" [drivers/char/drm/radeon.ko] undefined!

*** Warning: "mem_map" [drivers/char/drm/radeon.ko] undefined!

*** Warning: "vmalloc" [drivers/char/drm/radeon.ko] undefined!

```

I've just reinstalled Gentoo and the initial kernel compilation via the LiveCD was fine. Now after two days of installing a lot of things (xorg, xfce4, firefox, vim, etc, just the things you need on a workstation) and configuring stuff I wanted to get the madwifi-drivers working, and enable wireless extensions in the kernel. 

This is the first kernel compile after the installation and now it's like this. I have not done anything out of the ordinary, nothing I haven't done a million times already in the past years.

Does anybody know why the fsck this suddenly happens? I am so frustrated right now, it makes absolutely no sense at all. And why is there nobody else with the same problems? I don't even understand WHAT the problem IS?!

I've done everything I could think of: make mrproper, reconfigure everything from the beginning, delete the kernel sources completely and reemerge them, even different ones (2.6.9-r9, then 2.6.9-r13 after an emerge sync), activate only the bare minimum of options so that the system would run, etc, all to no avail.

Please, any help is appreciated!

----------

## dsd

which command are you using to start the compilation?

to me it sounds like you have changed gcc version (or similar), and you are trying to compile new modules using the newer gcc without first recompiling the base of the kernel and rebooting into the newly compiled kernel.

perhaps you could *upload* your .config (dont paste here) and explain the exact steps you go through in order to get those messages to appear.

----------

## daff

Ok, first of all thanks for the reply! Here is my .config that I generated during the installation. It contains nothing really special I think.

All I have to do to get those error messages is to issue a make. I even tried it with a fresh sys-kernel/development-sources where I didn't change anything in the default configuration other than the processor type (Pentium III), enabled module unloading und forced unloading. Then again a make and in the end I get the same error messages. Like here:

```

...

  HOSTCC  arch/i386/boot/tools/build

  BUILD   arch/i386/boot/bzImage

Root device is (3, 4)

Boot sector 512 bytes.

Setup is 2330 bytes.

System is 1545 kB

Kernel: arch/i386/boot/bzImage is ready

  Building modules, stage 2.

  MODPOST

*** Warning: "ipt_unregister_table" [net/ipv4/netfilter/iptable_raw.ko] undefined!

*** Warning: "nf_unregister_hook" [net/ipv4/netfilter/iptable_raw.ko] undefined!

*** Warning: "nf_register_hook" [net/ipv4/netfilter/iptable_raw.ko] undefined!

*** Warning: "ipt_register_table" [net/ipv4/netfilter/iptable_raw.ko] undefined!

*** Warning: "ipt_do_table" [net/ipv4/netfilter/iptable_raw.ko] undefined!

*** Warning: "ipt_unregister_target" [net/ipv4/netfilter/ipt_NOTRACK.ko] undefined!

*** Warning: "ipt_register_target" [net/ipv4/netfilter/ipt_NOTRACK.ko] undefined!

...

```

I use GCC 3.3.4 and don't remember having fooled around with anything in that matter. Heck, didn't even have the time to, the system is just 2 days old.

What other information should I provide? I'll give anything you need  :Smile: 

Thanks for the help!

----------

## dsd

i don't get this problem with your config. please confirm that the following sequence definately still does get you these messages:

```

rm -rf /usr/src/linux-2.6.9-gentoo-r13

emerge =gentoo-dev-sources-2.6.9-r13

cd /usr/src/linux-2.6.9-gentoo-r13/

wget "http://daffit.meownz.info/dotconfig" -O .config

make bzImage modules

```

----------

## daff

Goddamnit, f*ck, sh*t and crap! I am one kernel compile short of totally loosing it! 

I followed your exact procedure and still get the same kind of errors:

```

...

  LD      arch/i386/boot/compressed/vmlinux

  OBJCOPY arch/i386/boot/vmlinux.bin

  HOSTCC  arch/i386/boot/tools/build

  BUILD   arch/i386/boot/bzImage

Root device is (3, 4)

Boot sector 512 bytes.

Setup is 4334 bytes.

System is 1353 kB

Kernel: arch/i386/boot/bzImage is ready

  Building modules, stage 2.

  MODPOST

*** Warning: "pci_bus_read_config_byte" [sound/pci/snd-intel8x0.ko] undefined!

*** Warning: "msleep" [sound/pci/snd-intel8x0.ko] undefined!

*** Warning: "kcalloc" [sound/pci/snd-intel8x0.ko] undefined!

*** Warning: "mem_map" [sound/pci/snd-intel8x0.ko] undefined!

*** Warning: "param_get_int" [sound/pci/snd-intel8x0.ko] undefined!

*** Warning: "param_array_get" [sound/pci/snd-intel8x0.ko] undefined!

[...about a thousand lines of the same crap...]

*** Warning: "complete" [drivers/base/firmware_class.ko] undefined!

*** Warning: "printk" [drivers/base/firmware_class.ko] undefined!

*** Warning: "simple_strtol" [drivers/base/firmware_class.ko] undefined!

*** Warning: "sprintf" [drivers/base/firmware_class.ko] undefined!

  CC      drivers/base/firmware_class.mod.o

  LD [M]  drivers/base/firmware_class.ko

  CC      drivers/char/agp/agpgart.mod.o

  LD [M]  drivers/char/agp/agpgart.ko

...

```

I tried booting the LiveCD and chrooting into the installation and performing the compilation from there, same result.

But thanks a lot for your trying to help and your time! 

Do you have any other ideas what could be wrong? It has to be something, what, in the environment? make-args maybe? But how? I've had this system running a month or so before reinstallation two days ago and I've compiled a hundred of kernels to get all the hardware supported (the system being a T41p laptop and all) and really can't remember a particular event which could have been the cause of this mess.

Argh.  :Evil or Very Mad: 

----------

## dsd

nothing obvious, which versions of gcc / binutils are installed?

----------

## daff

qpkg output:

sys-devel/gcc-3.3.4-r1

sys-devel/gcc-config-1.3.6-r4

sys-devel/binutils-2.15.90.0.1.1-r3

Looks right?

----------

## kirchner

just for completeness, i recently bought a dell poweredge sc420 (2.8 MHz p4, no OS, 256 MB RAM) and had the same problems.  i'm no linux master, but i'm no linux moron either.  that's four machines i own (see previous post at top for descriptions of other three) and it's the two p4s that give me trouble.  my older, slower machines have been great with gentoo.  in a way, that's great, as these two machines benefit most from the advantages of software compiled for their specific architechtures.

anyway, right now, it's fedora core 3 for my p4s.

----------

## dsd

which versions of modutils and module-init-tools ?

----------

## daff

modutils I don't have installed, and module-init-tools is 3.0-r2. Do I need modutils? Don't think I've ever installed it on any other Gentoo machine I have.

The T41p I am having problems is a Pentium M 1.7GHz, does that count as a P4? I thought not, but I am getting a little confused these days, what with the hundreds of labels for the dozen different CPUs there are.

I'd just hate to have to use anything other than Gentoo on that laptop, hopefully there's a solution for this...

----------

## daff

Ok, I think I am making progress. I followed the Gentoo Wiki guide to migrating to GCC 3.4 and, well, migrated to GCC 3.4  :Smile:  Now I've just recompiled that 2.6.9-gentoo-r13 with my .config and there were no such errors to be seen anywhere after the make. 

This looks fine to me, but who knows what's going to happen next. I still have to emerge -e the rest of the world and then reboot and try again with building a new kernel, now with wireless extensions (the reason I had to recompile the kernel in the first place). I'll report back, hopefully with good news.

----------

## kirchner

daff, did you have any luck?  can you point me toward the gentoo wiki guide you reference?  something about migrating to gcc 3.4.

thanks.

----------

## daff

Ok, I had luck. I don't think that it had to do much with GCC 3.4, however. The HOWTO for migrating is here.

I think the problem was that the CHOST variable in /etc/make.conf was set to "i386-pc-linux-gnu" and not to "i686-pc-linux-gnu". In the course of switching the GCC profile I noticed that there was no profile for i686-pc-linux-gnu-3.4, only for  i386-pc-linux-gnu-3.4 so I checked make.conf and there I saw it, all wrong.

Again, I think that was the problem but I'm not sure. Check your CHOST and correct it if necessary, then try again. If that doesn't work you might want to switch to GCC 3.4.

I have successfully recompiled a 2.6.9-gentoo-r13 kernel and modules, and it seems to work just fine. Good luck!

----------

## kirchner

i'm not sure i get what you mean about the CHOST.  mine is set to "i686-pc-linux-gnu".  is that what you currently have?  

looking at the migration HOWTO, i see that there are the following:

 [1] i386-pc-linux-gnu-3.3.4

 [2] i686-pc-linux-gnu-3.4.3 

 [3] i686-pc-linux-gnu-3.4.3-hardened

 [4] i686-pc-linux-gnu-3.4.3-hardenednopie

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

i see neither "i686-pc-linux-gnu-3.4" nor "i386-pc-linux-gnu-3.4".  not to split hairs, but did you mean "i686-pc-linux-gnu-3.4.3" and "i386-pc-linux-gnu-3.3.4"?

i had no luck with my kernel compile this morning.  i'll try the gcc 3.4 migration and cross my fingers.

----------

## daff

Yeah, you're right, i meant "i686-pc-linux-gnu-3.4.3". Lazy me  :Smile: 

My CHOST was "i386-pc-linux-gnu", not "i686-pc-linux-gnu" like it should have been. I am almost certain that was at least part of my problem, but I am no kernel knowitall.

I just recompiled a new kernel, now with bluetooth and AES support, and it built (and booted) without problems. Hopefully using GCC 3.4 is going to help you, too.

----------

## kirchner

sweet mercy, the migration to gcc 3.4 appears to have worked!  thanks, daff.

----------

## daff

Glad to hear it! But why did we have to migrate? What was the error we worked around by doing so? I don't know...

----------

## kirchner

i still have no idea.  i've yet to reattempt the kernel compile on my dell poweredge sc420, but i'm definitely going to try (and then -- no redhat!).

i'm still wierded out by this.  why do i need to do this for my pentium4 machines, but no others?  why arent more people having this problem???

----------

## r4di0_h34d

I'm having this problem too.  I re-installed the 2.6.10-r5 kernel this weekend and started working on power management (following the excelent guide  here   ).  I had ndiswrapper installed for my linksys wpc11 v.4, and had the battery run-level switch working.

  Part-way through the power management how-to i realised i didn't want a symetric multiprocessing kernel, so i recompiled the kernel without it.  Now ndiswrapper won't load ( Invalid module format error ) with the non-smp kernel; when compiling the kernel i get the warnings that ndiswrapper needs unknown symbols.

The REALLY weird part is that when booting into the previously-working smp-kernel, my sound card module won't load (neither will any of the acpi modules: ac, battery, button, fan, etc.) although previously they worked wonderfully.

On the plus-side, cpu frequency scaling seems to work now. :)

I've tried make mrproper, but i still get the warnings

/lib/modules/2.6.10-gentoo-r4/misc/ndiswrapper.o needs unknown symbol _spin_lock_bh

I get 8 such warnings, the other symbols are _spin_unlock_bh, _per_cpu_offset, spin_unlock, spin_unlock_irqrestore, el_timer_sync, spin_lock_irqsave, and spin_lock.  These look like they probably have to do with threading, but I've recompiled ndiswrapper and still get the warnings.

[/url]

----------

## Rubberneck

I have this same problem. What is strange is when i installed the box the 1st time it compiled the kernel just fine. Now when i try and compile one it just spews the errors. I have updated and installed a couple of new programs on there but haven't changed anything major and it seems to compile other things like php and apache just fine. Anyone have any new ideas what's going on with this?

I have remerged gcc and module-init-tools and tried everything else i can think but so far nothing has worked.

----------

## Rubberneck

I was able to finaly fix this by doing "emerge -e system". After that was done it compiled a kernel fine and didn't give me any errors.

----------

## desertstalker

 *r4di0_h34d wrote:*   

> 
> 
>   Part-way through the power management how-to i realised i didn't want a symetric multiprocessing kernel, so i recompiled the kernel without it.  Now ndiswrapper won't load ( Invalid module format error ) with the non-smp kernel; when compiling the kernel i get the warnings that ndiswrapper needs unknown symbols.

 

You need to recompile the ndiswrapper module everytime you recompile the kernel as it uses ther currently configured kernel (in /usr/src/linux) to build the module.

That is probbabbly why emerge -e worked (it is a mMUCH longer way to do it though)

The reason the acpi modules wouldnt load is you were using a smp kernel and non-smp modules which wont work.  When you issue make modules_install as part of a kernel build you are overwriting the old modules of that version of the kernel.

Hope this helps.

----------

## kirchner

i finally got around to installing gentoo on the aforementioned poweredge sc420.  i followed the installation instructions at:

http://gentoo-wiki.com/HOWTO_Install_Gentoo_-_The_Gentoo_Developers_Method_with_NPTL_and_2.6_from_Stage1

i believe this is a more streamlined version of the suggestions presented by daff.  as yet, i've had no problems with those kernel compile errors!

----------

## desertstalker

It seems that alot of people dont realise that you need to recompile ALL kernel modules when you alter the kernel in maost ways ans certainly if you chage versions.

One thing where portage falls down IMHO is that it needs the linux symlink to compile for the kernel.  I switch kernels all the time and i find it easior to manually recompile the source for the kernel modules (ndiswrapper and such) than to have to change the symlink then emerge a whole lot af things.

Is there any reason why Portage can't, unless you tell it not to, compile for the running kernel?

----------

