rpms/cpuspeed/FC-4 cpuspeed.init,1.1,1.2 cpuspeed.spec,1.21,1.22
fedora-cvs-commits at redhat.com
fedora-cvs-commits at redhat.com
Sat Sep 24 00:05:49 UTC 2005
Author: davej
Update of /cvs/dist/rpms/cpuspeed/FC-4
In directory cvs.devel.redhat.com:/tmp/cvs-serv29662
Modified Files:
cpuspeed.init cpuspeed.spec
Log Message:
Use ACPI as a fallback driver if none is set, and its available. (#160788)
Index: cpuspeed.init
===================================================================
RCS file: /cvs/dist/rpms/cpuspeed/FC-4/cpuspeed.init,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- cpuspeed.init 7 Jan 2005 05:55:27 -0000 1.1
+++ cpuspeed.init 24 Sep 2005 00:05:46 -0000 1.2
@@ -17,40 +17,47 @@
fi
start() {
- if [ ! -f /var/lock/subsys/cpuspeed ]; then
- # Attempt to load scaling_driver if not loaded but it is configured
- if [ ! -f /sys/devices/system/cpu/cpu0/cpufreq/scaling_driver ]; then
- [ -n "$DRIVER" ] && /sbin/modprobe "$DRIVER"
- fi
-
- # If not loaded, abort cpuspeed without [FAILED] message
- [ ! -f /sys/devices/system/cpu/cpu0/cpufreq/scaling_driver ] && return 0
-
- echo -n $"Starting $prog: "
-
- daemon cpuspeed -d $OPTS
- RETVAL=$?
- echo
- [ $RETVAL = 0 ] && touch /var/lock/subsys/cpuspeed
- else
- return 0
- fi
- return $RETVAL
+ if [ ! -f /var/lock/subsys/cpuspeed ]; then
+ # Attempt to load scaling_driver if not loaded but it is configured
+ if [ ! -f /sys/devices/system/cpu/cpu0/cpufreq/scaling_driver ]; then
+ if [ -n "$DRIVER" ]; then
+ /sbin/modprobe "$DRIVER"
+ else
+ # use ACPI as a fallback if its available.
+ if [ -f /proc/acpi/processor/CPU0/info ]; then
+ /sbin/modprobe acpi-cpufreq
+ fi
+ fi
+ fi
+
+ # If we get this far with no driver, we must have no ACPI. We're doomed.
+ [ ! -f /sys/devices/system/cpu/cpu0/cpufreq/scaling_driver ] && return 0
+
+ echo -n $"Starting $prog: "
+
+ daemon cpuspeed -d $OPTS
+ RETVAL=$?
+ echo
+ [ $RETVAL = 0 ] && touch /var/lock/subsys/cpuspeed
+ else
+ return 0
+ fi
+ return $RETVAL
}
stop() {
- if test "x`pidof cpuspeed`" != x; then
- echo -n $"Stopping $prog: "
- killproc cpuspeed -INT
- sleep 1
- echo
- fi
- if test "x`pidof cpuspeed`" != x; then
- killproc cpuspeed
- fi
- RETVAL=$?
- [ $RETVAL = 0 ] && rm -f /var/lock/subsys/cpuspeed
- return $RETVAL
+ if test "x`pidof cpuspeed`" != x; then
+ echo -n $"Stopping $prog: "
+ killproc cpuspeed -INT
+ sleep 1
+ echo
+ fi
+ if test "x`pidof cpuspeed`" != x; then
+ killproc cpuspeed
+ fi
+ RETVAL=$?
+ [ $RETVAL = 0 ] && rm -f /var/lock/subsys/cpuspeed
+ return $RETVAL
}
case "$1" in
Index: cpuspeed.spec
===================================================================
RCS file: /cvs/dist/rpms/cpuspeed/FC-4/cpuspeed.spec,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -r1.21 -r1.22
--- cpuspeed.spec 9 May 2005 22:33:20 -0000 1.21
+++ cpuspeed.spec 24 Sep 2005 00:05:46 -0000 1.22
@@ -72,6 +72,9 @@
exit 0
%changelog
+* Fri Sep 23 2005 Dave Jones <davej at redhat.com>
+- Use ACPI as a fallback driver if none is set, and its available. (#160788)
+
* Mon May 9 2005 Dave Jones <davej at redhat.com>
- Fix debuginfo generation.
More information about the fedora-cvs-commits
mailing list