]> Frank Brehm's Git Trees - config/samara/etc.git/commitdiff
committing changes in /etc after emerge run
authorfbrehm <fbrehm@samara.profitbricks.localdomain>
Thu, 10 May 2012 13:26:21 +0000 (15:26 +0200)
committerroot <root@samara.profitbricks.localdomain>
Thu, 10 May 2012 13:26:21 +0000 (15:26 +0200)
Package changes:
+sys-power/cpufrequtils-008-r1

.etckeeper
conf.d/cpufrequtils [new file with mode: 0644]
init.d/cpufrequtils [new file with mode: 0755]

index d9f69ea79f8d1bae2bee04ec1a5a6ccf8c42ce79..0ddbbd14fb3e93f0a6cd881460a7ab6c4975a882 100755 (executable)
@@ -232,6 +232,7 @@ maybe chmod 0644 './conf.d/auditd'
 maybe chmod 0644 './conf.d/autofs'
 maybe chmod 0644 './conf.d/bootmisc'
 maybe chmod 0644 './conf.d/consolefont'
+maybe chmod 0644 './conf.d/cpufrequtils'
 maybe chmod 0644 './conf.d/crypto-loop'
 maybe chmod 0644 './conf.d/device-mapper'
 maybe chmod 0644 './conf.d/dmesg'
@@ -1101,6 +1102,7 @@ maybe chmod 0755 './init.d/courier-imapd'
 maybe chmod 0755 './init.d/courier-imapd-ssl'
 maybe chmod 0755 './init.d/courier-pop3d'
 maybe chmod 0755 './init.d/courier-pop3d-ssl'
+maybe chmod 0755 './init.d/cpufrequtils'
 maybe chmod 0755 './init.d/crypto-loop'
 maybe chmod 0755 './init.d/cupsd'
 maybe chmod 0755 './init.d/dbus'
diff --git a/conf.d/cpufrequtils b/conf.d/cpufrequtils
new file mode 100644 (file)
index 0000000..8959664
--- /dev/null
@@ -0,0 +1,11 @@
+# /etc/conf.d/cpufrequtils: config file for /etc/init.d/cpufrequtils
+
+# Options when starting cpufreq (given to the `cpufreq-set` program)
+START_OPTS="--governor ondemand"
+
+# Options when stopping cpufreq (given to the `cpufreq-set` program)
+STOP_OPTS="--governor performance"
+
+# Extra settings to write to sysfs cpufreq values.
+#SYSFS_EXTRA="ondemand/ignore_nice_load=1 ondemand/up_threshold=70"
+
diff --git a/init.d/cpufrequtils b/init.d/cpufrequtils
new file mode 100755 (executable)
index 0000000..adb71b0
--- /dev/null
@@ -0,0 +1,41 @@
+#!/sbin/runscript
+# Copyright 1999-2010 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sys-power/cpufrequtils/files/cpufrequtils-init.d-006,v 1.2 2011/07/21 19:47:14 mattst88 Exp $
+
+change() {
+       local c ret=0 opts="$1"
+       shift
+       ebegin "Running cpufreq-set ${opts}"
+       for c in $(cpufreq-info -o | awk '$1 == "CPU" { print $2 }') ; do
+               cpufreq-set -c ${c} ${opts}
+               : $(( ret += $? ))
+       done
+       eend ${ret}
+
+       if [ $# -gt 0 ] ; then
+               c=1
+               einfo "Setting extra options: $*"
+               if cd /sys/devices/system/cpu/cpufreq ; then
+                       local o v
+                       for o in "$@" ; do
+                               v=${o#*=}
+                               o=${o%%=*}
+                               echo ${v} > ${o} || break
+                       done
+                       c=0
+               fi
+               eend ${c}
+               : $(( ret += c ))
+       fi
+
+       return ${ret}
+}
+
+start() {
+       change "${START_OPTS}" ${SYSFS_EXTRA}
+}
+
+stop() {
+       change "${STOP_OPTS}"
+}