HOWTO: Upgrade kernel using Entropy

From Sabayon Wiki
Revision as of 14:07, 23 November 2012 by Aposteeltje (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
i18n: de en it pl

How-to upgrade kernel with Entropy

Question.png
Switching your kernel using kernel-switcher is the easiest way, and actually recommended,

as it also installs the right kernel modules/drivers. Check for more information on

Entropy:Using Kernel Switcher !


Stop.png
Kernel versions may vary!


Stop.png
Do not reboot until you have completed all the steps in this article!


This How-to helps you to update your kernel by using the Entropy package manager.

First of all you must update the Entropy package manager to the latest version to overcome other issues. Become root by using the su command:

 $ su 

Press Enter, type the root password then press Enter again. Now you can update the package manager. First of all update the repositories:

 # equo update 

If equo tells you there is a newer Entropy version available, you should install it:

 # equo install entropy 

Sometimes you need to update configuration files too, so use the command:

 # equo conf update 

and follow its instructions. Entropy is now up-to-date and we can move on to installing the latest kernel image:

 # equo install --ask linux-sabayon 

The output should look something like this:

 # equo install --ask linux-sabayon
>>  @@ These are the chosen packages:
>>    # (1/1) [sabayonlinux.org] sys-kernel/linux-sabayon-2.6.36-r1
>>     Versions: Not installed / NoTag / NoRev ===> 2.6.36-r1 / NoTag / 0
>> 	Action:		 Install
>>  @@ Packages involved: 1
     Would you like to continue with dependencies calculation ? [Yes/No]  y 

Let that install.

Once done, you need to select the kernel with eselect and install all kernel-related drivers that have been rebuilt to work with the new kernel. To show the list of kernels you can select, run:

 # eselect kernel list 

The output would look like this:

 # eselect kernel list
Available kernel symlink targets:
  [1]   linux-2.6.35-sabayon
  [2]   linux-2.6.36-sabayon *
 

As you can see there are two kernel entries and we need to select the latest, which is number [2]. In the example above, the correct kernel is already selected (indicated by the *). Should you need to select a kernel, e.g. [2] run:

 # eselect kernel set 2 

Now the kernel symlink is set to the new kernel and we can install the updated kernel drivers. We need to look for the drivers that are installed for the old kernel, so that we can install the appropriate versions for our new kernel.

One way is to search the installed packages for the old kernel version and redirect the output to a file which you can look into later to select the drivers you need.

# equo query installed 2.6.35-sabayon > kernel-upgrade.txt

Open another terminal and read the file:

 # less kernel-upgrade.txt 

Look through the list and write down the packages that need to be installed for the new kernel. You can whittle down the number of installed packages in the search to just those that are specifically kernel-related by filtering using grep as follows:

# equo query installed 2.6.35-sabayon | grep '#'

For example:

# equo query installed 2.6.35-sabayon | grep '#'
>>      @@ Package: app-emulation/virtualbox-guest-additions-3.2.12#2.6.35-sabayon branch: 5, [__system__] 
>>      @@ Package: net-wireless/broadcom-sta-5.60.48.36-r1#2.6.35-sabayon branch: 5, [__system__] 
>>      @@ Package: net-wireless/ndiswrapper-1.56#2.6.35-sabayon branch: 5, [__system__] 
>>      @@ Package: x11-drivers/xf86-video-virtualbox-3.2.12#2.6.35-sabayon branch: 5, [__system__] 

Equo is able to resolve the latest version of a specific kernel module on its own. The install line for the example above, should look something like this:

# equo install --ask virtualbox-guest-additions#2.6.36-sabayon broadcom-sta#2.6.36-sabayon ndiswrapper#2.6.36-sabayon xf86-video-virtualbox#2.6.36-sabayon

which is resolved by Equo to the following versions:

>>  @@ These are the chosen packages:
>>    # (1/4) [sabayonlinux.org] app-emulation/virtualbox-guest-additions-3.2.12#2.6.36-sabayon
>>     Versions: Not installed / NoTag / NoRev ===> 3.2.12 / 2.6.36-sabayon / 0
>> 	Action:		 Install
>>    # (2/4) [sabayonlinux.org] net-wireless/broadcom-sta-5.60.246.2-r1#2.6.36-sabayon
>>     Versions: Not installed / NoTag / NoRev ===> 5.60.246.2-r1 / 2.6.36-sabayon / 2
>> 	Action:		 Install
>>    # (3/4) [sabayonlinux.org] net-wireless/ndiswrapper-1.56#2.6.36-sabayon
>>     Versions: Not installed / NoTag / NoRev ===> 1.56 / 2.6.36-sabayon / 1
>> 	Action:		 Install
>>    # (4/4) [sabayonlinux.org] x11-drivers/xf86-video-virtualbox-3.2.12#2.6.36-sabayon
>>     Versions: Not installed / NoTag / NoRev ===> 3.2.12 / 2.6.36-sabayon / 0
>> 	Action:		 Install
>>  @@ Packages involved: 4
     Would you like to continue with dependencies calculation ? [Yes/No] y

Once that is finished, all drivers are updated for the latest kernel and you should be safe to reboot into the new kernel.


Stop.png
The instructions below are for Grub1 a.k.a. Grub Legacy. The modifications for Grub2 (SL 5.2 and onwards) are different and Entropy will automatically modify the Grub2 grub.cfg file, so you do not need to do anything.

You'd only need to edit your grub.conf to put the latest kernel in front. After the kernel is installed, your grub.conf should look like this:

File: Old /boot/grub/grub.conf
 # grub.conf generated by the Sabayon Linux Installer
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE:  You do not have a /boot partition.  This means that
#          all kernel and initrd paths are relative to /, eg.
#          root (hd1,0)
#          kernel /boot/kernel-genkernel real_root=/dev/sdb1
#          initrd /boot/initramfs-genkernel
#boot=sda
default=0
timeout=6
splashimage=(hd1,0)/boot/grub/splash.xpm.gz

title Sabayon Linux x86 (genkernel-x86-2.6.27-sabayon)
	root (hd1,0)
	kernel /boot/kernel-genkernel-x86-2.6.27-sabayon  root=/dev/ram0 ramdisk=8192 real_root=/dev/sdb1 dolvm  quiet  init=/linuxrc splash=silent,theme:sabayon vga=791 CONSOLE=/dev/tty1 resume=swap:/dev/sdb3
	initrd /boot/initramfs-genkernel-x86-2.6.27-sabayon

title Sabayon Linux x86 (genkernel-x86-2.6.27-sabayon) (safe mode)
	root (hd1,0)
	kernel /boot/kernel-genkernel-x86-2.6.27-sabayon root=/dev/ram0 ramdisk=8192 real_root=/dev/sdb1 dolvm init=/linuxrc CONSOLE=/dev/tty1 resume=swap:/dev/sdb3 nox acpi=off ide=nodma vga=normal
	initrd /boot/initramfs-genkernel-x86-2.6.27-sabayon

title=Sabayon Linux (kernel-genkernel-x86-2.6.28-sabayon)
	root (hd1,0)
	kernel /boot/kernel-genkernel-x86-2.6.28-sabayon root=/dev/ram0 ramdisk=8192 real_root=/dev/sdb1 dolvm  quiet  init=/linuxrc splash=silent,theme:sabayon vga=791 CONSOLE=/dev/tty1 resume=swap:/dev/sdb3
	initrd /boot/initramfs-genkernel-x86-2.6.28-sabayon 

Now there are a couple things you can do to make the latest kernel default, you can change the line 'default=0' to 'default=2' (grub count starts at 0).

The other thing you can do is move the boot lines for the latest kernel to the top and if you like so, add a new (safe mode) for the new kernel too.

After the change your grub.conf should look like this:

File: New /boot/grub/grub.conf
 # grub.conf generated by the Sabayon Linux Installer
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE:  You do not have a /boot partition.  This means that
#          all kernel and initrd paths are relative to /, eg.
#          root (hd1,0)
#          kernel /boot/kernel-genkernel real_root=/dev/sdb1
#          initrd /boot/initramfs-genkernel
#boot=sda
default=0
timeout=6
splashimage=(hd1,0)/boot/grub/splash.xpm.gz

title=Sabayon Linux (kernel-genkernel-x86-2.6.28-sabayon)
	root (hd1,0)
	kernel /boot/kernel-genkernel-x86-2.6.28-sabayon root=/dev/ram0 ramdisk=8192 real_root=/dev/sdb1 dolvm  quiet  init=/linuxrc splash=silent,theme:sabayon vga=791 CONSOLE=/dev/tty1 resume=swap:/dev/sdb3
	initrd /boot/initramfs-genkernel-x86-2.6.28-sabayon

title Sabayon Linux x86 (genkernel-x86-2.6.28-sabayon) (safe mode)
	root (hd1,0)
	kernel /boot/kernel-genkernel-x86-2.6.28-sabayon root=/dev/ram0 ramdisk=8192 real_root=/dev/sdb1 dolvm init=/linuxrc CONSOLE=/dev/tty1 resume=swap:/dev/sdb3 nox acpi=off ide=nodma vga=normal
	initrd /boot/initramfs-genkernel-x86-2.6.28-sabayon

title Sabayon Linux x86 (genkernel-x86-2.6.27-sabayon)
	root (hd1,0)
	kernel /boot/kernel-genkernel-x86-2.6.27-sabayon  root=/dev/ram0 ramdisk=8192 real_root=/dev/sdb1 dolvm  quiet  init=/linuxrc splash=silent,theme:sabayon vga=791 CONSOLE=/dev/tty1 resume=swap:/dev/sdb3
	initrd /boot/initramfs-genkernel-x86-2.6.27-sabayon

title Sabayon Linux x86 (genkernel-x86-2.6.27-sabayon) (safe mode)
	root (hd1,0)
	kernel /boot/kernel-genkernel-x86-2.6.27-sabayon root=/dev/ram0 ramdisk=8192 real_root=/dev/sdb1 dolvm init=/linuxrc CONSOLE=/dev/tty1 resume=swap:/dev/sdb3 nox acpi=off ide=nodma vga=normal
	initrd /boot/initramfs-genkernel-x86-2.6.27-sabayon 

Save and close the file.

After all that you can reboot and test the new kernel entry.

Good Luck.

--dyingmuppet 16:19, 22 February 2009 (UTC)