Created
October 29, 2014 09:12
-
-
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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