#!/system/bin/sh
#Credits: Imoseyon and CM Team

# file system speedups
busybox mount -o remount,noatime,barrier=0,nobh /system
busybox mount -o remount,noatime,barrier=0,nobh /data
busybox mount -o remount,noatime,barrier=0,nobh /cache

# sysctl tweaks
sysctl -p 

# sd card speed boost
if [ -e /sys/devices/virtual/bdi/179:0/read_ahead_kb ]; then
  echo 2048 > /sys/devices/virtual/bdi/179:0/read_ahead_kb
fi

#db cleanup
for i in `find /data -iname "*.db"`;	do
	sqlite3 $i 'VACUUM;'; 
done;

#Log file for successful init.d
touch /data/local/tmp/init.d_log_test.txt
echo "done" >> /data/local/tmp/init.d_log_test.txt