# how to install a new kernel?

## neon_pipe

how can i install a new kernel on Gentoo?

what might get better by updating it?

i have the kernel that comes in the Gentoo 2004.0 live cd, should  update?

where can i find good info about compiling and chnging you kernel?

I would like to make it manually (the hardcore way) to learn bit more.

Thank You   :Shocked: 

----------

## nevynxxx

to install a new kernel, follow the installation guide that tells you how to install the kernel the first time. It is exactly the same, there is also a description of the different availible sources.

----------

## sethleon

For instance, you can download the newest kernel from kernel.org,

unpack the archive, and open the README or INSTALL using a text editor. (directory for your linux sources: /usr/src/

By the way kernel sources are also available in the portage,

you can find all typing:

```
emerge -s source
```

----------

## tommy_fila

Two things that can easily go wrong and should be avoided:

1) Make sure you mount /boot before copying your kernel image to /boot.

2) Leave your old sources in place. It is very likely that the new kernel wont be perfect right after the first time. So it is always nice to have an old kernel to turn back to. 

Like the previous posts said, read the installation guide on how to configure your kernel. It has everything you need in there!

Good Luck!  :Very Happy: 

----------

## desero

When You emerge a new kernel ( eg. emerge sys-kernel/gentoo-dev-sources ) you should also change the symlink in /usr/src

 :Arrow:  /usr/src/linux -> /usr/src/<kernel>

----------

## furkan

you need to use emerge that is it but if you want to know the all sources #ls /usr/portage/sys-kernel/ or check this site there are a documentation  :Smile: 

----------

## thecooptoo

got the new kernel emerged

whats the next step to make GRUB dual boot?

----------

## sethleon

please refere to the gentoo installation documentation,

or this short reference: http://www.gentoo.org/doc/en/gentoo-x86-quickinstall.xml

----------

## thecooptoo

any examples of a dual boot grub.conf and what you do  (if anything) about the symlink usr/src/linux->

----------

## nevynxxx

Everything you need are hereand here

Like I said in an earlier post, just look back at the install manual.

The only thing not covered well is the dual boot. In this case you just have another sert of lines like 

```

title=Gentoo Linux 2.4.24

# Partition where the kernel image (or operating system) is located

root (hd0,0)

kernel /kernel-2.4.24 root=/dev/hda3

```

but with a different title and kernel. This is covered in the grub howto.

the LDP makes for a good bookmark.

----------

## b|ur

this is great but ill be damned if i can find a bzImage to backup first

cp /boot/bzImage /boot/bzImage.r1

cp: cannot stat `/boot/bzImage': No such file or directory

I used genkernel to make my kernel now how can I backup? I'm begining to think if you used genkernel to do this the whole situtation becomes different. any help?

----------

## nevynxxx

make sure /boot is mounted and post the output of 

```

ls /boot/
```

the kernel should be called bzImage-<something> or possibly vmlinuz or vmlinux, there are a few names used.

----------

## b|ur

ls boot

boot  grub  initrd-2.4.24  kernel-2.4.24  lost+found

thanks for the quick responce btw

----------

## nevynxxx

lol...just a coincidence that I happen to be reading my posts right now.

it's the file kernel-2.4.24 that you want to back up, that's the kernel.

----------

## b|ur

ok cheers  :Smile: , i've backed up both -2.4.24s just incase, prehaps someone should do a how to if you've installed your kernel using genkernel, or maybe I will if I get this done someday soon.

----------

## thecooptoo

bash-2.05b# pwd

/lib/modules/2.6.2

bash-2.05b# find /lib/modules/2.6.2/ -type f -iname '*.o' -or -iname '*.ko'

/lib/modules/2.6.2/kernel/arch/i386/mki-adapter26/mki-adapter.ko

/lib/modules/2.6.2/kernel/drivers/net/dummy.ko

bash-2.05b# modules-update

depmod: *** Unresolved symbols in /lib/modules/2.4.20-gentoo-r5/kernel/misc/svgalib_helper.o

bash-2.05b#

???

----------

## nevynxxx

 *thecooptoo wrote:*   

> bash-2.05b# pwd
> 
> /lib/modules/2.6.2
> 
> bash-2.05b# find /lib/modules/2.6.2/ -type f -iname '*.o' -or -iname '*.ko'
> ...

 

could be a part of the problem

----------

## thecooptoo

sorry to be so stupid..........

ive merged a new kernel and going through the howto ive got this far - I suspected that this was something to do with it , but I dont know how to fix it I afraid.

Ive got a working system with 2.4... and would like to keep that going while i sort out the 2.6 kernel.

----------

## nevynxxx

Assuming you have done make && make modules_install, copied the kernel to /boot and configured your boot manager, you should be able to boot.

I think you will need to be booted into the 2.6 kernel before modules-update will work, butI'm not sure. I have never had any problems not running modules-update. 

In all reboot and see.

----------

## thecooptoo

I ve got this far ( using  kernel-2.6.2-win4lin)

```

Code Listing 11: Installing the kernel

# cp arch/i386/boot/bzImage /boot/kernel-2..24

# cp System.map /boot/System.map-2.4.24
```

bash-2.05b# cd /boot

bash-2.05b# ls -la

total 3006

drwxr-xr-x   2 root root     216 Apr  2 18:59 .

drwxr-xr-x  19 root root     576 Mar 21 20:06 ..

-rw-r--r--   1 root root       0 Mar 19 14:24 .keep

-rw-r--r--   1 root root  940331 Apr  2 18:59 System.map-2.6.2-win4lin

lrwxrwxrwx   1 root root       1 Jul 20  2003 boot -> .

-rw-r--r--   1 root root   25863 Apr  2 18:59 config-2.6.2-win4lin

-rw-r--r--   1 root root 2101695 Apr  2 18:21 kernel-2.6.2-win4lin

bash-2.05b#

wtf has grub.conf gone?

does it matter ?

Ive got a working system with 2.4.4 kernel

Am i just making things worse ( and worse and worse....)

----------

## huw

you havent mounted your boot partition.

----------

## thecooptoo

bit that is missing

1) mount /boot 

cd boot

rename bzImage eg bzImage.old

edit the existing line in grub.conf to reflect the change.

2)from the installation guide .

```
Code Listing 11: Installing the kernel

 cp arch/i386/boot/bzImage /boot/kernel-2.4.24

 cp System.map /boot/System.map-2.4.24

 cp .config /boot/config-2.4.24
```

copy the gentoo boot line in grub.conf to point to  your new kernel

reboot

is that it?

----------

## sethleon

by the way, I have no System.map in my boot and it works as well,

(kernel 2.6.3)

----------

## CompiledMonkey

 *tommy_fila wrote:*   

> 1) Make sure you mount /boot before copying your kernel image to /boot.
> 
> 2) Leave your old sources in place. It is very likely that the new kernel wont be perfect right after the first time. So it is always nice to have an old kernel to turn back to. 

 

Two very good pieces of advice.

----------

## pandaxiongmao

 *sethleon wrote:*   

> by the way, I have no System.map in my boot and it works as well,
> 
> (kernel 2.6.3)

 

Now, I'm wondering whether we really need to copy System.map to /boot...

 :Confused: 

----------

## nevynxxx

 *pandaxiongmao wrote:*   

>  *sethleon wrote:*   by the way, I have no System.map in my boot and it works as well,
> 
> (kernel 2.6.3) 
> 
> Now, I'm wondering whether we really need to copy System.map to /boot...
> ...

 

I never have, and I've never had a problem, then again, it's not exactly a big, all consuming file.

----------

## pjp

Moved from Installing Gentoo.

----------

## pandaxiongmao

 *nevynxxx wrote:*   

>  *pandaxiongmao wrote:*    *sethleon wrote:*   by the way, I have no System.map in my boot and it works as well,
> 
> (kernel 2.6.3) 
> 
> Now, I'm wondering whether we really need to copy System.map to /boot...
> ...

 

I see; I guess copying System.map to /boot is just another System.map backup.

----------

