diff options
Diffstat (limited to 'sys-apps/cpudyn/files/cpudyn.init-0.99.0')
-rw-r--r-- | sys-apps/cpudyn/files/cpudyn.init-0.99.0 | 93 |
1 files changed, 0 insertions, 93 deletions
diff --git a/sys-apps/cpudyn/files/cpudyn.init-0.99.0 b/sys-apps/cpudyn/files/cpudyn.init-0.99.0 deleted file mode 100644 index a0a39c0f9d9f..000000000000 --- a/sys-apps/cpudyn/files/cpudyn.init-0.99.0 +++ /dev/null @@ -1,93 +0,0 @@ -#!/sbin/runscript -# Copyright 1999-2004 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/sys-apps/cpudyn/files/cpudyn.init-0.99.0,v 1.2 2004/07/15 00:38:51 agriffis Exp $ -# -# Based on the Debian init script written by Celso Gonzalez <celso@bulma.net>, -# and on the cpufreqd Gentoo init script written by Robert Gogolok <robertgogolok@web.de>. -# Heavily modified by Robin H. Johnson <robbat2@gentoo.org> to ensure correct -# start only under support conditions -# More preconditions by Karl Trygve Kalleberg <karltk@gentoo.org> -# - -DAEMON=/usr/sbin/cpudynd -PIDFILE=/var/run/cpudynd.pid - -depend() { - need localmount -} - -checkconfig() { - local CPUFREQ_FILES="${CPUFREQ_24} ${CPUFREQ_25} ${CPUFREQ_ACPI}" - local CPUFREQ_FILE="" - for i in ${CPUFREQ_FILES}; do [ -e ${i} ] && CPUFREQ_FILE="${i}" && break ; done - if [ -z "${CPUFREQ_FILE}" ]; then - eerror "Neither CPUFreq nor ACPI throttling support were found" - return 1 - fi - if [ "${CPUFREQ_FILE}" = "${CPUFREQ_ACPI}" ]; then - # see if the file says we are supported or not - grep 'not supported' ${CPUFREQ_ACPI} 2>&1 >/dev/null - retval="$?" - if [ $retval -eq 0 ]; then - eerror "ACPI throttling support found, but hardware doesn't support it" - return 1 - fi - # now check that we can write to the file - local acpistate=`grep 'active state' ${CPUFREQ_ACPI} | cut -dT -f2-` - echo $acpistate > ${CPUFREQ_ACPI} - retval="$?" - if [ $retval -ne 0 ]; then - eerror "Writing to ACPI throttling file failed" - return 1 - fi - fi - # CPUFREQ_25 has more than one entry, hence the grep -- karltk - if [ ! -z "$(echo ${CPUFREQ_25} | grep ${CPUFREQ_FILE})" ]; then - # Silently try to load the governors; shouldn't hurt if they're already there - modprobe -q cpufreq_performance - modprobe -q cpufreq_powersave - # Check that all governors required are actually present - missing="" - for x in userspace performance powersave ; do - if [ -z "$(grep ${x} ${CPUFREQ_FILE}/scaling_available_governors)" ]; then - missing="${missing} ${x}" - fi - done - # If some are missing, report which, then bail - if [ ! -z "${missing}" ]; then - eerror "2.5/2.6 CPUfreq support needs userspace, performance and powersave governors" - eerror "Missing${missing}" - return 1 - fi - fi -} - - -start() { - local CPUDYN_OPTS="" - if [ -n "$INTERVAL" ]; then CPUDYN_OPTS="$CPUDYN_OPTS -i $INTERVAL"; fi - if [ -n "$CPU_UP" -a -n "$CPU_DOWN" ]; then CPUDYN_OPTS="$CPUDYN_OPTS -p $CPU_UP $CPU_DOWN"; fi - if [ -n "$THROTTLING_LOW" ]; then CPUDYN_OPTS="$CPUDYN_OPTS -l $THROTTLING_LOW"; fi - if [ -n "$TIMEOUT" ]; then CPUDYN_OPTS="$CPUDYN_OPTS -t $TIMEOUT"; fi - if [ -n "$DISKS" ]; then CPUDYN_OPTS="$CPUDYN_OPTS -h $DISKS"; fi - if [ "$NICE" == "yes" ]; then CPUDYN_OPTS="$CPUDYN_OPTS -nice"; fi - - ebegin "Starting cpudynd" - if checkconfig; then - start-stop-daemon --start --quiet --pidfile $PIDFILE \ - --background --make-pidfile --exec $DAEMON -- $CPUDYN_OPTS - eend $? - else - eend 1 - fi -} - -stop() { - ebegin "Stopping cpudynd" - start-stop-daemon --stop --quiet --pidfile $PIDFILE \ - --exec $DAEMON && rm -f $PIDFILE - eend $? -} - -# vim:ts=4 noexpandtab: |