PatrickBateman
Posting Freak
Posts: 1,656
Joined: Mar 2011
Reputation: 15
Location: Another Earth
|
|
|
find
quote
|
stopdatrue
Junior Member
Posts: 4
Joined: May 2010
Reputation: 0
|
To have cpufreq scaling working on ubuntu, use this script to patch p4-clockmod.ko:
#/bin/sh
kv=$( uname -a | awk '{ print $3 }')
module="/lib/modules/$kv/kernel/drivers/cpufreq/p4-clockmod.ko"
if [ ! -e "$module" ] ; then
echo "Module $module not found"
fi
echo "Search pattern"
l=$( xxd -c 1 ${module} | awk '{ i++; a=b; b=c; c=d ; d=$2; if (a == "81" && b == "96" && c == "98" && d == "00") print i-3; }')
if [ "$?" != "0" ] ; then
exit 1
fi
if [ -z "$l" ] ; then
echo "Pattern not found"
exit 1
fi
xxd -c 1 $module | awk -v l=$l '{ i++; if (i == l) { print $1 " 40 ." } else if (i == l+1) { print $1 " 42 ." } else if (i == l+2) { print $1 " 0f ." } else { print $0}}' > ${module}.hex
if [ "$?" != "0" ] ; then
exit 1
fi
if [ ! -e "${module}.bak" ] ; then
echo "Create backup ${module}.bak"
mv $module ${module}.bak || exit 1
fi
xxd -c 1 -r ${module}.hex ${module}
if [ "$?" != "0" ] ; then
cat ${module}.bak > ${module}
exit 1
fi
My cpufreq conf:
# cat /etc/default/cpufrequtils
GOVERNOR=ondemand
MIN_SPEED=799998
(This post was last modified: 2013-03-23 11:08 by stopdatrue.)
|
|
find
quote
|