2012-08-12 04:19:25 +00:00
|
|
|
#!/bin/sh
|
|
|
|
set -e
|
|
|
|
|
2013-09-09 04:25:46 +00:00
|
|
|
[ "x$NEW" == "x" ] && NEW=$(grep "Kernel Configuration" /usr/src/linux/.config | awk '{print $3}')
|
2012-08-12 04:19:25 +00:00
|
|
|
echo $NEW
|
|
|
|
|
2013-09-09 04:25:46 +00:00
|
|
|
cd /usr/src/linux-${NEW}
|
2012-08-12 04:19:25 +00:00
|
|
|
# make clean
|
|
|
|
# make oldconfig
|
2013-03-30 20:08:43 +00:00
|
|
|
make menuconfig
|
2013-09-19 06:36:50 +00:00
|
|
|
make all ${MAKEOPTS}
|
2013-03-30 20:08:43 +00:00
|
|
|
make modules_install
|
2012-08-12 04:19:25 +00:00
|
|
|
|
2013-03-30 20:08:43 +00:00
|
|
|
for f in initrd vmlinuz System.map config; do
|
|
|
|
[ -e "/boot/$f-${NEW}" ] && mv "/boot/$f-${NEW}" "/boot/$f-${NEW}.previous"
|
|
|
|
done
|
2012-08-12 04:19:25 +00:00
|
|
|
|
2013-04-22 02:10:38 +00:00
|
|
|
cp /usr/src/linux/.config /etc/kernel/kernel-config-${NEW}
|
2013-03-30 20:08:43 +00:00
|
|
|
make install
|
2012-08-12 04:19:25 +00:00
|
|
|
|
|
|
|
dracut -H --force --strip /boot/initrd-${NEW} ${NEW}
|
|
|
|
|
|
|
|
grub2-mkconfig -o /boot/grub2/grub.cfg
|
|
|
|
|
2013-03-30 20:08:43 +00:00
|
|
|
echo "Building tools from within kernel sources..."
|
|
|
|
echo " cpupower:"
|
|
|
|
cd /usr/src/linux/tools/power/cpupower && make
|
|
|
|
cp -a cpupower /usr/local/bin
|
|
|
|
cp -a libcpupower.so* /usr/lib
|
|
|
|
|
2012-08-12 04:19:25 +00:00
|
|
|
echo "After successful boot of new kernel run:"
|
|
|
|
echo " root # module-rebuild rebuild"
|
|
|
|
# eselect opengl set ati
|