# cannot recompile kernel, please help!

## randal1

Hi All,

I have been struggling with this issue for a long time but simply cannot find a fix.  My laptop seems to be running ok but I discovered this problem when trying to make some alterations with my kernel configuration.

Below are the basic steps I use to upgrade my linux kernel:

 *Quote:*   

> 
> 
> emerge required version of vanilla-sources
> 
> "emerge -s vanilla-sources"
> ...

 

My problem is that I recently upgraded to 2.6.17-rc4 and things seemed to be working ok. However, when I tried to add modular support for some package in my kernel - by running "genkernel --menuconfig all" - when I'm done and try to save the changes I see various error about: 

 *Quote:*   

> 
> 
> aaron ~ # genkernel --menuconfig all; lilo
> 
> * Gentoo Linux Genkernel; Version 3.3.5
> ...

 

Is there anything anyone can recommend?

Many thanks in advance  :Smile: 

----------

## wah

Using oldconfig between versions can lead to things like this, as different items have been added/subtracted in the newer releases.  I would try just doing it without the oldconfig and see what happens.

----------

## randal1

thanks for the quick reply!

Could I just run the steps I think I should take past you then please?  

Would I just move the current kernels config to another place and then run "genkernel --menuconfig all" again?  Will this generate a "default" kernel config because it doesn't find the correct one?

Thank you!

----------

## wah

 *randal1 wrote:*   

> thanks for the quick reply!
> 
> Could I just run the steps I think I should take past you then please?  
> 
> Would I just move the current kernels config to another place and then run "genkernel --menuconfig all" again?  Will this generate a "default" kernel config because it doesn't find the correct one?
> ...

 

Not a problem  :Wink: 

Your new steps seem correct - remove the "oldconfig" that you placed there, and run the genkernel segment to generate a fresh config.  Then make all your changes as per your hardware.  I don't use Genkernel, but I just verified that the steps will work via manual config...so it should work for Genkernel.

HTH, and good luck,

W.

----------

## randal1

me again... I have a bunch of new (and similar) errors:

 *Quote:*   

> aaron kernels # genkernel --menuconfig all
> 
> * Gentoo Linux Genkernel; Version 3.3.5
> 
> * Running with options: --menuconfig all
> ...

 

If I'm working with a blank kernel config and still getting this error could it be my kernel source files?

Thanks  :Smile: 

----------

## wah

So you're getting these errors AFTER removing the .config file?

----------

## randal1

yep

----------

## wynn

I think you can ignore the

```
.config:16:warning: trying to assign nonexistent symbol CLEAN_COMPILE 
```

warnings. It's got a .config file for an old kernel and a lot of things have disappeared (as wahman143 said in his first post).

You can also ignore the warnings

```
warning: `pm_send_all' is deprecated

warning: #warning "MCA legacy -

warning: `netcard_portlist' defined but not used 
```

as these are all for the maintainers of the drivers in question who need to update the source code.

The errors, in both your first post and the most recent one

```
net/ieee80211.h: No such file or directory
```

come from not having enabled IEEE 802.11 support in your .config.

You will find it in

```
Symbol: IEEE80211 [=n]

Prompt: Generic IEEE 802.11 Networking Stack

  Location:

    -> Networking

      -> Networking support 

< >   Generic IEEE 802.11 Networking Stack
```

----------

## randal1

hi thanks for the reply.

I tried enabling Generic IEEE 802.11 Networking Stack with Modular support (M) and saw the following:

 *Quote:*   

> 
> 
> #
> 
> *** End of Linux kernel configuration.
> ...

 

If I try to add Generic IEEE 802.11 Networking Stack support built in (*) I see the following:

 *Quote:*   

> 
> 
> aaron ~ # genkernel --menuconfig all
> 
> * Gentoo Linux Genkernel; Version 3.3.5
> ...

 

Any ideas what I could do?

----------

## wynn

This is what I've got for IEEE 802.11 in the kernel

```
<M>   Generic IEEE 802.11 Networking Stack

[ ]     Enable full debugging output

---     IEEE 802.11 WEP encryption (802.1x)

<M>     IEEE 802.11i CCMP support

< >     IEEE 802.11i TKIP encryption

<M>     Software MAC add-on to the IEEE 802.11 networking stack

[ ]       Enable full debugging output
```

The error seems to be

```
make[2]: *** No rule to make target `net/ieee80211/ieee80211_module.s', needed by `net/ieee80211/ieee80211_module.o'. Stop. 
```

I've got 2.6.17-gentoo-r8 here and there is no ieee80211_module.s â there's a ieee80211_module.c but no assembler module.

So it seems as if your kernel source may not be quite right, I can't say as I haven't the vanilla sources which, I assume, you have downloaded.

You might be better off installing gentoo-sources instead and the latest stable version for x86 is 2.6.18-gentoo-r4.

----------

## randal1

hi  :Smile: 

So should it just be a case of emerging the latest gentoo-sources...

 *Quote:*   

> 
> 
> aaron linux # emerge -av gentoo-sources
> 
> These are the packages that would be merged, in order:
> ...

 

and running through the usual steps...

 *Quote:*   

> 
> 
> change directory to Kernel Link
> 
>         "cd /usr/src/"
> ...

 

???

Thanks

----------

## wjb

Whats with the /etc/kernels stuff? (I have the directory but it looks pretty derelict)

There are some differences between your steps to rebuild a kernel and the current Gentoo Linux Kernel Upgrade Guide

----------

## randal1

see the bottom of the page...

 *Quote:*   

> Code Listing 10.2: Reusing your old config with genkernel
> 
> # cd /etc/kernels
> 
> # cp kernel-config-x86-2.6.9-gentoo-r1 kernel-config-x86-2.6.9-gentoo-r2
> ...

 

----------

## wjb

 *wjb wrote:*   

> Whats with the /etc/kernels stuff? (I have the directory but it looks pretty derelict)

 

ok. yeah. I remember now. Thats about when I stopped using genkernel and went DIY. duh.

----------

## randal1

no probs  :Smile: 

so does anyone have any suggestions RE my process?...

should it just be a case of emerging the latest gentoo-sources...

 *Quote:*   

> 
> 
> aaron linux # emerge -av gentoo-sources
> 
> These are the packages that would be merged, in order:
> ...

 

and running through the usual steps...

 *Quote:*   

> 
> 
> change directory to Kernel Link
> 
> "cd /usr/src/"
> ...

 

???

Thanks

----------

## wjb

ok I'll have another go...

I don't see any options in genkernel that let you start a new config from scratch, just ones that use make oldconfig.

You can get a new default .config using the kernel's make, then (if you have to) merge in the settings from your original config.

# cd /usr/src/linux

To list the possible make targets:

# make help

```

...

Configuration targets:

  config          - Update current config utilising a line-oriented program

  menuconfig      - Update current config utilising a menu based program

  xconfig         - Update current config utilising a QT based front-end

  gconfig         - Update current config utilising a GTK based front-end

  oldconfig       - Update current config utilising a provided .config as base

  randconfig      - New config with random answer to all options

  defconfig       - New config with default answer to all options

  allmodconfig    - New config selecting modules when possible

  allyesconfig    - New config where all options are accepted with yes

  allnoconfig     - New config where all options are answered with no

...

```

defconfig sounds about right, so

# make defconfig

will get you a new .config with all the default settings.

Copy the new .config to wherever it is that genkernel needs it. Then try genkernel again, with --clean in the options (to make sure there's no crud left around from previous build attempts). Then probably need to make a few changes with menuconfig to match your previous setup.

----------

## randal1

I tried something similar (see above)

I removed old config and ran genkernel...it used a default config file

 *Quote:*   

> Using config from /usr/share/genkernel/x86/kernel-config-2.6 

 

but I still got the errors.  I think I'm missing kernel files.

Can I just emerge gentoo-sources?  Sounds like a stupid question but will I lose my "backup" kernels that I boot into when I break stuff? (these are using vanilla-sources)

Thanks  :Smile: 

----------

## randal1

ok I emerged gentoo-sources and ran genkernel.  Everything was fine.  But then I ran module-rebuild rebuild to update my modules, and in doing so think I've found where the problem with all the ieee stuff occurs:

 *Quote:*   

> aaron kernels # module-rebuild rebuild
> 
> ** Preparing to merge modules:
> 
> ** Packages which I will emerge are:
> ...

 

I do what it says, and then try and recompile the kernel again.  I then see all of the errors as before.  My kernel is fine until I let this module start playing with it!

Can anyone suggest anything?

----------

## wjb

Seeing that message I think I would have kept the kernel version and unmerged the external one. ieee80211-1.1.13 is from March, quite a while before the 2.6.18 kernel you are now using.

I have a 2.6.17-r8gentoo sources kernel - I just tried turning on the iee80211 config options as wynn said - it compiled with no problems at all.

My suggestion is you unmerge ieee80211, get a clean 2.6.18, and set the options as above.

if you want to keep your working kernels take a look in /boot - make a copy of the kernel (and ram disk image) file and set up a boot loader entry for them.

----------

## randal1

ok I managed to get it to work, turns out I was being stupid and wasn't re-emerging after running the script   :Embarassed: 

now I can recompile the kernel, but the new kernel hangs when "starting lo" and I get an error when booting about my wireless card:

 *Quote:*   

> 
> 
> BUG: unable to handle kernel NULL pointer dereference at virtual address 00000000
> 
>  printing eip:
> ...

 

Any ideas?

----------

