Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[SOLVED] `uname -r` and `eselect kernel show` disagree
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
loveyourlinux
n00b
n00b


Joined: 21 Dec 2017
Posts: 3

PostPosted: Thu Dec 21, 2017 12:41 pm    Post subject: [SOLVED] `uname -r` and `eselect kernel show` disagree Reply with quote

I noticed this during the latest gentoo-sources upgrade, and now I'm not sure which kernel I'm running:
Code:
$ eselect kernel show
Current kernel symlink:
  /usr/src/linux-4.14.7-gentoo
$ uname -r
4.9.34-gentoo

It seems that the older kernel version is not around:
Code:
$ ls /usr/src
linux  linux-4.12.12-gentoo  linux-4.12.5-gentoo  linux-4.14.7-gentoo

How can I be sure that I'm using the latest kernel version? And why does `uname -r` disagree?
Thanks!


Last edited by loveyourlinux on Thu Dec 21, 2017 3:45 pm; edited 1 time in total
Back to top
View user's profile Send private message
fedeliallalinea
Bodhisattva
Bodhisattva


Joined: 08 Mar 2003
Posts: 21779
Location: here

PostPosted: Thu Dec 21, 2017 12:59 pm    Post subject: Reply with quote

uname -r report real kernel in use.
eselect change only symlink in /usr/src/ but not compile new kernel and not create new item in grub menu.
See https://wiki.gentoo.org/wiki/Kernel/Upgrade
Usually steps, with grub, are:
Code:
# eselect kernel set <number_of_desired_kernel>
... compilation of kernel manually or with genkernel, rember to copy old config ..
# grub-mkconfig -o /boot/grub/grub.cfg
# emerge @module-rebuild

At this point reboot and verify if new kernel boot, if works you can delete old kernel image in /boot and remove with emerge old version of sources


EDIT: welcome to forum!
_________________
Questions are guaranteed in life; Answers aren't.


Last edited by fedeliallalinea on Thu Dec 21, 2017 1:05 pm; edited 1 time in total
Back to top
View user's profile Send private message
guitou
Guru
Guru


Joined: 02 Oct 2003
Posts: 400
Location: France

PostPosted: Thu Dec 21, 2017 1:02 pm    Post subject: Reply with quote

Hello.

"uname -r" tells you which kernel version you are currently running.
"eselect kernel show" just tells you what /usr/src/linux does link to, and it is up to you to keep this up to date with your setup.

Edit: pas assez rapide, petit scarabee (not fast enough, tiny beetle)

++
Gi)
Back to top
View user's profile Send private message
loveyourlinux
n00b
n00b


Joined: 21 Dec 2017
Posts: 3

PostPosted: Thu Dec 21, 2017 3:07 pm    Post subject: Reply with quote

Thanks for the quick responses. Turns out I didn't do the whole process correctly. In particular, I missed the following steps:
Code:
# make modules_install
#make install
#grub-mkconfig -o /boot/grub/grub.cfg

I still haven't achieved to switch to the latest kernel though. `uname -r` informs me that I am still with 4.12.5, which incidentally is the oldest linux kernel still found in my computer:
Code:
$ uname -r
4.12.5-gentoo
$ ls /usr/src
linux  linux-4.12.12-gentoo  linux-4.12.5-gentoo  linux-4.14.7-gentoo


How can I switch to the last kernel? Should I delete all the previous kernels (manually or with `eclean-kernel -n 1`)? This seems a bit dangerous before I'm certain I have a working system on the latest kernel...

If relevant, here is the grub configuration output:
Code:
# grub-mkconfig -o /boot/grub/grub.cfg
Generating grub configuration file ...
Found linux image: /boot/kernel-genkernel-x86_64-4.12.5-gentoo
Found initrd image: /boot/initramfs-genkernel-x86_64-4.12.5-gentoo
Found linux image: /boot/kernel-genkernel-x86_64-4.9.34-gentoo
Found initrd image: /boot/initramfs-genkernel-x86_64-4.9.34-gentoo
Found linux image: /boot/vmlinuz-4.14.7-gentoo
Found linux image: /boot/vmlinuz-4.14.7-gentoo.old
done

(It also seems that grub doesn't forget the old kernel, 4.9.34, even though it's not around anymore. Do you think I should take further steps to completely purge this old kernel? If yes, what?)
Back to top
View user's profile Send private message
fedeliallalinea
Bodhisattva
Bodhisattva


Joined: 08 Mar 2003
Posts: 21779
Location: here

PostPosted: Thu Dec 21, 2017 3:27 pm    Post subject: Reply with quote

Only one question, why before you used genkernel and now manual procedure (with make and make install)?
Grub, if not setted in /etc/default/grub, use alphabetically order in menu and the first in your case is kernel-genkernel-x86_64-4.12.5-gentoo.
Then you need to choose correct kernel version in grub menu
_________________
Questions are guaranteed in life; Answers aren't.
Back to top
View user's profile Send private message
loveyourlinux
n00b
n00b


Joined: 21 Dec 2017
Posts: 3

PostPosted: Thu Dec 21, 2017 3:44 pm    Post subject: Reply with quote

I didn't use genkernel before either, probably that's why I didn't get it right.

You found my problem, thanks! Turns out that grub automatically choosing the first option, in combination with zero timeout, never gave me the option to choose the right kernel. I eventually chose the new kernel but unfortunately it doesn't work yet (keyboard and mouse are dead), so some more tweaking is due before switching to it. I'll dig the kernel and grub configuration a bit more and hope for the best!

Thank you very much!
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
Page 1 of 1

 
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