Skip to content

Instantly share code, notes, and snippets.

@rohithreddy
Created November 8, 2019 20:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rohithreddy/56c6e65255ea86006a21f669c00b7560 to your computer and use it in GitHub Desktop.
Save rohithreddy/56c6e65255ea86006a21f669c00b7560 to your computer and use it in GitHub Desktop.
Gentoo Kernel upgrade / build
eselect kernel list
eselect kernel set #
# Use current kernel config and store copy
gunzip /proc/config.gz -c > /root/config; cp /root/config /root/config-$(uname -r)
# Optionally change module settings in the config file, or use --menuconfig
# with genkernel.
genkernel --makeopts=-j9 --splash --kernel-config=/root/config all
# Update packages with kernel modules
emerge -1 @module-rebuild
# Cleanup old files
for name in $(ls /lib/modules/ | sort -V | head -n -3); do
rm -rf /boot/{initramfs,kernel,System.map}-genkernel-x86_64-${name:?}
rm -rf /lib/modules/${name:?}
done
# Update boot config file
grub-mkconfig -o /boot/grub/grub.cfg
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment