ac battery acpi-cpufreq cpufreq_ondemand
#!/bin/sh
# /etc/init.d/local.sh - Local startup commands.
# All commands here will be executed at boot time.
#
. /etc/init.d/rc.functions
echo "Starting local startup commands... "
# Enable mobile CPU dynamic frequency scaling
modprobe acpi-cpufreq
modprobe cpufreq_ondemand
cd /sys/devices/system/cpu/cpu0/cpufreq
echo ondemand > scaling_governor
# if you have a dual core
cd /sys/devices/system/cpu/cpu1/cpufreq
echo ondemand > scaling_governor
# Enable laptop mode
# When laptop mode is enabled, the kernel will try to be smart
# about when to do IO, to give the disk and the SATA links as
# much time as possible in a low power state.
if [ ! -e /proc/sys/vm/laptop_mode ] ; then
echo "Kernel does not have support for laptop mode."
else
echo "Enabling laptop mode"
echo 5 > /proc/sys/vm/laptop_mode
fi
# AC97 audio power saving mode
# The AC97 onboard audio chips support power saving, where the
# analog parts (codec) are powered down when no program is using
# the audio device.
if [ -e /sys/module/snd_ac97_codec/parameters/power_save ] ; then
echo "Enabling AC97 audio power saving mode"
echo 1 > /sys/module/snd_ac97_codec/parameters/power_save
echo 1 > /dev/dsp
fi
# The VM writeback time
# The VM subsystem caching allows the kernel to group consecutive
# writes into one big write, and to generally optimize the disk IO
# to be the most efficient.
if [ -e /proc/sys/vm/dirty_writeback_centisecs ] ; then
echo "Writeback time set to 1500ms"
echo 6000 > /proc/sys/vm/dirty_writeback_centisecs
fi
# Lesswatts.org tricks
# Multicore scheduler http://www.lesswatts.org/tips/cpu.php
echo 1 > /sys/devices/system/cpu/sched_mc_power_savings
# Filesystem relatime http://www.lesswatts.org/tips/disks.php
mount -o remount,relatime /
# Hard disk power management http://www.lesswatts.org/tips/disks.php
hdparm -B 1 -S 12 /dev/sda
# Disable hal polling http://www.lesswatts.org/tips/disks.php
hal-disable-polling --device /dev/scd0
# Restart hal polling by commenting previous line and uncommenting next line http://www.lesswatts.org/tips/disks.php
# hal-disable-polling --device /dev/scd0 --enable-polling
# Disable WiFi radio RFkill http://www.lesswatts.org/tips/wireless.php
for i in `find /sys -name "rf_kill" ; do echo 1 > $i ; done
# Restart WiFi by commenting previous line and uncommenting next line http://www.lesswatts.org/tips/wireless.php
# for i in `find /sys -name "rf_kill" ; do echo 0 > $i ; done
# Disable gigabit http://www.lesswatts.org/tips/ethernet.php
ethtool -s eth0 autoneg off speed 100
# Enable gigabit by commenting previous line and uncommenting next line http://www.lesswatts.org/tips/ethernet.php
# ethtool -s eth0 autoneg on speed 1000
It looks like you're new here. If you want to get involved, click one of these buttons!