Compile Linux Kernel
Build your kernel can have many advantages, first you will have control over what is built into your kernel, in contrast of the default kernel that comes with your distribution that contain a lot of stuff, that you actually don't need, like extra filesystems, support for hardwares you don't have ..., so if you did it correctly and build your kernel, you will have smaller, faster kernel. you can also follow if you just want to upgrade to the latest version.
Preparation
install required build tools
doas pacman -S base-devel xmlto kmod inetutils bc libelf git cpio perl tar xzget latest kernel
wget https://cdn.kernel.org/pub/linux/kernel/v5.x/linux-5.6.9.tar.xzdecompress it
tar -xvf linux-5.6.9.tar.xzcd to it
cd linux-5.6.9clean the dir
make distcleanConfiguration
first you need to configure it. to use your default conf in your system:
zcat /proc/config.gz > .configthen check the conf and enable only features you will need:
make LLVM=1 menuconfigBuild
now we need to compile our kernel
make LLVM=1 -j$(nproc)Installation
intall modules first
doas make modules_install -j$(nproc)then the kernel itself
doas cp -v arch/x86_64/boot/bzImage /boot/vmlinuz-linux
doas cp -v System.map /boot/System-linux.mapgenerate initramfs
cp /etc/mkinitcpio.d/linux.preset /etc/mkinitcpio.d/linux99.presetamend the file according to your needs. then generate the initramfs
mkinitcpio -p linux99GRUB
finally we need to regenerates grub config
doas grub-mkconfig -o /boot/grub/grub.cfg