# ChangeLog for sys-apps/cpudyn
# Copyright 2000-2004 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/sys-apps/cpudyn/ChangeLog,v 1.11 2004/09/03 21:03:23 pvdabeel Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-apps/cpudyn/ChangeLog,v 1.12 2004/10/10 06:42:10 vapier Exp $
+
+*cpudyn-1.0 (10 Oct 2004)
+
+ 10 Oct 2004; Mike Frysinger <vapier@gentoo.org> files/cpudyn.init,
+ +cpudyn-1.0.ebuild:
+ Version bump #53507 by Jakob Schiotz.
03 Sep 2004; Pieter Van den Abeele <pvdabeel@gentoo.org>
cpudyn-0.4.7-r1.ebuild, cpudyn-0.5.0.ebuild, cpudyn-0.6.1.ebuild,
--- /dev/null
+# Copyright 1999-2004 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sys-apps/cpudyn/cpudyn-1.0.ebuild,v 1.1 2004/10/10 06:42:10 vapier Exp $
+
+inherit eutils
+
+DESCRIPTION="A daemon to control laptop power consumption via cpufreq and disk standby"
+HOMEPAGE="http://mnm.uib.es/~gallir/${PN}/"
+SRC_URI="http://mnm.uib.es/~gallir/${PN}/download/${P}.tgz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~ppc ~x86"
+IUSE=""
+
+S=${WORKDIR}/${PN}
+
+src_unpack() {
+ unpack ${A}
+ cd ${S}/debian
+ epatch ${FILESDIR}/${PN}-0.99.0-init_conf_updates.patch
+}
+
+src_compile() {
+ emake cpudynd || die "Compilation failed."
+}
+
+src_install() {
+ dosbin cpudynd || die "dosbin"
+
+ doman cpudynd.8
+ dodoc INSTALL README VERSION changelog
+ dohtml *.html
+
+ exeinto /etc/init.d ; newexe ${FILESDIR}/cpudyn.init cpudyn
+ insinto /etc/conf.d ; newins debian/cpudyn.conf cpudyn
+}
+
+pkg_postinst() {
+ einfo "Configuration file is /etc/conf.d/cpudyn."
+}
#!/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,v 1.4 2004/07/15 00:38:51 agriffis Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-apps/cpudyn/files/cpudyn.init,v 1.5 2004/10/10 06:42:10 vapier 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
+opts="${opts} min max dynamic"
+
depend() {
need localmount
}
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
}
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
eend $?
}
+min() {
+ ebegin "Forcing minimal speed"
+ kill -USR2 $(cat ${PIDFILE})
+ eend $?
+}
+max() {
+ ebegin "Forcing maximal speed"
+ kill -USR1 $(cat ${PIDFILE})
+ eend $?
+}
+dynamic() {
+ ebegin "Resetting to default dynamic speed"
+ kill -HUP $(cat ${PIDFILE})
+ eend $?
+}
+
# vim:ts=4 noexpandtab: