#!/bin/sh # # /etc/rc.d/rc.local: Local system initialization script. # # Put any local setup commands in here: # --> DELL i640m - power saving tweaks # enable optimized process scheduling echo 1 > /sys/devices/system/cpu/sched_mc_power_savings # use ondemand cpufreq governor (both cpus) echo "Powersave: switching to ondemand scaling governor." echo -n ondemand > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor echo -n ondemand > /sys/devices/system/cpu/cpu1/cpufreq/scaling_governor # Fix dirty_ratio to avoid a possible stall with ck echo 33 > /proc/sys/vm/dirty_ratio # high pitch noise dirty fix echo 2 > /sys/module/processor/parameters/max_cstate # battery mode AC=`cat /proc/acpi/ac_adapter/AC/state | grep -c 'off-line'` if [ $AC -eq 1 ]; then echo "Powersave: AC adapter is off-line." # switch to laptop mode (flush to hard disc every 10 minutes) echo -n 1 > /proc/sys/vm/laptop_mode echo -n 60000 > /proc/sys/vm/dirty_expire_centisecs echo -n 60000 > /proc/sys/vm/dirty_writeback_centisecs echo "Powersave: laptop mode enabled, sync timeout set to 10 minutes." echo "Powersave: activating hard drive spindown timeout and read-ahead." # the hd will spin down after two minutes; read 8MB ahead hdparm -S 6 -a 16384 /dev/sda # reduce pcm volume amixer set Master 42% > /dev/null echo "Powersave: mounting /tmp and KDE config directory in tmpfs." [ -d /home/jaguarwan/.kde-config-tmpfs ] && rm -rf /home/jaguarwan/.kde-config-tmpfs cp -a /home/jaguarwan/.kde /home/jaguarwan/.kde-config-tmpfs # mount /tmp and $HOME/.kde in tmpfs to avoid spurious hd spin-ups mount none -t tmpfs /home/jaguarwan/.kde mount none -t tmpfs /tmp chmod 1777 /tmp mkdir /tmp/.ICE-unix chmod 1777 /tmp/.ICE-unix mkdir /tmp/.iroha_unix chmod 1777 /tmp/.iroha_unix # copy the original files back and remove the additionnal backup cp -a /home/jaguarwan/.kde-config-tmpfs/* /home/jaguarwan/.kde rm -rf /home/jaguarwan/.kde-config-tmpfs fi # <-- DELL i640m - power saving tweaks # Allow user access to the RTC echo 1024 > /proc/sys/dev/rtc/max-user-freq # --> Quircks # Add the 256MB video memory to MTRR for X.org echo "base=0xc0000000 size=0x10000000 type=write-combining" >| /proc/mtrr # Enable the 'home' special key from the front panel setkeycodes e012 120 # Enable the Fn+F10 'eject' key # -- seems to repeat indefinitely under X, so disable it for now # setkeycodes e009 121 # Enable 1280x800 and 1280x1024 if [ -x /usr/sbin/915resolution ]; then /usr/sbin/915resolution 38 1280 800 24 > /dev/null /usr/sbin/915resolution 3a 1280 1024 24 > /dev/null fi # <-- Quircks # Start music player daemon if [ -x /etc/rc.d/rc.mpd ]; then /etc/rc.d/rc.mpd start fi