From 5393c17de2a2ced3a26662b725bcdcfe6b4dd3d8 Mon Sep 17 00:00:00 2001 From: André Fabian Silva Delgado Date: Mon, 6 Aug 2012 02:29:55 -0300 Subject: linux-libre-tools-3.5-2: updating revision --- libre/linux-libre-tools/cpupower.systemd | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 libre/linux-libre-tools/cpupower.systemd (limited to 'libre/linux-libre-tools/cpupower.systemd') diff --git a/libre/linux-libre-tools/cpupower.systemd b/libre/linux-libre-tools/cpupower.systemd new file mode 100644 index 000000000..f45b02bc8 --- /dev/null +++ b/libre/linux-libre-tools/cpupower.systemd @@ -0,0 +1,32 @@ +#!/bin/bash + +. /etc/conf.d/cpupower + +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: -- cgit v1.2.3