Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
How do I update my kernel? [SOLVED]
View unanswered posts
View posts from last 24 hours

Goto page 1, 2  Next  
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
Maheriano
l33t
l33t


Joined: 18 Jun 2005
Posts: 623
Location: Calgary, Alberta

PostPosted: Mon May 01, 2006 6:09 pm    Post subject: How do I update my kernel? [SOLVED] Reply with quote

I searched and couldn't find it. I'm trying to emerge ivman and it says I need a 2.6.13 or newer kernel to run the package. I currently have 2.6.12-gentoo-r10.
_________________
Current project - carputer running.........Gentoo?


Last edited by Maheriano on Wed May 10, 2006 9:54 pm; edited 1 time in total
Back to top
View user's profile Send private message
_loki_
l33t
l33t


Joined: 18 Dec 2003
Posts: 680
Location: in the shell

PostPosted: Mon May 01, 2006 6:19 pm    Post subject: Reply with quote

Code:

emerge --sync && emerge gentoo-sources

then change /usr/src/linux pointing to the new kernel sources
Code:

ln -sf /usr/src/linux/linux-2.6.16-gentoo-version /usr/src/linux

you can use your old .config, but go through the config as there where some changes in menu in 2.6.16..
Code:

cp /usr/src/linux-2.6.12-gentoo-r10/.config /usr/src/linux && cd /usr/src/linux && make menuconfig

when everything is okay, run
Code:

make && make modules_install

and copy the image to /boot
Code:

cp /usr/src/linux/arch/yourarch/boot/bzImage /boot/kernel-2.6.16-gentoo-version

and edit /boot/grub/grub.conf pointing to the new image..

When the new kernel is up and runnig, get rid of the old sources..
Code:

emerge -C gentoo-sources-2.6.12-r10
Back to top
View user's profile Send private message
dsd
Developer
Developer


Joined: 30 Mar 2003
Posts: 2162
Location: nr London

PostPosted: Mon May 01, 2006 7:01 pm    Post subject: Reply with quote

http://www.gentoo.org/doc/en/kernel-upgrade.xml
_________________
http://dev.gentoo.org/~dsd
Back to top
View user's profile Send private message
Maheriano
l33t
l33t


Joined: 18 Jun 2005
Posts: 623
Location: Calgary, Alberta

PostPosted: Tue May 02, 2006 4:31 am    Post subject: Reply with quote

What happened?

Code:
localhost ~ # ln -sf /usr/src/linux/linux-2.6.16-gentoo-version /usr/src/linux
localhost ~ # cp /usr/src/linux-2.6.12-gentoo-r10/.config /usr/src/linux && cd /usr/src/linux && make menuconfig
cp: `/usr/src/linux-2.6.12-gentoo-r10/.config' and `/usr/src/linux/.config' are the same file
localhost ~ # make && make modules_install
make: *** No targets specified and no makefile found.  Stop.

_________________
Current project - carputer running.........Gentoo?
Back to top
View user's profile Send private message
mikegpitt
Advocate
Advocate


Joined: 22 May 2004
Posts: 3224

PostPosted: Tue May 02, 2006 4:34 am    Post subject: Reply with quote

I think the problem is with your symlink. It should read
Code:
ln -sf /usr/src/linux-2.6.16-gentoo-version /usr/src/linux

not
Code:
ln -sf /usr/src/linux/linux-2.6.16-gentoo-version /usr/src/linux

(note the extra /linux in the version you posted)
Back to top
View user's profile Send private message
Maheriano
l33t
l33t


Joined: 18 Jun 2005
Posts: 623
Location: Calgary, Alberta

PostPosted: Tue May 02, 2006 4:51 am    Post subject: Reply with quote

mikegpitt wrote:
I think the problem is with your symlink. It should read
Code:
ln -sf /usr/src/linux-2.6.16-gentoo-version /usr/src/linux

not
Code:
ln -sf /usr/src/linux/linux-2.6.16-gentoo-version /usr/src/linux

(note the extra /linux in the version you posted)


Code:
localhost ~ # ln -sf /usr/src/linux-2.6.16-gentoo-version /usr/src/linux
localhost ~ # cp /usr/src/linux-2.6.12-gentoo-r10/.config /usr/src/linux && cd /usr/src/linux && make menuconfig
cp: `/usr/src/linux-2.6.12-gentoo-r10/.config' and `/usr/src/linux/.config' are the same file
localhost ~ # make && make modules_install
make: *** No targets specified and no makefile found.  Stop.

_________________
Current project - carputer running.........Gentoo?
Back to top
View user's profile Send private message
Mickael
Advocate
Advocate


Joined: 05 Sep 2005
Posts: 2387
Location: ~Belfort! - France - EU

PostPosted: Tue May 02, 2006 6:26 am    Post subject: Reply with quote

Hello,

Maheriano wrote:

Code:
localhost ~ # ln -sf /usr/src/linux-2.6.16-gentoo-version /usr/src/linux
localhost ~ # cp /usr/src/linux-2.6.12-gentoo-r10/.config /usr/src/linux && cd /usr/src/linux && make menuconfig
cp: `/usr/src/linux-2.6.12-gentoo-r10/.config' and `/usr/src/linux/.config' are the same file
localhost ~ # make && make modules_install
make: *** No targets specified and no makefile found.  Stop.


look here : ls /usr/src/, and find the version of your kernel version = r*, where the star is a number. After that, replace version inside your line by this number : ln -sfn /usr/src/linux-2.6.16-gentoo-r* /usr/src/linux,
You can do this for exemple :
#cd /usr/src
# ln -sfn linux-2.6.16-gentoo-r3 linux
Quote:

and for reusing your old config do this :

Code Listing 10.1: Reusing your old config

# cd /usr/src/linux-2.6.16-gentoo-r3
# cp ../linux-2.6.12-gentoo-r10/.config .
# make oldconfig

_________________
À LIRE : COMMENT POSTER ET OBTENIR DE L'AIDE ?
Qui suis-je ? Bon j'ai relu, comme d'habitude, je suis bon a rien le vendredi
Qui suis-je ? Je ne serai jamais modo
Back to top
View user's profile Send private message
Paapaa
l33t
l33t


Joined: 14 Aug 2005
Posts: 955
Location: Finland

PostPosted: Tue May 02, 2006 6:53 am    Post subject: Reply with quote

Maheriano wrote:
What happened?


You didn't follow the official guide but followed incorrect steps posted to this thread. Always use an official guide if it is available! The problems:

1. You wrote "version" to the commands but you should've replaced that string with the actual version suffix: "r3" for example. You can find all the installed kernel versions by looking at /usr/src/.
2. You didn't specify "-n" option with ln. Official guide states that you have to use "ln -sfn...". _loki_'s advice was false and you really didn't change your symlink if the previous wasn't deleted beforehand. With -n you don't need to delete the old link first.
3. Never chain your commands with && if you are not sure all the steps work. Do one step at a time and proceed after you know it worked.

Please follow the official guide and report back if you can't upgrade your kernel.
Back to top
View user's profile Send private message
_loki_
l33t
l33t


Joined: 18 Dec 2003
Posts: 680
Location: in the shell

PostPosted: Tue May 02, 2006 8:40 am    Post subject: Reply with quote

Quote:

ln -sf /usr/src/linux/linux-2.6.16-gentoo-version /usr/src/linux

sorry that is my fault, version of course implicates the version you're using.
For ln..
Quote:

-f, --force remove existing destination files
-n, --no-dereference treat destination that is a symlink to a
directory as if it were a normal file

I guess that means -f replaces the old symlink?! I never use -n though..
Anyway you're right with the official guide, if I knew that there was one I'd just posted the location.
Back to top
View user's profile Send private message
Maheriano
l33t
l33t


Joined: 18 Jun 2005
Posts: 623
Location: Calgary, Alberta

PostPosted: Thu May 04, 2006 4:43 am    Post subject: Reply with quote

Everything worked except I don't know what my architecture is. I followed the guide for x86 because I have a Celeron 2.9ghz processor, how do I find out what my machine is compiled as?

Code:
localhost linux # cd /usr/src/linux/arch
localhost arch # ls
alpha  cris   i386  m68k       parisc  s390  sparc    v850
arm    frv    ia64  m68knommu  ppc     sh    sparc64  x86_64
arm26  h8300  m32r  mips       ppc64   sh64  um

_________________
Current project - carputer running.........Gentoo?
Back to top
View user's profile Send private message
cartpullerjack
Apprentice
Apprentice


Joined: 16 Nov 2003
Posts: 185

PostPosted: Thu May 04, 2006 5:30 am    Post subject: Reply with quote

For the purposes of the linux kernel, you're running an i386.

Technically, though, you have an i686 processor.
Back to top
View user's profile Send private message
Maheriano
l33t
l33t


Joined: 18 Jun 2005
Posts: 623
Location: Calgary, Alberta

PostPosted: Thu May 04, 2006 6:00 am    Post subject: Reply with quote

cartpullerjack wrote:
For the purposes of the linux kernel, you're running an i386.

Technically, though, you have an i686 processor.


Something I should change?
_________________
Current project - carputer running.........Gentoo?
Back to top
View user's profile Send private message
Maheriano
l33t
l33t


Joined: 18 Jun 2005
Posts: 623
Location: Calgary, Alberta

PostPosted: Thu May 04, 2006 6:03 am    Post subject: Reply with quote

And does this look like a proper grub.conf for me now? I also changed the init line, not sure if I should have done that. I'm afraid to reboot.

Code:
kernel /kernel-genkernel-x86-2.6.16-gentoo-r3 acpi=off root=/dev/ram0 init-/lin$
initrd /initramfs-genkernel-x86-2.6.16-gentoo-r3

_________________
Current project - carputer running.........Gentoo?
Back to top
View user's profile Send private message
_loki_
l33t
l33t


Joined: 18 Dec 2003
Posts: 680
Location: in the shell

PostPosted: Thu May 04, 2006 8:05 am    Post subject: Reply with quote

well you should be..
this would work if you kernel image was kernel-genkernel-x86-2.6.16-gentoo-r3, being in /
supposing it is in /boot, please add the partition you choose for /boot, if there is no extra partiton add /boot/; should look like:
Code:

kernel (hdx,x)/kernel-genkernel-x86-2.6.16-gentoo-r3

for having a boot-partition that is hd(x,x) where hd(0,0) would be hda1
or
Code:

kernel /boot/kernel-genkernel-x86-2.6.16-gentoo-r3

for not having a seperat boot-partition..
the same is true for your initrd line, I guess your image is in /boot also..
please also post the rest of the kernel line..
Back to top
View user's profile Send private message
cartpullerjack
Apprentice
Apprentice


Joined: 16 Nov 2003
Posts: 185

PostPosted: Thu May 04, 2006 2:26 pm    Post subject: Reply with quote

Maheriano wrote:
cartpullerjack wrote:
For the purposes of the linux kernel, you're running an i386.

Technically, though, you have an i686 processor.


Something I should change?


No, not unless you're really hot for a multicore Atlhon64.

As far as the kernel is concerned, there are several different classes of processor. Linus Torvalds originally wrote the kernel on a 386 machine, so for compatibility purposes, to run Linux on a 32-bit x86 machine, you would compile your kernel for the i386 class, however, you can still change the particular processor you're compiling for in the config options. It's just that if your kernel is compiled for a 386, its gauranteed to run on any 32-bit x86 processor.

The rest of those directories in linux/arch contain specific code for specific classes of processors, ie, alpha for the DEC Alpha, arm for the ARM processors commonly found in things like PDAs, ia64 for Itanium, ppc if you have a powerpc chip, or ppc64 if you have a 64-bit powerpc chip, etc.... And of course, x86_64 if you were compiling for your hot Athlon64.
Back to top
View user's profile Send private message
Maheriano
l33t
l33t


Joined: 18 Jun 2005
Posts: 623
Location: Calgary, Alberta

PostPosted: Thu May 04, 2006 5:17 pm    Post subject: Reply with quote

Better?

Code:
dan@localhost /boot $ ls
System.map-genkernel-x86-2.6.12-gentoo-r10
boot
grub
initramfs-genkernel-x86-2.6.12-gentoo-r10
kernel
kernel-2.6.16-gentoo-r3
kernel-genkernel-x86-2.6.12-gentoo-r10
linux-2.6.12-gentoo-r10
lost+found


Code:
kernel /boot/kernel-2.6.16-gentoo-r3 acpi=off root=/dev/ram0 init$
initrd /boot/initramfs-genkernel-x86-2.6.12-gentoo-r10


_________________
Current project - carputer running.........Gentoo?
Back to top
View user's profile Send private message
sundialsvc4
Guru
Guru


Joined: 10 Nov 2005
Posts: 436

PostPosted: Thu May 04, 2006 6:50 pm    Post subject: Reply with quote

This bears repeating: always make a backup of your .config files!

I have a directory in /root just for this purpose. Before and after making any kernel changes, I copy the file into this directory, giving it an appropriate non-hidden name. I also place copies of this directory periodically on a removable USB drive.

Aside from the usual " 8O protection," it is extremely handy to be able to diff two files to see exactly what is the difference between them! (I caught at least one instance where a config-variable disappeared when the source code actually still referred to it. It would have been a very obscure bug to diagnose, otherwise.)
Back to top
View user's profile Send private message
Maheriano
l33t
l33t


Joined: 18 Jun 2005
Posts: 623
Location: Calgary, Alberta

PostPosted: Fri May 05, 2006 11:57 pm    Post subject: Reply with quote

:?:
_________________
Current project - carputer running.........Gentoo?
Back to top
View user's profile Send private message
_loki_
l33t
l33t


Joined: 18 Dec 2003
Posts: 680
Location: in the shell

PostPosted: Sat May 06, 2006 8:08 am    Post subject: Reply with quote

yes it's better unless you don not have a separat partition for /boot
also there still seems to be not everything visible in your post:
Quote:

kernel /boot/kernel-2.6.16-gentoo-r3 acpi=off root=/dev/ram0 init$

$ impilcates that there is something more in that line..
Back to top
View user's profile Send private message
Paapaa
l33t
l33t


Joined: 14 Aug 2005
Posts: 955
Location: Finland

PostPosted: Sat May 06, 2006 6:01 pm    Post subject: Reply with quote

_loki_ wrote:
yes it's better unless you don not have a separat partition for /boot


"make menuconfig" has (or had?) a funny feature that searches an old config from /boot. If it is named properly it uses that old config but doesn't mention it to the user. It also doesn't go through new options like "make oldconfig". This should be kept in mind. Or better: don't have /boot mounted while building new kernels.
Back to top
View user's profile Send private message
Maheriano
l33t
l33t


Joined: 18 Jun 2005
Posts: 623
Location: Calgary, Alberta

PostPosted: Sun May 07, 2006 3:40 am    Post subject: Reply with quote

I updated my kernel, changed my /boot/grub/grub.conf to
Code:
default 0
timeout 30
splashimage=(hd0,0)/grub/splash.xpm.gz

title=Gentoo Linux 2.6.12-r10
root (hd0,0)
kernel /boot/kernel-2.6.16-gentoo-r3 acpi=off root=/dev/ram0 init-/linuxrc ramdisk=8192 real_root=/dev/hda3 udev
initrd /boot/initramfs-genkernel-x86-2.6.12-gentoo-r10


and rebooted. Now when I try to
Code:
emerge ivman
I still get the error
Code:
 * Determining the location of the kernel source code
 * Found kernel source directory:
 *     /usr/src/linux
 * Found sources for kernel version:
 *     2.6.12-gentoo-r10

!!! ERROR: sys-apps/hal-0.5.5.1-r3 failed.
!!! Function pkg_setup, Line 50, Exitcode 1
!!! You need a 2.6.13 or newer kernel to run this package
!!! If you need support, post the topmost build error, NOT this status message.



Why is it doing that?
_________________
Current project - carputer running.........Gentoo?
Back to top
View user's profile Send private message
Paapaa
l33t
l33t


Joined: 14 Aug 2005
Posts: 955
Location: Finland

PostPosted: Sun May 07, 2006 8:35 am    Post subject: Reply with quote

Maheriano wrote:
I updated my kernel, changed my /boot/grub/grub.conf...


I have to ask a few questions to verify a few things:

1. Did you use Genkernel or did you update your kernel manually ("make menuconfig, "make" etc.)? It looks like you used Genkernel when you installed Gentoo the first time and now you used the manual way.
2. If you did it manually, are you sure you have all the correct options/modules enabled in the kernel? Did you type "make oldconfig" at any point?
3. If you did it manually, you shouln't use Genkernel options for grub.conf, but rather those for manually compiled kernel. See these links for more:

Genkernel guide
Configuring the Bootloader

4. If you'd rather do this automated way with Genkernel, you should start over.
Back to top
View user's profile Send private message
Maheriano
l33t
l33t


Joined: 18 Jun 2005
Posts: 623
Location: Calgary, Alberta

PostPosted: Sun May 07, 2006 4:38 pm    Post subject: Reply with quote

Paapaa wrote:


I have to ask a few questions to verify a few things:

1. Did you use Genkernel or did you update your kernel manually ("make menuconfig, "make" etc.)? It looks like you used Genkernel when you installed Gentoo the first time and now you used the manual way.

Ya I used Genkernel to do it originally and yesterday I updated it manually using the steps in the second post with the make menuconfig and stuff. Not correct?

Paapaa wrote:

2. If you did it manually, are you sure you have all the correct options/modules enabled in the kernel? Did you type "make oldconfig" at any point?

I don't know what I have enabled in my kernel, it doesn't make a lot of sense to me. But it's working perfect now except for the fact it's not updating. And I never typed make oldconfig at all.

Paapaa wrote:

3. If you did it manually, you shouln't use Genkernel options for grub.conf, but rather those for manually compiled kernel. See these links for more:
Genkernel guide
Configuring the Bootloader

So I have to rewrite my grub.conf I guess?

Paapaa wrote:

4. If you'd rather do this automated way with Genkernel, you should start over.

uh oh
_________________
Current project - carputer running.........Gentoo?
Back to top
View user's profile Send private message
Paapaa
l33t
l33t


Joined: 14 Aug 2005
Posts: 955
Location: Finland

PostPosted: Mon May 08, 2006 10:47 am    Post subject: Reply with quote

Maheriano wrote:

Ya I used Genkernel to do it originally and yesterday I updated it manually using the steps in the second post with the make menuconfig and stuff. Not correct?


Yes, but only if you are sure all the needed device drivers and other options are correct - you have to go through each device you have. If you are 100% sure, then you can go on and alter grub.conf as stated in the "Configuring the Bootloader" link I gave. See the code listing 3 for an example. And never ever destroy your previous kernel and the grub.conf entry which works! You must always have a working kernel which you can start no matter what errors you make with a newer kernel.

If you are not sure how to manually configure a kernel, then you should probably use Genkernel as you did when installing Gentoo. You should then do as you did when installing (look at the Handbook "Configuring the Kernel"), just use the newer kernel sources. And when you have built all the needed images and copied them to /boot/ you have to add an entry to grub.conf. Now look at the code listing 4 in my link and edit it to suite your needs.

The best thing, IMO, would be to actually learn how to manually configure the kernel and to learn what various kernel options mean. You have to know exactly what hardware your computer has. Then you have to enable them all in your kernel. I don't use modules but I build everything I need within the kernel. That way I can see all the possible error messages with "dmesg". If you use modules, you have to search error messages elsewhere. Both ways have advantages. I also think you can use genkernel to give you a (probably) working .config. Then you can edit/compile it manually and proceed with a manual way. Someone else might help you with that.
Back to top
View user's profile Send private message
dsd
Developer
Developer


Joined: 30 Mar 2003
Posts: 2162
Location: nr London

PostPosted: Mon May 08, 2006 4:14 pm    Post subject: Reply with quote

Maheriano wrote:
and rebooted. Now when I try to
Code:
emerge ivman
I still get the error
Code:
 * Determining the location of the kernel source code
 * Found kernel source directory:
 *     /usr/src/linux
 * Found sources for kernel version:
 *     2.6.12-gentoo-r10

!!! ERROR: sys-apps/hal-0.5.5.1-r3 failed.
!!! Function pkg_setup, Line 50, Exitcode 1
!!! You need a 2.6.13 or newer kernel to run this package
!!! If you need support, post the topmost build error, NOT this status message.



Why is it doing that?


did you update the /usr/src/linux symbolic link to point at 2.6.16?
see http://www.gentoo.org/doc/en/kernel-upgrade.xml
_________________
http://dev.gentoo.org/~dsd
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum