HOWTO: Upgrade kernel using genkernel
Open a Konsole/Terminal window and use the su command to log in as the root user.
If you have a separate boot partition, make sure it is mounted onto /boot before proceeding. For example, if the boot partition is /dev/sda3 then:
# mount /dev/sda3 /boot
Update portage and genkernel first, then install the newest kernel source code:
# emerge --sync && layman -S
# emerge genkernel
# USE="sources_standalone" emerge sabayon-sources
# eselect kernel list
Note which kernel in the list you want to install. It has a number like this next to it: [x]. More than likely x = 2 [2]. Now use this number in the following command, in order to set the symlink to the new version of the kernel:
# eselect kernel set x
# zcat /proc/config.gz > /usr/src/config
Do the following if you manually edited your partitions:
# genkernel --kernel-config=/usr/src/config --menuconfig --splash=sabayon --disklabel --luks all
Do the following if you used anaconda's automatic diskdruid or created a lvm:
# genkernel --kernel-config=/usr/src/config --menuconfig --splash=sabayon --disklabel --lvm --luks all
When you get into the linux kernel menu where you can go and edit all sorts of linux kernel variables (and it's very tempting to mess with), unless you are very, VERY well versed in understanding what it is you are doing, the default settings are good and reliable to start with and will create a kernel that actually WORKS.
SO, you can simply exit and save without changing anything, this way your kernel will compile and you can actually boot into it.
Then we need to rebuild our modules and such to make sure everything works with the new kernel. So do:
# module-rebuild rebuild
Sometimes this will fail if old modules are still around, so you might need to re-emerge your video drivers
I had to re-emerge my nvidia drivers because the old drivers were no longer in the portage tree:
# emerge nvidia-drivers
OR, if you have an ATI GPU:
# emerge ati-drivers
and if it says that ati-drivers-<version> is unavailable, try:
# module-rebuild del ati-drivers-<version>
If you still have problems, you can clean-out and renew your moduledb first like this:
# rm /var/lib/module-rebuild/moduledb # module-rebuild populate # module-rebuild rebuild
Note that the latest kernel has built-in wireless stuff, causing the wireless modules to fail the module-rebuild. The trick is to make sure the wireless stuff is enabled during the kernel compile.
Currently genkernel only knows about Grub Legacy, so you will need to regenerate the Grub2 grub.cfg file after completing the above, using the following command:
# grub2-mkconfig -o /boot/grub/grub.cfg
Any questions/problems/comments can be posted on the forums.
Now, reboot.
Choose to boot into your freshly compiled kernel, the old reliable one will still be there and may be a nice backup for safe keeping so, don't worry about getting rid of it.
There you have it. It will take some time, but it's good.
Unsupported kernels
For other unsupported kernels, please have a look at the unsupported software section at the Gentoo forums.
Most unsupported kernels are in the custom-kernels overlay which is accessible with Layman.
# layman -a custom-kernels
WARNING No. 1: Think carefully about what you are trying to achieve here, i.e. do you want to upgrade to a newer version of the kernel or do you want to rebuild the same version of the kernel you are currently using (perhaps, optionally, making some manual changes to the kernel configuration)? Note that the zcat command mentioned above creates a configuration file based on the currently-running kernel. However, the configuration of the current kernel may not be suitable for the new version of the kernel sources you just merged (downloaded). It could be that you want or need to use a configuration file for the new version of kernel you have just merged. To give a hypothetical example in order to try and illustrate the distinction, let's suppose you are currently running the 2.6.22 kernel but now want to build the 2.6.25 kernel. In which case you would not need to bother with the zcat command as some of the configuration parameters in the 2.6.22 kernel do not exist in the 2.6.25 kernel (and vice versa), so instead of using a file /usr/src/config you could create using zcat, you would instead use the .config file (notice the dot) in the directory /usr/src/linux-2.6.25-sabayon/ created when you merged linux-sabayon-2.6.25 earlier, which is different from the .config file (and config file created by zcat) for the 2.6.22 kernel. In other words, you would instead use the command:
# genkernel --kernel-config=/usr/src/linux-2.6.25-sabayon/.config --menuconfig --bootloader=grub --splash=sabayon --disklabel all
(or
# genkernel --kernel-config=/usr/src/linux-2.6.25-sabayon/.config --menuconfig --bootloader=grub --splash=sabayon --disklabel --lvm all
if you used anaconda's automatic diskdruid or created a lvm.)
Notice the difference between "--kernel-config=/usr/src/config" ( the file "config" would be created by using the zcat command) and "--kernel-config=/usr/src/linux-2.6.25-sabayon/.config" (the file ".config" would be created when you merge linux-sabayon-2.6.25).
Note also that the file /usr/src/linux-2.6.25-sabayon/.config would be the same as the file /usr/portage/local/layman/sabayon/sys-kernel/linux-sabayon/files/linux-sabayon-2.6.25-x86.config if you merged linux-sabayon-2.6.25 for the x86 edition of Sabayon Linux, or the file /usr/portage/local/layman/sabayon/sys-kernel/linux-sabayon/files/linux-sabayon-2.6.25-amd64.config if you merged linux-sabayon-2.6.25 for the x86_64 edition of Sabayon Linux. Thus, if you run one of the above commands and an error message is displayed to the effect that /usr/src/linux-2.6.25-sabayon/.config cannot be opened, then try using --kernel-config=/usr/portage/local/layman/sabayon/sys-kernel/linux-sabayon/files/linux-sabayon-2.6.25-x86.config (or /usr/portage/local/layman/sabayon/sys-kernel/linux-sabayon/files/linux-sabayon-2.6.25-amd64.config if you have the 64-bit edition of SL installed). Note also that the default location of the Portage overlay sources has been changed from directory /usr/portage/local/layman/ to directory /usr/local/portage/layman/ in the latest version of SL (and Gentoo), so modify the aforementioned command accordingly if you are using SL 4.0 and onwards. For example, in the case of the 2.6.31 kernel the switch would be the following for the x86 edition:
--kernel-config=/usr/local/portage/layman/sabayon/sys-kernel/linux-sabayon/files/linux-sabayon-2.6.31-x86.config
and the following for the x86_64 edition:
--kernel-config=/usr/local/portage/layman/sabayon/sys-kernel/linux-sabayon/files/linux-sabayon-2.6.31-amd64.config