postplug/postplug.d/07processor

37 lines
930 B
Plaintext
Raw Normal View History

2011-04-27 19:57:03 +02:00
#!/bin/bash
#
# processor configuration plugin for postplug
#
# Copyright (c) 2008 by Silvan Calarco <silvan.calarco@mambasoft.it>
#
[ -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
}