Kernel isn’t managed under the main repositories, even though you could package one for your personal use. Here is an example kernel package, which you will need to reconfigure for your specific setup if you want to make use of it.
You can visit the https://kernel.org website to choose a kernel that you want to install. Though only the latest stable and longterm (LTS) versions are supported.
Download the kernel and extract it $ wget https://cdn.kernel.org/pub/linux/kernel/v5.x/linux-5.7.6.tar.xz $ tar xf linux-5.7.6.tar.xz Change directory into the kernel sources $ cd linux-5.7.6
In order to compile the kernel you will need to install some dependencies. You
libelf to compile the kernel. If you want to configure using the menu
interface you will also need
The package manager asks to install if you are building more than one package, so no need to run 'cpt i ...' $ cpt b libelf ncurses
In the vanilla kernel sources, you need perl to compile the kernel, but it can be easily patched out. You will need to apply the following patch. Patch was written by E5ten. You will need to obtain and apply the patch in the kernel source directory.
$ wget https://dl.carbslinux.org/distfiles/kernel-no-perl.patch $ patch -p1 < kernel-no-perl.patch
Next step is configuring and building the kernel. You can check Gentoo’s kernel configuration guide to learn more about the matter. Overall, Gentoo Wiki is a good place to learn about configuration according to your hardware. The following will assume a monolithic kernel.
$ make menuconfig $ make $ install -Dm755 $(make -s image_name) /boot/vmlinuz-linux