wget http://www.gnuwakes.org/depot/1.0/main/sources/linux-4.1.3.tar.xz tar -xf linux-4.1.3.tar.xz wget http://www.gnuwakes.org/depot/1.0/main/sources/linux-headers-4.1.3.patch cd linux-4.1.3 patch -p1 < ../linux-headers-4.1.3.patch cd .. SOURCES_DIR=$PWD/linux-4.1.3 INSTALL_DIR=$PWD/linux-4.1.3-install BUILD_DIR=$PWD/linux-4.1.3-build mkdir $INSTALL_DIR $BUILD_DIR cd $BUILD_DIR # # To install the kernel headers, run the following commands: # # cd /usr/src/linux # make mrproper # make INSTALL_HDR_PATH=$BUILD_DIR headers_install # find $BUILD_DIR/ \( -name .install -o -name ..install.cmd \) -delete # cp -rv $BUILD_DIR/include/* $INSTALL_DIR/usr/include # kernel_src=/usr/src/linux if [ ! -d "$kernel_src" ] then print "Please install the kernel sources in $kernel_src first" return 1 fi cd "$kernel_src" make mrproper make INSTALL_HDR_PATH=$BUILD_DIR headers_install find $BUILD_DIR/ \( -name .install -o -name ..install.cmd \) -delete mkdir -pv $INSTALL_DIR/usr/include cp -rv $BUILD_DIR/include/* $INSTALL_DIR/usr/include