Git-Url: http://git.frugalware.org/gitweb/gitweb.cgi?p=frugalware-current.git;a=commitdiff;h=08938137e56b5120289edcb24264887ebebf1532
commit 08938137e56b5120289edcb24264887ebebf1532 Author: James Buren <[email protected]> Date: Mon Jan 16 13:24:46 2012 -0700 kernel-3.1-8-i686 * add initial cpupower config & launcher script diff --git a/source/base/kernel/cpupower b/source/base/kernel/cpupower new file mode 100644 index 0000000..c7130ab --- /dev/null +++ b/source/base/kernel/cpupower @@ -0,0 +1,21 @@ +# Driver module to use for this computer's CPU. +#driver="acpi-cpufreq" + +# Scaling governor to use for this computer's CPU. +#governor="ondemand" + +# Minimum frequency to allow. +#min_freq="800MHz" + +# Maximum frequency to allow. +#max_freq="2900MHz" + +# Static frequency (must be using userspace scaling governor). +#freq="800MHz" + +# Gives a hint to Intel processors about current powersaving policies. +#perf_bias=0 + +# Changes scheduling policies for additional powersaving. +#mc_scheduler=0 +#smp_scheduler=0 diff --git a/source/base/kernel/cpupower.sh b/source/base/kernel/cpupower.sh new file mode 100644 index 0000000..d9113b2 --- /dev/null +++ b/source/base/kernel/cpupower.sh @@ -0,0 +1,55 @@ +#!/bin/sh + +include /etc/sysconfig/cpupower + +_add_option() +{ + if test -z "$_options"; then + _options="$1" + else + _options="$_options $1" + fi +} + +if test -n "$driver"; then + modprobe "$driver" +fi + +if test -n "$governor"; then + modprobe "cpufreq_$governor" + _add_option="--governor '$governor'" +fi + +if test -n "$min_freq"; then + _add_option="--min '$min_freq'" +fi + +if test -n "$max_freq"; then + _add_option="--max '$max_freq'" +fi + +if test -n "$freq"; then + _add_option="--freq '$freq'" +fi + +if test -n "$_options"; then + /usr/bin/cpupower frequency-set $_options +fi + +_options="" + +if test -n "$perf_bias"; then + _add_option="--perf-bias '$perf_bias'" +fi + +if test -n "$mc_scheduler"; then + _add_option="--sched-mc '$mc_scheduler'" +fi + +if test -n "$smp_scheduler"; then + _add_option="--sched-smt '$smp_scheduler'" +fi + +if test -n "$_options"; then + /usr/bin/cpupower set $_options +fi _______________________________________________ Frugalware-git mailing list [email protected] http://frugalware.org/mailman/listinfo/frugalware-git
