Skip to content

Kernel Rebuild & Deployment Workflow

If there has been an upgrade to gentoo-sources, follow the steps below to install the new kernel correctly.


Install installkernel

echo "sys-kernel/installkernel grub" >> /etc/portage/package.use/installkernel
emerge --ask sys-kernel/installkernel

Move to the new source code

cd /usr/src/linux

Get your current, working config

zcat /proc/config.gz > /usr/src/linux/.config

Kernel configuration migration (make olddefconfig)

make olddefconfig

Compile kernel

make -j$(nproc)

Install modules and the kernel itself

make modules_install
make install

Generate new initramfs (CRITICAL for your LUKS/LVM setup)

genkernel --luks --lvm --install initramfs

Install grub:2 if its the first time you will genereate grub.cfg

grub-install --target=x86_64-efi --efi-directory=/boot --bootloader-id="Gentoo Linux"

Update grub (Since you went back to GRUB for stability)

grub-mkconfig -o /boot/grub/grub.cfg