Skip to content

Instantly share code, notes, and snippets.

@vStone
Created December 4, 2017 15:12
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 vStone/1a3a3a80bc7570e58f8f1fa0d8133637 to your computer and use it in GitHub Desktop.
Save vStone/1a3a3a80bc7570e58f8f1fa0d8133637 to your computer and use it in GitHub Desktop.
Gentoo kernel upgrade (must enable config support in kernel cfr /proc/config.gz)
#!/bin/bash -e
errr() {
echo "$@" 1>&2
exit 1;
}
(
cd linux/
gunzip -c /proc/config.gz > .config
make oldconfig || errr "Could not configure"
make -j13 || errr "Could not build"
if ! grep ' /boot ' /proc/mounts; then
mount /boot || errr "Could not mount /boot"
else
echo "/boot is already mounted"
fi;
make install || errr "Unable to install new kernel"
make modules_install || errr "Unable to install modules"
)
emerge @module-rebuild || errr "ERROR while compiling extra kernel modules"
genkernel initramfs || errr "Could not generate initramfs"
grub-mkconfig -o /boot/grub/grub.cfg || errr "Could not update grub config"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment