]> Freerunner's - dotfiles.git/commitdiff
scripts: improve best_makeopts.sh a bit
authorAndre Ramnitz <tux.rising@gmail.com>
Thu, 5 Sep 2024 21:41:44 +0000 (23:41 +0200)
committerAndre Ramnitz <tux.rising@gmail.com>
Sun, 8 Sep 2024 11:05:48 +0000 (13:05 +0200)
local/dot-local/bin/best_makeopts.sh

index 865e283fe4ee4a02b50347502458ec2292c8433f..bb0f2143940f6d69956da2b29f581428606627b9 100755 (executable)
@@ -1,17 +1,23 @@
 #!/bin/bash
 
-cpupower frequency-set -g performance -r
+if [[ $(id -u) -ne 0 ]];
+then
+    echo "Please run this script with sudo/as root."
+    exit
+fi
 
-PACKAGE="kde-frameworks/plasma"
+cpupower frequency-set -g performance -r > /dev/null 2>&1 && echo "CPU Governor: performance"
+
+PACKAGE="kde-apps/gwenview"
 
 DISTDIR="/tmp/" emerge -f ${PACKAGE}
 
-for i in {1..32}
+for i in {8,16,20,24,28,32}
 do
        echo 1 > /proc/sys/vm/drop_caches
+       echo "Running with ${i} cores:"
        time DISTDIR="/tmp" EMERGE_DEFAULT_OPTS="" MAKEOPTS="-j${i}" emerge -q1OB ${PACKAGE}
-       echo -ne "\n\n\n"
 done
 
-cpupower frequency-set -g schedutil -r
+cpupower frequency-set -g schedutil -r > /dev/null 2>&1 && echo "CPU Governor: schedutil"