Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index Assistance Kernel & Hardware
  • Search

How do I update my kernel? [SOLVED]

Kernel not recognizing your hardware? Problems with power management or PCMCIA? What hardware is compatible with Gentoo? See here. (Only for kernels supported by Gentoo.)
Post Reply
Advanced search
41 posts
  • 1
  • 2
  • Next
Author
Message
Maheriano
l33t
l33t
Posts: 623
Joined: Sat Jun 18, 2005 9:46 pm
Location: Calgary, Alberta

How do I update my kernel? [SOLVED]

  • Quote

Post by Maheriano » Mon May 01, 2006 6:09 pm

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.
Last edited by Maheriano on Wed May 10, 2006 9:54 pm, edited 1 time in total.
Current project - carputer running.........Gentoo?
Top
_loki_
l33t
l33t
Posts: 680
Joined: Thu Dec 18, 2003 1:30 pm
Location: in the shell

  • Quote

Post by _loki_ » Mon May 01, 2006 6:19 pm

Code: Select all

emerge --sync && emerge gentoo-sources
then change /usr/src/linux pointing to the new kernel sources

Code: Select all

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: Select all

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: Select all

make && make modules_install
and copy the image to /boot

Code: Select all

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: Select all

emerge -C gentoo-sources-2.6.12-r10
Top
dsd
Developer
Developer
Posts: 2162
Joined: Sun Mar 30, 2003 10:54 am
Location: nr London

  • Quote

Post by dsd » Mon May 01, 2006 7:01 pm

http://www.gentoo.org/doc/en/kernel-upgrade.xml
http://dev.gentoo.org/~dsd
Top
Maheriano
l33t
l33t
Posts: 623
Joined: Sat Jun 18, 2005 9:46 pm
Location: Calgary, Alberta

  • Quote

Post by Maheriano » Tue May 02, 2006 4:31 am

What happened?

Code: Select all

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?
Top
mikegpitt
Advocate
Advocate
User avatar
Posts: 3224
Joined: Sat May 22, 2004 6:49 pm

  • Quote

Post by mikegpitt » Tue May 02, 2006 4:34 am

I think the problem is with your symlink. It should read

Code: Select all

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

Code: Select all

ln -sf /usr/src/linux/linux-2.6.16-gentoo-version /usr/src/linux 
(note the extra /linux in the version you posted)
Top
Maheriano
l33t
l33t
Posts: 623
Joined: Sat Jun 18, 2005 9:46 pm
Location: Calgary, Alberta

  • Quote

Post by Maheriano » Tue May 02, 2006 4:51 am

mikegpitt wrote:I think the problem is with your symlink. It should read

Code: Select all

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

Code: Select all

ln -sf /usr/src/linux/linux-2.6.16-gentoo-version /usr/src/linux 
(note the extra /linux in the version you posted)

Code: Select all

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?
Top
Mickael
Advocate
Advocate
User avatar
Posts: 2387
Joined: Mon Sep 05, 2005 11:17 am
Location: ~Belfort! - France - EU
Contact:
Contact Mickael
Website

  • Quote

Post by Mickael » Tue May 02, 2006 6:26 am

Hello,
Maheriano wrote:

Code: Select all

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
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
Top
Paapaa
l33t
l33t
User avatar
Posts: 955
Joined: Sun Aug 14, 2005 8:45 am
Location: Finland

  • Quote

Post by Paapaa » Tue May 02, 2006 6:53 am

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.
Top
_loki_
l33t
l33t
Posts: 680
Joined: Thu Dec 18, 2003 1:30 pm
Location: in the shell

  • Quote

Post by _loki_ » Tue May 02, 2006 8:40 am

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..
-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.
Top
Maheriano
l33t
l33t
Posts: 623
Joined: Sat Jun 18, 2005 9:46 pm
Location: Calgary, Alberta

  • Quote

Post by Maheriano » Thu May 04, 2006 4:43 am

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: Select all

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?
Top
cartpullerjack
Apprentice
Apprentice
Posts: 185
Joined: Sun Nov 16, 2003 5:19 am

  • Quote

Post by cartpullerjack » Thu May 04, 2006 5:30 am

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

Technically, though, you have an i686 processor.
Top
Maheriano
l33t
l33t
Posts: 623
Joined: Sat Jun 18, 2005 9:46 pm
Location: Calgary, Alberta

  • Quote

Post by Maheriano » Thu May 04, 2006 6:00 am

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?
Top
Maheriano
l33t
l33t
Posts: 623
Joined: Sat Jun 18, 2005 9:46 pm
Location: Calgary, Alberta

  • Quote

Post by Maheriano » Thu May 04, 2006 6:03 am

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: Select all

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?
Top
_loki_
l33t
l33t
Posts: 680
Joined: Thu Dec 18, 2003 1:30 pm
Location: in the shell

  • Quote

Post by _loki_ » Thu May 04, 2006 8:05 am

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: Select all

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: Select all

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..
Top
cartpullerjack
Apprentice
Apprentice
Posts: 185
Joined: Sun Nov 16, 2003 5:19 am

  • Quote

Post by cartpullerjack » Thu May 04, 2006 2:26 pm

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.
Top
Maheriano
l33t
l33t
Posts: 623
Joined: Sat Jun 18, 2005 9:46 pm
Location: Calgary, Alberta

  • Quote

Post by Maheriano » Thu May 04, 2006 5:17 pm

Better?

Code: Select all

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: Select all

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?
Top
sundialsvc4
Guru
Guru
Posts: 436
Joined: Thu Nov 10, 2005 12:50 am

  • Quote

Post by sundialsvc4 » Thu May 04, 2006 6:50 pm

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.)
Top
Maheriano
l33t
l33t
Posts: 623
Joined: Sat Jun 18, 2005 9:46 pm
Location: Calgary, Alberta

  • Quote

Post by Maheriano » Fri May 05, 2006 11:57 pm

:?:
Current project - carputer running.........Gentoo?
Top
_loki_
l33t
l33t
Posts: 680
Joined: Thu Dec 18, 2003 1:30 pm
Location: in the shell

  • Quote

Post by _loki_ » Sat May 06, 2006 8:08 am

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:
kernel /boot/kernel-2.6.16-gentoo-r3 acpi=off root=/dev/ram0 init$
$ impilcates that there is something more in that line..
Top
Paapaa
l33t
l33t
User avatar
Posts: 955
Joined: Sun Aug 14, 2005 8:45 am
Location: Finland

  • Quote

Post by Paapaa » Sat May 06, 2006 6:01 pm

_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.
Top
Maheriano
l33t
l33t
Posts: 623
Joined: Sat Jun 18, 2005 9:46 pm
Location: Calgary, Alberta

  • Quote

Post by Maheriano » Sun May 07, 2006 3:40 am

I updated my kernel, changed my /boot/grub/grub.conf to

Code: Select all

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: Select all

emerge ivman
I still get the error

Code: Select all

 * 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?
Top
Paapaa
l33t
l33t
User avatar
Posts: 955
Joined: Sun Aug 14, 2005 8:45 am
Location: Finland

  • Quote

Post by Paapaa » Sun May 07, 2006 8:35 am

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.
Top
Maheriano
l33t
l33t
Posts: 623
Joined: Sat Jun 18, 2005 9:46 pm
Location: Calgary, Alberta

  • Quote

Post by Maheriano » Sun May 07, 2006 4:38 pm

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?
Top
Paapaa
l33t
l33t
User avatar
Posts: 955
Joined: Sun Aug 14, 2005 8:45 am
Location: Finland

  • Quote

Post by Paapaa » Mon May 08, 2006 10:47 am

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.
Top
dsd
Developer
Developer
Posts: 2162
Joined: Sun Mar 30, 2003 10:54 am
Location: nr London

  • Quote

Post by dsd » Mon May 08, 2006 4:14 pm

Maheriano wrote:and rebooted. Now when I try to

Code: Select all

emerge ivman
I still get the error

Code: Select all

 * 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
Top
Post Reply

41 posts
  • 1
  • 2
  • Next

Return to “Kernel & Hardware”

Jump to
  • Assistance
  • ↳   News & Announcements
  • ↳   Frequently Asked Questions
  • ↳   Installing Gentoo
  • ↳   Multimedia
  • ↳   Desktop Environments
  • ↳   Networking & Security
  • ↳   Kernel & Hardware
  • ↳   Portage & Programming
  • ↳   Gamers & Players
  • ↳   Other Things Gentoo
  • ↳   Unsupported Software
  • Discussion & Documentation
  • ↳   Documentation, Tips & Tricks
  • ↳   Gentoo Chat
  • ↳   Gentoo Forums Feedback
  • ↳   Duplicate Threads
  • International Gentoo Users
  • ↳   中文 (Chinese)
  • ↳   Dutch
  • ↳   Finnish
  • ↳   French
  • ↳   Deutsches Forum (German)
  • ↳   Diskussionsforum
  • ↳   Deutsche Dokumentation
  • ↳   Greek
  • ↳   Forum italiano (Italian)
  • ↳   Forum di discussione italiano
  • ↳   Risorse italiane (documentazione e tools)
  • ↳   Polskie forum (Polish)
  • ↳   Instalacja i sprzęt
  • ↳   Polish OTW
  • ↳   Portuguese
  • ↳   Documentação, Ferramentas e Dicas
  • ↳   Russian
  • ↳   Scandinavian
  • ↳   Spanish
  • ↳   Other Languages
  • Architectures & Platforms
  • ↳   Gentoo on ARM
  • ↳   Gentoo on PPC
  • ↳   Gentoo on Sparc
  • ↳   Gentoo on Alternative Architectures
  • ↳   Gentoo on AMD64
  • ↳   Gentoo for Mac OS X (Portage for Mac OS X)
  • Board index
  • All times are UTC
  • Delete cookies

© 2001–2026 Gentoo Foundation, Inc.

Powered by phpBB® Forum Software © phpBB Limited

Privacy Policy