Skip to content

Instantly share code, notes, and snippets.

@nkwhr
Created October 29, 2014 09: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 nkwhr/807701d5c568a4e76183 to your computer and use it in GitHub Desktop.
Save nkwhr/807701d5c568a4e76183 to your computer and use it in GitHub Desktop.
Build and installs vanilla kernel on CentOS 6. You can specify a version with `$VERSION` environment variable.
#!/bin/bash
set -e
export PATH=/sbin:/bin:/usr/sbin:/usr/bin
export LANG=C
if [ $UID -ne 0 ] ; then
echo "You must be root to run this script."
exit 1
fi
if [ "x$VERSION" == "x" ] ; then
VERSION="3.17.1"
fi
yum -y groupinstall 'Development Tools'
yum -y install bc wget
cd /usr/local/src
wget https://www.kernel.org/pub/linux/kernel/v3.0/linux-${VERSION}.tar.gz
tar zxf linux-${VERSION}.tar.gz
cd linux-${VERSION}
cp /boot/config-$(uname -r) .config
yes "" | make oldconfig >/dev/null
make -j $(nproc) all
make modules_install
make install
echo "Change boot order in /boot/grub/grub.conf and reboot machine."
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment