. Step 5 - Installing the kernel Previous page

Step 5 - Installing the kernel

It is now time to proceed with the installation of the kernel and the base drivers.

Firmware

First install the firmware metapackage:

emerge --ask linux-firmware

Some newer Intel devices require an additional sound driver, the Sound Open Firmware (SOF):

emerge --ask sof-firmware

If you have an AMD CPU or APU, the microcode for it is contained in the firmware metapackage we installed. If you have an Intel CPU, you need to install the microcode explicitely, since it comes in a separate package:

emerge --ask intel-microcode

Installkernel

We are going to install Installkernel, a script which automates the tasks linked to the kernel. We need to create a file for it in the package.use folder of Portage. Create the file /etc/portage/package.use/installkernel. Type in it the following line and save, then exit:

sys-kernel/installkernel grub dracut

Then, install the script:

emerge --ask installkernel

The file we just created will have as an effect that the installation of Installkernel will trigger the installation of GRUB (the bootloader) and of Dracut (Initramfs generator). It's a plus: we will not need to install them later.

Kernel installation

It is now time to install the kernel with the following command:

emerge --ask gentoo-kernel-bin

Once done, remove the obsolete packages if there are any:

emerge --ask --depclean

We now need to add an USE flag to the Portage make.conf file, since we are using a distribution kernel. Add the dist-kernel USE flag. Here is what the line could look like in the file:

USE="dist-kernel"

Once the file saved, let's proceed with the next step of our installation.

Next page