From 944010ca8683ef61cbd12dfbb5cfe7c7dd87cdc5 Mon Sep 17 00:00:00 2001 From: silvan Date: Thu, 28 Apr 2011 11:46:04 +0200 Subject: [PATCH] Revert "laptop-mode-tools should obsolete the need for detection in processor plugin" This reverts commit 0354a784afbacf90c607c490b81bb46631ad5d44. --- postplug.d/07processor | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 postplug.d/07processor diff --git a/postplug.d/07processor b/postplug.d/07processor new file mode 100644 index 0000000..8688a60 --- /dev/null +++ b/postplug.d/07processor @@ -0,0 +1,36 @@ +#!/bin/bash +# +# processor configuration plugin for postplug +# +# Copyright (c) 2008 by Silvan Calarco +# + +[ -e /etc/sysconfig/acpi ] && . /etc/sysconfig/acpi + +[ "$CPU_FREQ" = "" ] && { + + CPUMODEL=`cat /proc/cpuinfo | grep "model name" -m1 | sed "s|model name[[:space:]*]:\(.*\)|\1|" ` + + if [ "`echo $CPUMODEL | grep AMD`" ]; then + + CPUVENDOR=AMD + if [ "`echo $CPUMODEL | grep X2`" ]; then + LOAD_MODULE=powernow_k8 + elif [ "`echo $CPUMODEL | grep Athlon`" ]; then + LOAD_MODULE=k8temp + elif [ "`echo $CPUMODEL | grep Thurion`" ]; then + LOAD_MODULE=k8temp + else + LOAD_MODULE=acpi_cpufreq + fi + + elif [ "`echo $CPUMODEL | grep Intel`" ]; then + + CPUVENDOR=Intel + LOAD_MODULE=acpi_cpufreq + fi + + [ -e /etc/sysconfig/acpi ] && sed -i "/CPU_FREQ=.*/d" /etc/sysconfig/acpi + echo "CPU_FREQ=$LOAD_MODULE" >> /etc/sysconfig/acpi + +}