[HTC Sensation] axetilen:
This is an overview of the 99sultan-kernel script after modifying

there are some typos, avoid it

any suggestion?

#!/system/bin/sh
# ==============================
# MOD for sultan kernel
# ==============================
# Script base created by IBA21
# ==============================
# Modified by axetilen
# ==============================

# Change your own settings here!!!

# Config CPU governor
# 1 = badass
# 2 = intellidemand
# 3 = ondemand
# 4 = performance
# 5 = lagfree
GOV='$gov';

# Enable Sweep2Wake (showp1984)
# 0 = disabled
# 1 = enabled
# 2 = enabled (with no button backlight)
SWEEP='$sweep';

# Enable Fastcharge (Yank555)
# 0 = disabled
# 1 = substitute AC to USB charging always
# 2 = substitute AC to USB charging only if there is no USB peripheral detected
FASTCHARGE='$fastcharge';

# Fsync Control
# 0 = Fsync disabled
# 1 = Fsync enabled
FSYNC='$fsync';

# Vsync Control
# 0 = Vsync disabled
# 1 = Vsync enabled
VSYNC='$vsync';

# Disable logcat
# 0 = enabled
# 1 = disabled
LOGCAT='$logcat';

# Config 2D GPU clock
# 200000000 = 200mhz
# 228571000 = 228mhz (229mhz)
# 266667000 = 267mhz
2D='$2d';

# Config 3D GPU clock
# 266667000 = 267mhz
# 300000000 = 300mhz
# 320000000 = 320mhz
GPU='$gpu';

# Config i/o scheduler
# deadline
# cfq
# noop
# sio
IO='$io';

# Kernel Based msm_mpdecision (Show-p1984)
# 0 = disabled
# 1 = enabled
# 2 = use mpdecision
MSM='$msm';

# Kernel samepage merging (KSM)
# 0 = disabled
# 1 = enabled
KSM='$ksm';

# Config badass
# 1 = battery save
# 2 = balance
# 3 = performance
BAD='$bad';

## Config intellidemand
# Inactive max frequency
INTELLIDEMAND='$intellidemand';

# Config OnDemand
# 1 = battery save (sampling rate = 1.2 second)
# 2 = balance (sampling rate = 0.5 second)
# 3 = performance (sampling rate = 0.1 second)
OND='$ond';

# Config Minfree (a.k.a OOM or LMK value - in megabytes)
# 1 = Very Light (2,4,5,8,12)
# 2 = Light (4,8,10,16,24,32)
# 3 = Medium (4,8,16,32,48,64)
# 4 = Aggressive (8,16,32,64,96,128)
# 5 = Optimal I (8,16,32,64,150,180)
# 6 = Optimal II (8,16,32,64,180,200)
# 7 = Very Aggressive (16,32,64,128,192,256)
FREE='$free';

### Config CPU Frequency
## Config CPU max frequency
MAXFREQ='$maxfreq';

## Config CPU max frequency for EACH core
MAX0='$max0';
MAX1='$max1';

## Config CPU min frequency for BOTH cores
MINFREQ='$minfreq';

## Config CPU max screen-off frequency
MAXOFF='$maxoff';

## Config CPU phase frequencies
# Second phase frequency
PHASE='$phase1';
# Third phase frequency (only for badass governor)
PHASE3='$phase3';

# Please get rid of this area !!!

# Config OnDemand
if [ "$GOV" = "3" ]
then
if [ "$OND" = "1" ]
then
echo 120000 > /sys/devices/system/cpu/cpufreq/ondemand/sampling_rate
fi

if [ "$OND" = "2" ]
then
echo 50000 > /sys/devices/system/cpu/cpufreq/ondemand/sampling_rate
fi

if [ "$OND" = "3" ]
then
echo 10000 > /sys/devices/system/cpu/cpufreq/ondemand/sampling_rate
fi
fi

# Config badass
if [ "$GOV" = "1" ]
then
if [ "$BAD" = "1" ]
then
echo 140 > /sys/devices/system/cpu/cpufreq/badass/busy_threshold
echo 110 > /sys/devices/system/cpu/cpufreq/badass/busy_clr_threshold
echo 80 > /sys/devices/system/cpu/cpufreq/badass/semi_busy_threshold
echo 20 > /sys/devices/system/cpu/cpufreq/badass/semi_busy_clr_threshold
echo 300 > /sys/devices/system/cpu/cpufreq/badass/gpu_semi_busy_threshold
echo 250 > /sys/devices/system/cpu/cpufreq/badass/gpu_semi_busy_clr_threshold
echo 750 > /sys/devices/system/cpu/cpufreq/badass/gpu_busy_threshold
echo 600 > /sys/devices/system/cpu/cpufreq/badass/gpu_busy_clr_threshold
fi

if [ "$BAD" = "2" ]
then
echo 130 > /sys/devices/system/cpu/cpufreq/badass/busy_threshold
echo 100 > /sys/devices/system/cpu/cpufreq/badass/busy_clr_threshold
echo 14 > /sys/devices/system/cpu/cpufreq/badass/semi_busy_threshold
echo 6 > /sys/devices/system/cpu/cpufreq/badass/semi_busy_clr_threshold
echo 260 > /sys/devices/system/cpu/cpufreq/badass/gpu_semi_busy_threshold
echo 180 > /sys/devices/system/cpu/cpufreq/badass/gpu_semi_busy_clr_threshold
echo 700 > /sys/devices/system/cpu/cpufreq/badass/gpu_busy_threshold
echo 500 > /sys/devices/system/cpu/cpufreq/badass/gpu_busy_clr_threshold
fi

if [ "$BAD" = "3" ]
then
echo 120 > /sys/devices/system/cpu/cpufreq/badass/busy_threshold
echo 80 > /sys/devices/system/cpu/cpufreq/badass/busy_clr_threshold
echo 8 > /sys/devices/system/cpu/cpufreq/badass/semi_busy_threshold
echo 4 > /sys/devices/system/cpu/cpufreq/badass/semi_busy_clr_threshold
echo 150 > /sys/devices/system/cpu/cpufreq/badass/gpu_semi_busy_threshold
echo 50 > /sys/devices/system/cpu/cpufreq/badass/gpu_semi_busy_clr_threshold
echo 300 > /sys/devices/system/cpu/cpufreq/badass/gpu_busy_clr_threshold
echo 450 > /sys/devices/system/cpu/cpufreq/badass/gpu_busy_threshold
fi
fi

# Config intellidemand
if [ "$GOV" = "2" ]
then
echo 30000 > /sys/devices/system/cpu/cpufreq/intellidemand/sampling_rate
echo 1 > /sys/devices/system/cpu/cpufreq/intellidemand/io_is_busy
echo $INTELLIDEMAND > /sys/devices/system/cpu/cpufreq/intellidemand/lmf_active_max_freq
fi

# Config CPU Frequency
chmod 644 /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
echo $MAXFREQ > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
chmod 644 /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq
echo $MINFREQ > /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq

chmod 644 /sys/devices/system/cpu/cpu1/cpufreq/scaling_max_freq
echo $MAXFREQ > /sys/devices/system/cpu/cpu1/cpufreq/scaling_max_freq
chmod 644 /sys/devices/system/cpu/cpu1/cpufreq/scaling_min_freq
echo $MINFREQ > /sys/devices/system/cpu/cpu1/cpufreq/scaling_min_freq
echo $MAX0 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
echo $MAX1 > /sys/devices/system/cpu/cpu1/cpufreq/scaling_max_freq

chmod 644 /sys/devices/system/cpu/cpu0/cpufreq/screen_off_max_freq
echo $MAXOFF > /sys/devices/system/cpu/cpu0/cpufreq/screen_off_max_freq

# Config Second Phase Frequency
chmod 644 /sys/devices/system/cpu/cpufreq/ondemand/two_phase_freq
echo $PHASE > /sys/devices/system/cpu/cpufreq/ondemand/two_phase_freq

# Config Three Phase Frequency
if [ "$GOV" = "1" ]
then
chmod 644 /sys/devices/system/cpu/cpufreq/badass/three_phase_freq
echo $PHASE3 > /sys/devices/system/cpu/cpufreq/badass/three_phase_freq
fi

# Config 3D GPU setting
chmod 644 /sys/devices/platform/kgsl-3d0.0/kgsl/kgsl-3d0/max_gpuclk
echo $GPU > /sys/devices/platform/kgsl-3d0.0/kgsl/kgsl-3d0/max_gpuclk

# Config 2D GPU setting
chmod 644 /sys/devices/platform/kgsl-2d0.0/kgsl/kgsl-2d0/max_gpuclk
chmod 644 /sys/devices/platform/kgsl-2d0.0/kgsl/kgsl-2d1/max_gpuclk
echo $2D > /sys/devices/platform/kgsl-2d0.0/kgsl/kgsl-2d0/max_gpuclk
echo $2D > /sys/devices/platform/kgsl-2d1.1/kgsl/kgsl-2d1/max_gpuclk

# Config Sweep2Wake
chmod 644 /sys/android_touch/sweep2wake/s2w_switch
echo "$SWEEP" > /sys/android_touch/sweep2wake/s2w_switch

# Config Fastcharge
chmod 644 /sys/kernel/fast_charge/force_fast_charge
echo $FASTCHARGE > /sys/kernel/fast_charge/force_fast_charge

# Config msm_decision
if [ "$MSM" = "1" ]
then
sed -i 's/start/#start/g' /system/etc/init.qcom.post_boot.sh
chmod 644 /sys/kernel/msm_mpdecision/conf/enabled
echo $MSM > /sys/kernel/msm_mpdecision/conf/enabled
fi

if [ "$MSM" = "0" ]
then
sed -i 's/start/#start/g' /system/etc/init.qcom.post_boot.sh
chmod 644 /sys/kernel/msm_mpdecision/conf/enabled
echo $MSM > /sys/kernel/msm_mpdecision/conf/enabled
fi

if [ "$MSM" = "2" ]
then
sed -i 's/#start/start/g' /system/etc/init.qcom.post_boot.sh
chmod 644 /sys/kernel/msm_mpdecision/conf/enabled
echo 0 > /sys/kernel/msm_mpdecision/conf/enabled
start mpdecision
start thermald
fi

# Config KSM
chmod 644 /sys/kernel/mm/ksm/run
echo $KSM > /sys/kernel/mm/ksm/run

# Config i/o scheduler
chmod 644 /sys/block/mmcblk0/queue/scheduler
echo "$IO" > /sys/block/mmcblk0/queue/scheduler
chmod 644 /sys/block/mmcblk1/queue/scheduler
echo "$IO" > /sys/block/mmcblk1/queue/scheduler

# Config Minfree
echo "0,1,2,4,6,15" > /sys/module/lowmemorykiller/parameters/adj
chmod 664 /sys/module/lowmemorykiller/parameters/minfree

if [ "$FREE" = "1" ]
then
echo "512,1024,1280,2048,3072,4096" > /sys/module/lowmemorykiller/parameters/minfree
fi

if [ "$FREE" = "2" ]
then
echo "1024,2048,2560,4096,6144,8192" > /sys/module/lowmemorykiller/parameters/minfree
fi

if [ "$FREE" = "3" ]
then
echo "1024,2048,4096,8192,12288,16384" > /sys/module/lowmemorykiller/parameters/minfree
fi

if [ "$FREE" = "4" ]
then
echo "2048,4096,8192,16384,24576,32768" > /sys/module/lowmemorykiller/parameters/minfree
fi

if [ "$FREE" = "5" ]
then
echo "2048,4096,8192,16384,38400,46080" > /sys/module/lowmemorykiller/parameters/minfree
fi

if [ "$FREE" = "6" ]
then
echo "2048,4096,8192,24576,46080,51200" > /sys/module/lowmemorykiller/parameters/minfree
fi

if [ "$FREE" = "7" ]
then
echo "4096,8192,16384,32768,49152,65536" > /sys/module/lowmemorykiller/parameters/minfree
fi

# Config logcat
if [ "$LOGCAT" = "1" ]
then
if [ -e /dev/log/main ] ; then
rm /dev/log/main
fi
fi

# Config Vsync
if [ "$VSYNC" = "1" ]
then
mount -t debugfs debugfs /sys/kernel/debug
echo "1" > /sys/kernel/debug/msm_fb/0/vsync_enable
echo "1" > /sys/kernel/debug/msm_fb/0/hw_vsync_mode
umount /sys/kernel/debug
fi

if [ "$VSYNC" = "2" ]
then
mount -t debugfs debugfs /sys/kernel/debug
echo "0" > /sys/kernel/debug/msm_fb/0/vsync_enable
echo "0" > /sys/kernel/debug/msm_fb/0/hw_vsync_mode
umount /sys/kernel/debug
fi

# Config Fsync
if [ "$FSYNC" = "2" ]
then
echo "0" > sys/class/misc/fsynccontrol/fsync_enabled
fi