# Howto: update the kernel? [solved?]

## mno

Hi, 

What is the proper procedure to update the Gentoo kernel (using portage if possible)? I've done a search on the boards, but didn't get anything helpful. Sorry if this was answered before.

Also, what files would you recommend that I backup before going on and doing this?

Thanks,

Max

----------

## c0rax

Hey bro, don't appologize thats a good question. And for a long time i was scared to do it without help. First of all you dont ned to really back anything up casue you can have several kernels sitting on your /boot partition all at once and boot from them all if you want to by adding an entry into you grub conf. ok so here goes a step by step to the best of my ability.

1. emerge the latest kernel sources. do this by doing an emerge gentoo-dev-sources after a fresh sync.

2. configure your new kernel. this is exaclty the same as the first kernel you configured. cd into /usr/src/linux and run make menuconfig

3.build your new kernel i think the command is make && make modules_install but i could be a little off.

4. copy your new kernel over to your boot partition. remember when you do this you can name your kernel anything. i ussually name mine after the purpose they where made for. for example i have 3 kernels right now, one for an ati graphics car so its called ATI, one for an nvidia card so its called NVIDIA, and one generic kernel for use with my built in graphics card called GENERIC.

5. add this new kernel as a second entry into your grub.conf and then test it by rebooting and selecting your new kernel.

if it boots then your good to go if not the maybe i didnt explain well enough. and im sorry. but im more than willing to personally help if you can get a hold of me. just send me a msg through the forums and ill msg you or something.

----------

## Dillius

I am using Gentoo for my first time(moved over from mandrake), probably like the original poster. I'm not too confident in my kernel-compiling abilities either, but this post made me feel a bit better about it.

My main question is in regard to the ATI Radeon drivers. Is it possible to do all the configurations to the kernel needed as described this way? Therefore avoiding the need to completely reinstall Gentoo?

Also, does anyone know of a more detailed guide on kernel upgrading/replacing? Perhaps even detailing the ATI driver issue also?

----------

## mno

Hey c0rax,

Thanks for the reply. I still have to go through with the procedure, and I'm a bit worried, but I will do it a bit later this week and post some more detailed steps for those looking to do this down the road. It seems anyone doing this had enough technical knowledge to never even blink, and the newbies found it better to reinstall the system with the new kernel rather than attempt it.

Thanks,

mno

----------

## mno

Hmm, seems there's a more detailed solution available in the Gentoo Wiki:

http://gentoo-wiki.com/HOWTO_Remote_Kernel_Upgrade

http://gentoo-wiki.com/HOWTO_Compile_a_Kernel_Manually

Probably would've been a good idea to search there, first.  :Embarassed: 

----------

## Zuu

While I wrote this I did update my own kernel. So the exact versions might differ.

As root:

```
# emerge gentoo-dev-sources

# cd /usr/src/linux-2.6.10-gentoo-r6/

```

If you have an config file from anoter older 2.6.x kernel you can imort that counfig file:

```
# mount /boot

#cp /boot/config-2.6.9-gentoo-r1-scsi ./.config

#make oldconfig
```

else

```
# make menuconfig
```

Next step, compile the kernel

```
# make && make modules_install
```

Copy it to /boot (if you followed the avice in the Gentoo handbook it will be a seperate partiton, that is not automaticly mounted at boot)

```
# mount /boot

# cp arch/i386/boot/bzImage /boot/kernel-2.6.10-gentoo-r6

# cp System.map /boot/System.map-2.6.10-gentoo-r6

# cp .config /boot/config-2.6.10-r6
```

```
vi /boot/grub/grub.conf
```

and add after or before existing blocks of similar code: 

```
title=Gentoo Linux 2.6.10-r6

        root(hd0,0)

        kernel /kernel-2.6.10-gentoo-r6 root=/dev/hda2

```

Note that /dev/hda2 is my root partition. If you're root partition is located somewhere else you have to change that.

Note2 that root(hd0,0) tells grub that the kernel is located on pratition 0 on disk 0. If that is not your case you'll have to change that.

--

Now there will come people that says that you should not compile the code as root, but copy the kernel source to your home directory, and compile it there as your limited user. However, I as being lazy don't do that.

----------

## mno

Thanks for the step-by-step. A good continuation can be found in the wiki: http://gentoo-wiki.com/HOWTO_Remote_Kernel_Upgrade

----------

