deleted post by psihodelia

Get and discuss Scripts from other users
Post Reply
the-fallen
Administrator
Posts: 346
Joined: Wed 9. Jul 2008, 19:57

deleted post by psihodelia

Post by the-fallen » Thu 19. Feb 2009, 18:03

Sorry psihodelia, I deleted your posting by accident (but had it in cache):

------------------------ psihodelia wrote --------------------
Hello guys, here is my Ubuntu (works in all version up to 8.10) undervolt init script.

Instructions
Assuming, you have already installed PHC Kernel patch, you have tested your settings and you want CPU undervoltage applies at the system start.

Ok,
Create file /etc/init.d/undervolt and insert a code given at the end of this document into the file.
Now,
sudo chmod +x /etc/init.d/undervolt
And,
sudo update-rc.d undervolt defaults
That's all. After restart you will have lower CPU voltage.

My CPU:
Intel(R) Pentium(R) Dual CPU T2370 @ 1.73GHz
and it works about 3°C colder than with an usual voltage like a charm! Thank you guys for PHC project very much!

Code: Select all

#!/bin/sh
CUSTOM_VTABLE="13:27 10:21 8:14 6:12"
DEFAULT_VTABLE="13:27 10:21 8:14 6:12"
VTABLE_PATH="/sys/devices/system/cpu/cpu0/cpufreq/phc_controls"
SWITCH_BACK="no"
IS_CONFIGURED="yes"

set_custom_table()
{
  echo "${1}" > ${VTABLE_PATH} && \
  echo "Applied table:     "`cat ${VTABLE_PATH}`
  return $?
}

start()
{
  echo "Changing CPU voltages table"

  if [ "$IS_CONFIGURED" = "yes" ]; then
    set_custom_table "${CUSTOM_VTABLE}"
    echo $?
  else
    echo "Custom voltage table is not configured. Check the file /etc/conf.d/undervolt"
  fi
}
stop()
{
  if [ "$SWITCH_BACK" = "yes" ]; then
    if [ "$IS_CONFIGURED" = "yes" ]; then
      echo "Switching back to default CPU voltage table"
      set_custom_table "${DEFAULT_VTABLE}"
      echo $?
    else
      echo "Default voltage table is not configured. Check the file /etc/conf.d/undervolt"
    fi
  else
    echo "Not switching back to default CPU voltage table (disabled in configuration)"
    echo 0
  fi
}

case "$1" in
  start)
  start
  ;;
  stop)
  stop
  ;;
esac
exit 0

Post Reply