|
|
@ -4,7 +4,7 @@ GOVERNOR="powersave" |
|
|
|
apply_lm=true |
|
|
|
apply_lm=true |
|
|
|
|
|
|
|
|
|
|
|
while getopts 'hopPg:' opt; do |
|
|
|
while getopts 'hopPg:' opt; do |
|
|
|
case opt in |
|
|
|
case $opt in |
|
|
|
'h') |
|
|
|
'h') |
|
|
|
echo "Usage: powersave [-hopP] [-g governor]" |
|
|
|
echo "Usage: powersave [-hopP] [-g governor]" |
|
|
|
echo " -h this message" |
|
|
|
echo " -h this message" |
|
|
@ -30,8 +30,8 @@ while getopts 'hopPg:' opt; do |
|
|
|
GOVERNOR=$OPTARG |
|
|
|
GOVERNOR=$OPTARG |
|
|
|
apply_lm=false |
|
|
|
apply_lm=false |
|
|
|
;; |
|
|
|
;; |
|
|
|
|
|
|
|
'?'|*) ;; |
|
|
|
esac |
|
|
|
esac |
|
|
|
'' |
|
|
|
|
|
|
|
done |
|
|
|
done |
|
|
|
shift $((OPTIND-1)) |
|
|
|
shift $((OPTIND-1)) |
|
|
|
|
|
|
|
|
|
|
@ -40,6 +40,7 @@ CPUS="$(nproc)" |
|
|
|
for c in $(seq 0 $((CPUS-1))) |
|
|
|
for c in $(seq 0 $((CPUS-1))) |
|
|
|
do |
|
|
|
do |
|
|
|
echo $GOVERNOR > /sys/devices/system/cpu/"cpu$c"/cpufreq/scaling_governor |
|
|
|
echo $GOVERNOR > /sys/devices/system/cpu/"cpu$c"/cpufreq/scaling_governor |
|
|
|
|
|
|
|
printf '[cpu %d] %s\n' "$c" "$(cat "/sys/devices/system/cpu/cpu$c/cpufreq/scaling_governor")" |
|
|
|
done |
|
|
|
done |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|