cpufreq-detect.sh: merge in code from /etc/init.d/loadcpufreq 1.0.8
authorMichael Prokop <mika@grml.org>
Wed, 4 Jul 2007 10:17:45 +0000 (12:17 +0200)
committerMichael Prokop <mika@grml.org>
Wed, 4 Jul 2007 10:17:45 +0000 (12:17 +0200)
debian/changelog
usr_bin/cpufreq-detect.sh

index a9ce8e0..d013d03 100644 (file)
@@ -1,3 +1,11 @@
+grml-scripts (1.0.8) unstable; urgency=low
+
+  * cpufreq-detect.sh: merge in code from /etc/init.d/loadcpufreq for
+    using acpi-cpufreq on systems supporting est when using kernel
+    >=2.6.20. [Related to issue238]
+
+ -- Michael Prokop <mika@grml.org>  Wed, 04 Jul 2007 12:16:10 +0200
+
 grml-scripts (1.0.7) unstable; urgency=low
 
   * grml-setservices: support lvm [Closes: issue239]
index 881ced8..e8c15c2 100755 (executable)
@@ -4,9 +4,12 @@
 # Authors:       grml-team (grml.org), (C) Ubuntu, (c) Michael Prokop <mika@grml.org>
 # Bug-Reports:   see http://grml.org/bugs/
 # License:       This file is licensed under the GPL v2.
-# Latest change: Tue Apr 18 19:09:55 CEST 2006 [mika]
+# Latest change: Mit Jul 04 12:15:57 CEST 2007 [mika]
 ################################################################################
-# Notice: taken from http://people.ubuntulinux.org/~scott/patches/powernowd/
+# Notice: also check out /etc/init.d/loadcpufreq of current cpufrequtils in Debian.
+#
+# Notice: based on http://people.ubuntulinux.org/~scott/patches/powernowd/ and
+# scripts found in the powernowd package version 0.97-1ubuntu6 on Ubuntu.
 ################################################################################
 
 /usr/sbin/laptop-detect 2>/dev/null && LAPTOP=1
@@ -63,8 +66,16 @@ case "$VENDOR_ID" in
     GenuineIntel*)
     # If the CPU has the est flag, it supports enhanced speedstep and should
     # use the speedstep-centrino driver
-    if [ "`grep est $CPUINFO`" ]; then
-        MODULE=speedstep-centrino;
+    if [ "$(grep est $CPUINFO)" ]; then
+        case "$(uname -r)" in
+            2.6.2[0-9]*)
+                # Prefer acpi-cpufreq for kernels after 2.6.20
+                MODULE=acpi-cpufreq
+                ;;
+            *)
+                MODULE=speedstep-centrino
+                ;;
+        esac
     elif [ $CPU_FAMILY = 15 ]; then
     # Right. Check if it's a P4 without est.
         # Could be speedstep-ich, or could be p4-clockmod.