From: Michael Prokop Date: Wed, 4 Jul 2007 10:17:45 +0000 (+0200) Subject: cpufreq-detect.sh: merge in code from /etc/init.d/loadcpufreq X-Git-Tag: 1.0.8 X-Git-Url: http://git.grml.org/?p=grml-scripts.git;a=commitdiff_plain;h=81db4ac16c6698bd7d7380034f61c09d987da934 cpufreq-detect.sh: merge in code from /etc/init.d/loadcpufreq --- diff --git a/debian/changelog b/debian/changelog index a9ce8e0..d013d03 100644 --- a/debian/changelog +++ b/debian/changelog @@ -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 Wed, 04 Jul 2007 12:16:10 +0200 + grml-scripts (1.0.7) unstable; urgency=low * grml-setservices: support lvm [Closes: issue239] diff --git a/usr_bin/cpufreq-detect.sh b/usr_bin/cpufreq-detect.sh index 881ced8..e8c15c2 100755 --- a/usr_bin/cpufreq-detect.sh +++ b/usr_bin/cpufreq-detect.sh @@ -4,9 +4,12 @@ # Authors: grml-team (grml.org), (C) Ubuntu, (c) Michael Prokop # 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.