[Galaxy S II Original Android Development] cmd512:
I've had a few folks PM me for my init.d script, so I'm posting it below with the following disclaimers:

1) What works for my phone may not work for yours. I do not get any SODs, my phone goes into deep sleep with no issues, get 0 lag, and have never had any problems with WIFI based on the settings below.

2) I've again lowered my lulzactive CPU threshold to 65%. v2.6.6 seems to throttle down quickly sometimes, and other times, it just sits at 1400MHz max frequency... regardless of what CPU threshold I use. (I think gokhan programmed in some funky AI ... very special indeed ;) )

So, I'm testing it with my original settings to see if the "hanging at max frequency" impacts battery life (significantly).

3) I don't use any other scripts (thunderbolt, etc etc). I believe in knowing exactly what I'm doing with regards to parameters I'm setting up with my phone, so I don't use "prepackaged" scripts.

4) I found lag to be more launcher dependent than anything else. Nearly all of the lag I was experiencing (app drawer, etc) went away after I switched from ADW Launcher EX to Go Launcher EX.

5) If any of the above is an indicator, you'd see I change my environment/scripts ALL the time. So, please use this as reference only.

=========================================

With that said, here you go:

#!/system/bin/sh

sleep 5

echo "1600 1400 1200 1000 800 500 200 100" > /sys/devices/system/cpu/cpu0/cpufreq/freq_table

echo "1425 1275 1175 1075 975 900 850 825" > /sys/devices/system/cpu/cpu0/cpufreq/UV_mV_table

sleep 30

echo "200000" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq

echo "1400000" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq

echo "sio" > /sys/block/mmcblk0/queue/scheduler

echo "lulzactive" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor

echo "70" > /sys/module/pm_hotplug/parameters/loadh

echo "30" > /sys/module/pm_hotplug/parameters/loadl

echo "90" > /sys/module/pm_hotplug/parameters/loadh_scroff

echo "70" > /sys/module/pm_hotplug/parameters/loadl_scroff

echo "200" > /sys/module/pm_hotplug/parameters/rate

echo "400" > /sys/module/pm_hotplug/parameters/rate_cpuon

echo "800" > /sys/module/pm_hotplug/parameters/rate_scroff

echo "524288" > /sys/module/pm_hotplug/parameters/freq_cpu1on

#Set deep sleep frequency & bus speed (L5=500 mhz and 2=133mhz bus speed)

echo "5" > /sys/devices/system/cpu/cpu0/cpufreq/deepsleep_cpulevel

echo "2" > /sys/devices/system/cpu/cpu0/cpufreq/deepsleep_buslevel

#lulzactiveV2 tweaks

echo "65" > /sys/devices/system/cpu/cpufreq/lulzactive/inc_cpu_load

echo "3" > /sys/devices/system/cpu/cpufreq/lulzactive/pump_up_step

echo "1" > /sys/devices/system/cpu/cpufreq/lulzactive/pump_down_step

echo "24000" > /sys/devices/system/cpu/cpufreq/lulzactive/up_sample_time

echo "48000" > /sys/devices/system/cpu/cpufreq/lulzactive/down_sample_time

echo "5" > /sys/devices/system/cpu/cpufreq/lulzactive/screen_off_min_step

#gpu clock, threshold and voltage

echo "160 267 267" > /sys/class/misc/gpu_clock_control/gpu_control

echo "60% 30% 100% 50%" > /sys/class/misc/gpu_clock_control/gpu_control

echo "900000 950000 950000" > /sys/class/misc/gpu_voltage_control/gpu_control

#enable sched_mc

echo "1" > /sys/devices/system/cpu/sched_mc_power_savings

#enable AFTR

echo "3" > /sys/module/cpuidle/parameters/enable_mask

#static bus frequency

echo "enabled" > /sys/devices/system/cpu/cpu0/cpufreq/busfreq_static

echo "0 0 0 1 1 2 2 2" > /sys/devices/system/cpu/cpu0/cpufreq/busfreq_static

echo "650 650 450" > /sys/devices/virtual/misc/charge_current/charge_current