Skip to content

Instantly share code, notes, and snippets.

Created November 8, 2019 20:22
What would you like to do?
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,}-genkernel-x86_64-${name:?}
rm -rf /lib/modules/${name:?}
# 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