[Galaxy S II Android Development] deepongi:
KangBang Kernel Scripts Development

This thread is dedicated to the development of bash scripts to control several aspects of KangBang Kernel.

The scripts below, are there for that. most of the work have been done already (but more additions to be made), but be are with problems on the logs files... the output indicates that the scripts are giving errors...

these are scripts so far​

S91voltctrl​

Spoiler content hidden.

S92zipalign (credits goes to darky for original)
​

Spoiler content hidden.

S93sqlite​

Spoiler content hidden.

S94tweaks​

#!/system/bin/sh
##############################################################
## Miscellaneous Tweaks script by infected_ #
##############################################################
#
LOG_FILE=/data/log/tweaks.log
rm -Rf $LOG_FILE
exec &> $LOG_FILE
#
echo "Applying Tweaks $( date +"%m-%d-%Y %H:%M:%S" )"
#
# ***************************************
# Turn logging off
# ***************************************
#
echo "Turning off logging"
su
mount -o remount,rw /
rm -rf /dev/log
echo "0" > /sys/module/ump/parameters/ump_debug_level
echo "0" > /sys/module/mali/parameters/mali_debug_level
echo "0" > /sys/module/kernel/parameters/initcall_debug
echo "0" > /sys//module/lowmemorykiller/parameters/debug_level
echo "0" > /sys/module/earlysuspend/parameters/debug_mask
echo "0" > /sys/module/alarm/parameters/debug_mask
echo "0" > /sys/module/alarm_dev/parameters/debug_mask
echo "0" > /sys/module/binder/parameters/debug_mask
echo "0" > /sys/module/xt_qtaguid/parameters/debug_mask
echo ""
echo "---------------"

# ************************************************
# VM Tweaks
# ************************************************

echo "Enabling VM Tweaks"
sysctl -w vm.swappiness=0
sysctl -w vm.vfs_cache_pressure=10
sysctl -w vm.dirty_background_ratio=45
sysctl -w vm.dirty_ratio=50
sysctl -w vm.dirty_writeback_centisecs=2000
sysctl -w vm.dirty_expire_centisecs=1000
sysctl -w vm.min_free_kbytes=4096
sysctl -w kernel.sched_min_granularity_ns=200000 > /dev/null
sysctl -w kernel.sched_latency_ns=400000 > /dev/null
sysctl -w kernel.sched_wakeup_granularity_ns=100000 > /dev/null
echo ""
echo "---------------"

# ********************************************************
# Enable JIT Packet Filter Compiler (needs kernel support)
# ********************************************************

echo "Enabling JIT Packet Filter Compiler"
echo "1" > /proc/sys/net/core/bpf_jit_enable
echo ""
echo "---------------"

# ********************************************************
# microSD card speed tweak
# ********************************************************

echo "Enabling microSD card speed tweak"
echo "4096" > /sys/devices/virtual/bdi/179:0/read_ahead_kb;
echo ""
echo "---------------"

# ********************************************************
# Flags blocks as non-rotational and increases cache size
# ********************************************************

echo "Flagging blocks as non-rotational and increasig cache size"
LOOP=`ls -d /sys/block/loop*`;
RAM=`ls -d /sys/block/ram*`;
MMC=`ls -d /sys/block/mmc*`;
for j in $LOOP $RAM
do
echo "0" > $j/queue/rotational;
echo "4096" > $j/queue/read_ahead_kb;
done
echo ""
echo "---------------"

# ********************************************************
# Battery tweaks
# ********************************************************

echo "Enabling battery tweaks"
echo "500" > /proc/sys/vm/dirty_expire_centisecs
echo "1000" > /proc/sys/vm/dirty_writeback_centisecs
echo ""
echo "---------------"

# ********************************************************
# EXT4 tweaks
# ********************************************************

echo "Enabling EXT4 tweaks"

# a) remove journals
echo "Removing journals"
tune2fs -f -o journal_data_writeback /dev/block/mmcblk0p9
tune2fs -f -O ^has_journal /dev/block/mmcblk0p9
tune2fs -f -o journal_data_writeback /dev/block/mmcblk0p7
tune2fs -f -O ^has_journal /dev/block/mmcblk0p7
tune2fs -f -o journal_data_writeback /dev/block/mmcblk0p10
tune2fs -f -O ^has_journal /dev/block/mmcblk0p10
echo ""
echo "---------------"

# b) better mount options
echo "Applying better mount options"
busybox mount -o remount,noatime,noauto_da_alloc,nodiratime,barrier=0,nobh /system
busybox mount -o remount,noatime,noauto_da_alloc,nosuid,nodev,nodiratime,barrier=0,nobh /data
busybox mount -o remount,noatime,noauto_da_alloc,nosuid,nodev,nodiratime,barrier=0,nobh /cache
echo ""
echo "---------------"
#
echo "Tweaks applying finished at $( date +"%m-%d-%Y %H:%M:%S" )"

S95bln​

Spoiler content hidden.

We appreciate ALL the help we can't get from the XDA community..

This is a fantastic kernel compilded and mantained by @sakindia123, but there aren't lots of options to control it, besides the init.d scripts...

So please, if you have suggestions, corrections and additions to be made, please do so ! :)​