From 553b4421b6210f5d8001833b0e28861ae3e7f635 Mon Sep 17 00:00:00 2001 From: Stefan Reimer Date: Sat, 30 Mar 2013 13:08:43 -0700 Subject: [PATCH] scripts: Add cpupower build, minor tweaks --- scripts/make_kernel.sh | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/scripts/make_kernel.sh b/scripts/make_kernel.sh index 4cc3275..af1f0f4 100755 --- a/scripts/make_kernel.sh +++ b/scripts/make_kernel.sh @@ -1,28 +1,34 @@ #!/bin/sh set -e +CPUS=$(nproc) NEW=$(grep "Kernel Configuration" /usr/src/linux/.config | awk '{print $3}') echo $NEW cd /usr/src/linux-${NEW} # make clean # make oldconfig -make -j4 menuconfig -make -j4 all -make -j4 modules_install -make install +make menuconfig +make -j${CPUS} all +make modules_install + +for f in initrd vmlinuz System.map config; do + [ -e "/boot/$f-${NEW}" ] && mv "/boot/$f-${NEW}" "/boot/$f-${NEW}.previous" +done cp /usr/src/linux/.config /etc/kernels/kernel-config-${NEW} - -# rm -f /boot/*.old -if [ -f "/boot/initrd-${NEW}" ] ; then - mv "/boot/initrd-${NEW}" "/boot/initrd-${NEW}.old" -fi +make install dracut -H --force --strip /boot/initrd-${NEW} ${NEW} grub2-mkconfig -o /boot/grub2/grub.cfg +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 + echo "After successful boot of new kernel run:" echo " root # module-rebuild rebuild" # eselect opengl set ati