Skip to content

Recompile linux kernel

szorfein edited this page Apr 25, 2021 · 2 revisions

If you have to recompile the kernel, (it should happen :)), just look bellow how your system is configured.

Ext4 unencrypted

Only the ext4 unencrypted don't use genkernel, so just recompile the kernel as usually:

# make clean
# make -j$(nproc)
# make modules_install
# make install

And update Grub

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

Or systemd-boot

# mount /efi
# cp /boot/vmlinux-<VERSION>-gentoo-x86_64 /efi/vmlinuz
# bootctl --path /efi update

Genkernel

If you use an encrypted system, LVM or ZFS, you can use genkernel to recompile your kernel and your initramfs.

# genkernel all

Getch has alrealy configure the file /etc/genkernel.conf for your system.

Update Systemd-boot

For systemd-boot (all UEFI system), you need to copy the kernel and the initramfs to the esp (/boot/efi).

# mount /efi
# cp /boot/vmlinux-<VERSION>-gentoo-x86_64 /efi/vmlinuz
# cp /boot/initramfs-<VERSION>-gentoo-x86_64.img /efi/initramfs

And update with bootctl

# bootctl --path /efi update

It should be enought.

Grub

You have nothing to do with grub, genkernel make all automatically.

Clone this wiki locally