scripts: Add cpupower build, minor tweaks
This commit is contained in:
parent
f5d580820a
commit
553b4421b6
@ -1,28 +1,34 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
|
CPUS=$(nproc)
|
||||||
NEW=$(grep "Kernel Configuration" /usr/src/linux/.config | awk '{print $3}')
|
NEW=$(grep "Kernel Configuration" /usr/src/linux/.config | awk '{print $3}')
|
||||||
echo $NEW
|
echo $NEW
|
||||||
|
|
||||||
cd /usr/src/linux-${NEW}
|
cd /usr/src/linux-${NEW}
|
||||||
# make clean
|
# make clean
|
||||||
# make oldconfig
|
# make oldconfig
|
||||||
make -j4 menuconfig
|
make menuconfig
|
||||||
make -j4 all
|
make -j${CPUS} all
|
||||||
make -j4 modules_install
|
make modules_install
|
||||||
make 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}
|
cp /usr/src/linux/.config /etc/kernels/kernel-config-${NEW}
|
||||||
|
make install
|
||||||
# rm -f /boot/*.old
|
|
||||||
if [ -f "/boot/initrd-${NEW}" ] ; then
|
|
||||||
mv "/boot/initrd-${NEW}" "/boot/initrd-${NEW}.old"
|
|
||||||
fi
|
|
||||||
|
|
||||||
dracut -H --force --strip /boot/initrd-${NEW} ${NEW}
|
dracut -H --force --strip /boot/initrd-${NEW} ${NEW}
|
||||||
|
|
||||||
grub2-mkconfig -o /boot/grub2/grub.cfg
|
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 "After successful boot of new kernel run:"
|
||||||
echo " root # module-rebuild rebuild"
|
echo " root # module-rebuild rebuild"
|
||||||
# eselect opengl set ati
|
# eselect opengl set ati
|
||||||
|
Loading…
Reference in New Issue
Block a user