Do you also do the same thing every time a new kernel ends up in your /usr/portage? Here’s a Ruby script that does all required steps automatically for you:

  • The kernel symlink gets updated to point to the latest kernel in /usr/src/.
  • An existing .config file gets copied from the previously used kernel.
  • genkernel is used to compile the new kernel.
  • The kernel gets installed on your /boot partition.
  • /boot/grub/grub.conf gets updated (please check manually before booting) to use the new kernel.
  • Optionally you may specify a splash image to use and kernel modules that get automatically emerged.

Here’s an example configuration file /etc/update-kernel.conf:

# your boot partition in grub syntax
$boot_partition = "(hd0,0)"
# your root partition in /etc/fstab syntax
$root_partition = "/dev/hda3"

# the splash image you want to use (optional)
$splash_theme = "emergence"
# additional parameters to pass to genkernel (optional)
#$genkernel_parameters = "--menuconfig"
# additional kernel parameters to put into grub.conf (optional)
$kernel_parameters = "vga=0x317 ramdisk=8192"
# kernel modules to emerge after a kernel update (optional, 
# known to work with alsa and nvidia)
$modules = "alsa-driver nvidia-drivers"

Download: Version 0.1