Gentoo kernel build script

Automating the kernel compile, configuration copying, systemd-boot and grub2 configuration updating, old kernel cleaning script for Gentoo Linux.


  • First, clone this repository and change directory:

git clone
cd kernel-build
  • Change script permissons:

chmod +x
  • If you are using systemd-boot you should first learn rootfs disk UUID or LVM partition and then add it to the script:


Optional: You can add specific kernel parameters to ROOTFLAGS.

  • Now you execute the script like so:

./ systemd-boot
  • If you are using grub2:

./ grub2