# getting confused with gentoo kernel version...

## CooKies37

hi, i am a newbie here...hope you all can help me o these:

i already dual-boot my laptop with winxp and gentoo...i install gentoo using the liveCD2005.0, which using the kernel version 2.6.11-gentoo-rc3..

yesterday, i try emerge --update --deep world, to update my gentoo...but after that, i discovered that most of the files in /usr/src/linux gone already!

and when i search under /usr/src, i see two version of the kernel, one is the original 2.6.11-gentoo-rc3, and the other is 2.6.12-gentoo-rc6.....

i don't know what is that means? 

i face many problems when i want to emerge ati-drivers and ati-drivers-extra, because it always pop up saying some kind like 'can't resolve kernel version' errors....but i don't know what is my kernel version now......please help me out...

 :Sad: 

----------

## thewally

Hi, your kernel version still remain 2.6.11-gentoo-r3.

Your last update had been installed gentoo-sources-2.6.12-r6. 

For change your kernel version:

```

# cd /usr/src

# rm -f linux

# ln -s linux-2.6.12-r6 linux

# cd linux

# make menuconfig

```

You may want to change menuconfig with xconfig. (oldconfig can be much difficult to use)

Config your kernel then:

```
# make && make modules_install

# cp .config /boot/config-2.6.12-gentoo-r6 && cp System.map /boot/System.map-2.6.12-gentoo-r6 && cp arch/i386/boot/bzImage /boot/kernel-2.6.12-gentoo-r6

```

(Change i386 with you arch)

Now edit /boot/grub/grub.conf (if you use grub) or /etc/lilo.conf (if you use lilo).

Remember to run lilo.

Reboot.

P.S.: You can use genkernel (see gentoo handbook), it's much easier  :Wink: 

----------

## CooKies37

hi, is that mean that after make xconfig, i just follow the handbook, copy the image to the boot , then make changes in the grub, then ok?

if there is any problem using the new kernel, can i use back my old kernel?

because i heard a lot of post regarding the incompatibility of ati-drivers with the new 2.6.12 kernel, is that true? how to solve that?

----------

## Headrush

 *CooKies37 wrote:*   

> hi, is that mean that after make xconfig, i just follow the handbook, copy the image to the boot , then make changes in the grub, then ok?
> 
> if there is any problem using the new kernel, can i use back my old kernel?
> 
> because i heard a lot of post regarding the incompatibility of ati-drivers with the new 2.6.12 kernel, is that true? how to solve that?

 

Yes.

Instead of updating the previous entry in GRUB, make a new one and you can pick either of the kernels until you verify the new one works.

You will probably have to re-emerge the ati drivers so it installs any modules it needs to the new kernel.

----------

## CooKies37

sorry, i have some stupid thought regarding kernel:

1. is that really a need for us to always update our kernel to the latest version? why?

2. i think i have accidentally update my kernel (since i really don't know about that  :Razz:  ), is that because i type: "emerge --update --deep world" ?

3. what should i need to reconfigure after update the kernel?

4. if i only configure my boot partition with 32MB of space, will it enough for keeping the old kernel in it?

thanks again for your post....thanks..

----------

## CooKies37

oh, yes, i forgot 1 more question:

for my 2.6.11-gentoo-r3 kernel, i have follow the manual of sk98lin driver for my Marvell Yukon PCI-E NIC card, and patch the kernel....do i still need to patch the new 2.6.12-gentoo-r6 kernel if i recompile and install the new kernel? will my module automatically included inside?

----------

## Headrush

 *CooKies37 wrote:*   

> 1. is that really a need for us to always update our kernel to the latest version? why?

 

Better performance, features and bug fixes. Plus several other packages rely on up-to date kernels.

 *CooKies37 wrote:*   

> 2. i think i have accidentally update my kernel (since i really don't know about that  ), is that because i type: "emerge --update --deep world" ?

 

When you update the kernel through portage, you are just installing the source. The kernel is the image you put in /boot

 *CooKies37 wrote:*   

> 3. what should i need to reconfigure after update the kernel?

 

Generally only 3rd party binary drivers. (eg nvidia, ati, vmware)

[quote="CooKies37"]4. if i only configure my boot partition with 32MB of space, will it enough for keeping the old kernel in it?/quote]

You don't have to keep all of them. I generally keep the newest one and the 1 previous version for emergency cases. (Yet to need it yet  :Smile:  )

 *CooKies37 wrote:*   

> for my 2.6.11-gentoo-r3 kernel, i have follow the manual of sk98lin driver for my Marvell Yukon PCI-E NIC card, and patch the kernel....do i still need to patch the new 2.6.12-gentoo-r6 kernel if i recompile and install the new kernel? will my module automatically included inside?

 

In general, if the newer kernel source doesn't already have the driver added, you will have to patch the new kernel to add the driver. I don't know about that driver. You can look for it when you do menuconfig to see if its there or not.

----------

## CooKies37

hi, guys, i tried already, i can get my new kernel boot up without problem....

BUT! my wireless module ipw2200 can't work!!! isn't it should work since it is not third party drivers?

 *Quote:*   

> 
> 
> CooKies37 wrote: 
> 
> 3. what should i need to reconfigure after update the kernel? 
> ...

 

?? how? when i modprobe -l, i can't see the ipw2200 driver as well....in old kernel, i can see the driver when modprobe -l, and i can successfully autoload the driver, but in new kernel, it doesn't appear at all? why? do i need to re-emerge the ipw2200 driver for my wireless card?

is that also mean that, whenever i update my kernel, i must also re-emerge all my drivers? isn't it too terrible to do so?

----------

## maguire

I'm not sure why the behavior would have changed, but the modules that are automatically loaded at boot are in:

```

cat /etc/modules.autoload.d/kernel-2.6

```

Is the module you want auto-loaded in there?

In my own case, I use the NVidia drivers for my video card, and whenever I switch to a new kernel, meaning:

1) the symbolic link "/usr/src/linux" is changed to point to the new source directory in "/usr/src".

2) the ".config" file is created from scratch with "make menuconfig", or the old ".config" file is copied from the previous source directory to the new one, and I run "make oldconfig".

3) the kernel is compiled (make && make modules_install).

4) the kernel image is copied to "/boot".

5) the /boot/grub/grub.conf file is modified to add the new kernel as the default (the first in the list).

I then have to:

```

emerge nvidia-kernel

```

which (I think) automatically adds the line "nvidia" to my /etc/modules.autoload.d/kernel-2.6:

```

cat /etc/modules.autoload.d/kernel-2.6

# /etc/modules.autoload.d/kernel-2.6:  kernel modules to load when system boots.

#

# Note that this file is for 2.6 kernels.

#

# Add the names of modules that you'd like to load when the system

# starts into this file, one per line.  Comments begin with # and

# are ignored.  Read man modules.autoload for additional details.

# For example:

# 3c59x

nvidia

```

Does this help at all?

Bruce.

----------

## dsd

 *CooKies37 wrote:*   

> is that also mean that, whenever i update my kernel, i must also re-emerge all my drivers? isn't it too terrible to do so?

 

thats correct. its not ideal, but its not too much of a problem either - the kernel itself includes *loads* of drivers, so you only ever have a few (if any) that you need to emerge seperately.

there are some tools you can use to help the rebuild process, e.g. module-rebuild

by the way, most of the questions you have asked in this thread were already answered in the gentoo documentation:

http://www.gentoo.org/doc/en/kernel-upgrade.xml

----------

## maguire

Oh, and to answer your earlier question:

 *Quote:*   

> 
> 
> 1. is that really a need for us to always update our kernel to the latest version? why?
> 
> 

 

No, definitely not!

If you have the space in "/usr/src", then you should just go ahead and "update" the "gentoo-sources" every time a new one is available---when you run your "emerge -uD world"  (although you should always run "emerge -pvuD world" first, to make sure that everything that will be done is OK with you!).  What the "update" of "gentoo-sources" means, is just that the sources for the new kernel will be put in a new directory in "/usr/src".  That is all!  There will be no change to your current kernel.  Only when you manually do the necessary steps to compile a new kernel and install it (as I stated above), will the new kernel actual be ready to use!  So, go ahead and always update the "gentoo-sources".

Then, when you want to, you can look in your "/usr/src" directory for the latest kernel, and update to it.  When should you switch to a newer kernel?  Well, in my opinion,

1) if you find that a new feature you want, or hardware support you need, is built-into the newer kernel;

2) if you find that a security issue is fixed in the newer kernel;

3) if it has been long enough that you think you should upgrade so that you don't feel foolish when you have some problem and post to these forums.  :Wink: 

But seriously, many people consider the kernel to be in the same league as the tool chain (the basic building-blocks: glibc, binutils, gcc, linux-headers), meaning something that should only be updated if you really have a need to do it!  With the only exception being security fixes, these definitely fall under the heading of: If it isn't broken, don't fix it!  That being said, it is usually trivial to reboot to a prior kernel if you have problems (as long as you kept the old kernel and kept an entry in "grub.conf" for it).  So, no, you probably never need to upgrade a kernel, but it is an easy process and may bring added benefits.

If you are upgrading between minor version changes, then it is much easier to copy the ".config" file from your old source directory to the new source directory ("/usr/src/linux"), and run make oldconfig.  That will use your old configuration for everything that it can, and prompt you for any new options in the new kernel.  When I switched from a 2.4 kernel to a 2.6 kernel, though, the upgrade guide said that running "make oldconfig" would cause more problems than it was worth.  So, in that case, I ran "make menuconfig", and reconfigured everything from scratch.

I'm not sure if I'm telling you what you already know, but I know that when I switched to Gentoo (from Red Hat) years ago, I had never compiled a kernel before, and I was pretty confused about the whole thing...

Bruce.

----------

## CooKies37

thanks, maguire, now i do have some understanding on the kernel, thank you so much on your post...

hm...it seems like i have made some wrong decision to update my kernel...because before updating to the new 2.6.12-rc6 kernel, my 2.6.11 works well and everthing ok....i can get my Marvell Yukon PCI-E NIC to work with my wireless ipw2200 modules....but after i "emerge --update --deep world", it updates the kernel, and now i can't have the original source in the /usr/src....

when i explore in /usr/src/2.6.11-gentoo-rc3/, i just see the 'drivers' directory only....no more makefile and so on....

all those appear in /usr/src/2.6.12-gentoo-rc6/ folder....

so, when i 'emerge ati-drivers', i always get errors like: "cannot resove kernel version"..."cannot find valid .config in symlink"...

yes, that's why i thought if i just re-compile the new kernel will solve the problem...but unfortunately, after compiling the new kernel, my Marvell Yukon Network card can't works!!!! i got segmentation errors!!! which i don't get in old kernel.....and problems arise....if my network card fail to work in new kernel, then how can i emerge ati-drivers?!!!

 :Sad:  yes, a bit frustrated on that.....now i wonder is there anyway to get back my old kernel? i mean get all those .config, makefile....those things back in the /usr/src/2.6.11-gentoo-rc3 ? so that i can still use the old kernel to compile my ati-drivers?

----------

## dgaffuri

 *CooKies37 wrote:*   

> now i wonder is there anyway to get back my old kernel? i mean get all those .config, makefile....those things back in the /usr/src/2.6.11-gentoo-rc3 ? so that i can still use the old kernel to compile my ati-drivers?

 

Really nothing lost there I think, may you please post your

```
ls -l /usr/src
```

output?

Emerging the new kernel wil _add_ a new directory in /usr/src, but will not delete the old one. You said it in the first post

 *CooKies37 wrote:*   

> and when i search under /usr/src, i see two version of the kernel, one is the original 2.6.11-gentoo-rc3, and the other is 2.6.12-gentoo-rc6.....

 

----------

## CooKies37

 *Quote:*   

> 
> 
> Emerging the new kernel wil _add_ a new directory in /usr/src, but will not delete the old one. You said it in the first post 
> 
> 

 

hm...i know emerging the new kernel will add a new directory, so in my /usr/src , i got two kernel directory, which is 2.6.11-gentoo-r3 and 2.6.12-gentoo-r6......but in the 2.6.11-gentoo-r3 (old kernel), no file left, i remember last time got a lot of files inside there, like .config, makefile and so on....after all, i found that all those files appear in the new kernel directory!

why? that's the reason why i thought i MUST re-compile to use the new kernel in order to emerge the ati-drivers, since it cannot get the .config files in the old kernel directory....

so, what you all think? am i done something wrong? or ??

----------

## maguire

It sounds like you might have unmerged the old kernel.  If you "emerge -C <old-gentoo-sources>" or "emerge -P gentoo-sources" (prune), then the old sources will be removed.  There is no need to do that (unless you need the disk space).

Please post the results of:

```

ls -la /usr/src

```

and also:

```

ls -la /usr/src/linux-*

```

If those files in the old kernel directory are really gone, then you must have done something wrong somewhere.

A piece of advice: always copy the ".config" file in the current "/usr/src/linux/" directory to both "/boot/config-<kernel-version>" and "/usr/src/config-<kernel-version>".  That ".config" file is the most important part of your kernel installation---with it, you can rebuild the same kernel again.  I have managed to lose the ".config" file of my current kernel before, and you really want that file when you upgrade to the next kernel (so you can use "make oldconfig" rather than having to go through the pain of resetting every kernel option to the way you had it using "make menuconfig")!  Having a backup copy of the config readily available in "/usr/src" has saved me a few times!

Post the results of those "ls" commands, and we'll see what's what.

Bruce.

----------

## CooKies37

ok, here is my result:

ls -las /usr/src

 *Quote:*   

> 
> 
> total 32
> 
>  4 drwxr-xr-x   5 root root 4096 Aug 12 00:59 .
> ...

 

ls -las /usr/src/linux-2.6.11-gentoo-r3

 *Quote:*   

> 
> 
> total 16
> 
> 4 drwxr-xr-x  4 root root 4096 Aug  7 23:26 .
> ...

 

ls -las /usr/src/linux-2.6.12-gentoo-r6

 *Quote:*   

> 
> 
> total 21592
> 
>    4 drwxr-xr-x  19 root root    4096 Aug 12 08:46 .
> ...

 

last, this is my ls -las in /boot

 *Quote:*   

> 
> 
> total 18743
> 
>    1 drwxr-xr-x   4 root root    1024 Aug 12 01:56 .
> ...

 

so, is there anything wrong? have i deleted my old kernel? please help me to get my old kernel back, i have tried many times with the new kernel and my Marvell Yukon network card still got errors, it hangs my kernel during boot time! how?

----------

## dgaffuri

You're config is not lost. It's gzipped in

```
/usr/src/linux-2.6.11-gentoo-r3.config.gz
```

So I would do this:

```
cp /usr/src/linux-2.6.11-gentoo-r3.config.gz $HOME

rm -rf /usr/src/linux-2.6.11-gentoo-r3

emerge =gentoo-sources-2.6.11-r3

cd /usr/src/linux-2.6.11-gentoo-r3

zcat /usr/src/linux-2.6.11-gentoo-r3/config.gz >.config

make menuconfig

make && make modules_install
```

The make menuconfig is just to check that the saved config is the good one, otherwise you may just check by looking at it. Now you should have your kernel back (I'm not completely sure of the emerge command syntax, I'm not in Gentoo now). If you build successfully don't forget to install the kernel. Then change the linux symlink in /usr/src and emerge again your kernel modules.

[EDIT]Add > in zcat /usr/src/linux-2.6.11-gentoo-r3/config.gz >.config[/EDIT]Last edited by dgaffuri on Fri Aug 12, 2005 7:20 am; edited 1 time in total

----------

## CooKies37

sorry, your code did not work! i get Segmentation fault after doing emerge =gentoo-sources-2.6.11-r3

pls help!  :Sad: 

----------

## dgaffuri

Try booting your old kernel (yes, it's still there). Should be

```
2322 -rw-r--r-- 1 root root 2366474 Aug 5 02:44 vmlinuz-2.6.11-gentoo-r3
```

in /boot. Just make a new entry in /boot/grub/grub.conf that points to it.

----------

