Hi I'm running gentoo and doing uname -a gives the wrong kernel version.

tony@P_P-o ~ $ uname -a
Linux P_P-o 2.6.27-gentoo-r8 #12 SMP PREEMPT Sun Nov 8 19:46:59 PST 2009 i686 Genuine Intel(R) CPU T2060 @ 1.60GHz GenuineIntel GNU/Linux

Running eix gentoo-sources shows that I have a later version than that installed:

tony@P_P-o ~ $ eix gentoo-sources
[U] sys-kernel/gentoo-sources
     Available versions:  
 (2.6.16-r13) 2.6.16-r13!b!s
 (2.6.25-r9) 2.6.25-r9!b!s
 (2.6.26-r4) 2.6.26-r4!b!s
 (2.6.27-r8) 2.6.27-r8!b!s
 (2.6.27-r10) 2.6.27-r10!b!s
 (2.6.28-r5) 2.6.28-r5!b!s
 (2.6.28-r6) 2.6.28-r6!b!s
 (2.6.29-r5) 2.6.29-r5!b!s
 (2.6.29-r6) 2.6.29-r6!b!s
 (2.6.30) ~2.6.30!b!s
 (2.6.30-r3) ~2.6.30-r3!b!s
 (2.6.30-r4) 2.6.30-r4!b!s
 (2.6.30-r5) 2.6.30-r5!b!s
 (2.6.30-r6) 2.6.30-r6!b!s
 (2.6.30-r7) 2.6.30-r7!b!s
 (2.6.30-r8) 2.6.30-r8!b!s
 (2.6.31) ~2.6.31!b!s
 (2.6.31-r1) ~2.6.31-r1!b!s
 (2.6.31-r2) ~2.6.31-r2!b!s
 (2.6.31-r3) ~2.6.31-r3!b!s
 (2.6.31-r4) ~2.6.31-r4!b!s
 {build symlink ultra1}
     Installed versions:  2.6.27-r8(2.6.27-r8)!b!s(07:48:25 PM 06/19/2009)(-build -symlink)
     2.6.28-r5(2.6.28-r5)!b!s(12:35:17 PM 06/08/2009)(-build -symlink)
     2.6.29-r5(2.6.29-r5)!b!s(07:44:33 PM 06/19/2009)(-build -symlink)
     2.6.30-r6(2.6.30-r6)!b!s(11:14:45 PM 10/02/2009)(-build -symlink)
     Homepage:            http://dev.gentoo.org/~dsd/genpatches
     Description:         Full sources including the Gentoo patchset for the 2.6 kernel tree

What gives?


You need to manage the kernel symlink, as alluded to by Mike Nelsen, but gentoo provides an eselect wrapper to do this, in the same way that they allow you to manage the system versions of gcc/ruby/python/java/rails/opengl/etc. implementations when you have multiple slots installed.

In your case, the kernel sources are all installed (examine /usr/src and you'll see a versioned directory for each there, plus the symlink that points to the current default, /usr/src/linux). Typically, you'll be building from the symlink directory, and its best to keep that current, as it is where portage checks for kernel configure options for ebuilds that require them and so on.

eselect kernel show   # will show you the current symlink value, this should match uname -a
eselect kernel list   # should show all installed kernel sources
eselect kernel set x  # will update the symlink, either by number (from list), or full name

Additionally, you can set the symlink USE flag in /usr/portage/package.use for gentoo-sources (or any other kernel sources you manage with portage) to have the symlink automatically updated when you emerge a new version, though if this is the case you should be aware of it and make sure that you build and install the new kernel after each emerge, which is a little too often for my tastes, but YMMV.

nb. This method only works for portage (or paludis/pkgcore/etc.) package managed kernel sources - if you have a git repo in $HOME or something, eselect obviously won't pick up on it - this is by design, since your bleeding edge or locally patched checkout is not usually meant for the system kernel.


My guess is that you installed newer sources (maybe even built them), but you're still booting off of an older kernel.

  • I don't think that's it, I copy arch/x86/boot/bzImage to /boot/vmlinuz every time. I'll double check my grub.conf though.
    – freedrull
    Nov 9 '09 at 19:48

Are you updating your /usr/src/linux link to point at the current sources? For example, this is what I normally do for a kernel upgrade on my gentoo boxes,

# cp /usr/src/linux/.config ~
# cd /usr/src
# rm linux                              # remove the /usr/src/linux link
# ln -s linux-2.6.30-gentoo-r6 linux    # point /usr/src/linux to the latest sources
# cd linux
# cp ~/.config .
# make silentoldconfig                  # update .config for any new stuff in the kernel
# make && make modules_install
# mount /boot
# make install  # install the kernel to /boot and keep a copy of your old kernel in /boot in case
# umount /boot

My kernel date and # given by uname -a were showing the first kernel I built, despite me building much more recent kernels which could be seen in /boot.

My problem was that /boot was not being mounted correctly in my fstab. The /boot I was seeing was just a directory in the root filesystem.

I fixed the problem by removing all files in this "fake" /boot, mounting the proper boot partition to /boot and then running make install for the kernel again.


You emerge four different versions of gentoo-sources.

Try uninstalling every old gentoo-sources to only keep the most recent one, then recompile your kernel.

Does it work ?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.