2012-08-07 16:11:48 +00:00
|
|
|
#!/bin/bash
|
2020-12-02 19:26:53 +00:00
|
|
|
# Copyright © 2012, Sébastien Luttringer
|
|
|
|
# SPDX-License-Identifier: GPL-2.0-or-later
|
2012-08-07 16:11:48 +00:00
|
|
|
|
|
|
|
declare -i fail=0
|
|
|
|
|
|
|
|
# parse frequency options
|
|
|
|
declare -a params=()
|
|
|
|
params+=(${governor:+-g $governor})
|
|
|
|
params+=(${min_freq:+-d $min_freq})
|
|
|
|
params+=(${max_freq:+-u $max_freq})
|
|
|
|
params+=(${freq:+-f $freq})
|
|
|
|
|
|
|
|
# apply frequency options
|
|
|
|
if ((${#params[@]} > 0)); then
|
|
|
|
cpupower frequency-set "${params[@]}" >/dev/null || fail=1
|
|
|
|
fi
|
|
|
|
|
|
|
|
# parse cpu options
|
|
|
|
declare -a params=()
|
|
|
|
params+=(${mc_scheduler:+-m $mc_scheduler})
|
|
|
|
params+=(${smp_scheduler:+-s $smp_scheduler})
|
|
|
|
params+=(${perf_bias:+-b $perf_bias})
|
|
|
|
|
|
|
|
# apply cpu options
|
|
|
|
if ((${#params[@]} > 0)); then
|
|
|
|
cpupower set "${params[@]}" >/dev/null || fail=1
|
|
|
|
fi
|
|
|
|
|
|
|
|
exit $fail
|
|
|
|
|
|
|
|
# vim:set ts=2 sw=2 ft=sh et:
|