[XPERIA X10 Android Development] kaosdroid:
sure man !

you have two way for run tweak

in install-recovery.sh

or ini.d folder

but for be sure

create a file in system/etc

name it "install-recovery.sh"

copy this in and give all permission.

#!/system/bin/sh

#Mount Points

busybox mount -o remount,rw,noatime,nodiratime / -t rootfs

busybox mount -o remount,rw,noatime,nodiratime /sys -t sysfs

busybox mount -o remount,rw,noatime,nodiratime /system

busybox mount -o remount,rw,noatime,nodiratime /data

busybox mount -o remount,rw,noatime,nodiratime /cache

#init.d support

busybox run-parts /system/etc/init.d

run-parts /system/etc/init.d >> /data/local/tmp/runparts.log 2>&1

now put your tweak in ini.d folder and reboot

be carefull !

if you have zipalign tweak

this tweak kill all tweak at boot because it unmount partition

and make it r/o instead of r/w

well,

tweak cannot access system or data like VM or sdcard tweak like read-ahead kb 2048.

now go in data/local/tmp

and check the log

to see if all it ok

but if ini.d does not run,

you could

insert tweak in install-recovery.sh

like this

#!/system/bin/sh

#give system permissions

busybox mount -o remount,rw /system

chmod 777 /system

#init.d support

busybox run-parts /system/etc/init.d

run-parts /system/etc/init.d >> /data/local/tmp/runparts.log 2>&1

#uncap fps

mount -t debugfs debugfs /sys/kernel/debug

echo '0' > /sys/kernel/debug/msm_fb/0/vsync_enable

#th config

echo '0' > /sys/kernel/debug/msm_fb/0/hw_vsync_mode

echo '0' > /sys/kernel/debug/msm_fb/0/sw_refreshing_enable

echo '2' > /sys/kernel/debug/msm_fb/0/ref_cnt

echo '8' > /sys/kernel/debug/msm_fb/0/backbuff

echo '6000' > /sys/kernel/debug/msm_fb/0/refx100

#echo '1' > /sys/power/wake_lock *dangerous

#echo '1' > /sys/kernel/debug/kgsl/cache_enable *dangerous

echo '8192' > /sys/block/mmcblk0/queue/read_ahead_kb

echo '128' > /sys/block/mmcblk0/queue/max_sectors_kb

echo '8192' > /sys/block/mmcblk1/queue/read_ahead_kb

echo '128' > /sys/block/mmcblk1/queue/max_sectors_kb

#rm -f -rf /data/idd

#rm -f -rf /data/semc-checkin

umount /sys/kernel/debug

echo 0 > /sys/kernel/logger/log_main/enable

echo 0 > /sys/kernel/logger/log_event/enable

echo 0 > /sys/kernel/logger/log_radio/enable

echo 1024 > /sys/devices/virtual/bdi/179:0/read_ahead_kb

echo 1024 > /sys/devices/virtual/bdi/default/read_ahead_kb

echo 90 > /sys/devices/system/cpu/cpu0/cpufreq/ondemand/up_threshold

echo 30 > /sys/devices/system/cpu/cpu0/cpufreq/ondemand/down_differential

echo 20000 > /sys/devices/system/cpu/cpu0/cpufreq/ondemand/sampling_rate

echo 0 > /sys/devices/system/cpu/cpu0/cpufreq/ondemand/powersave_bias

echo 0 > /sys/devices/system/cpu/cpu0/cpufreq/ondemand/ignore_nice_load

# Delay the Media Scanner to help boot times

pm disable com.android.providers.media/com.android.providers.media.MediaScannerReceiver &

sleep 80 && pm enable com.android.providers.media/com.android.providers.media.MediaScannerReceiver &

#I/O Scheduler Tweaks

mount -o remount,noatime / -t rootfs

mount -o remount,noatime /dev -t devpts

mount -o remount,noatime /proc -t proc

mount -o remount,noatime /sys -t sysfs

mount -o remount,noatime /mnt/asec -t tmpfs

mount -o remount,noatime /system -t yaffs2

mount -o remount,noatime /data -t yaffs2

mount -o remount,noatime /cache -t yaffs2

mount -o remount,noatime /mnt/sdcard -t vfat

mount -o remount,noatime /mnt/secure/asec -t vfat

mount -o remount,noatime /mnt/sdcard/.android_secure -t tmpfs

i=`ls -d /sys/block/mtdblock3/queue/scheduler`;

STL=`ls -d /sys/block/stl*`;

BML=`ls -d /sys/block/bml*`;

MMC=`ls -d /sys/block/mmc*`;

TFSR=`ls -d /sys/block/tfsr*`;

DM=`ls -d /sys/block/dm*`;

MTD=`ls -d /sys/block/mtd*`;

LOOP=`ls -d /sys/block/loop*`;

RAM=`ls -d /sys/block/ram*`;

SYSDEV=`mount | grep '/system' | cut -d '/' -f 4`;

IO_SCHEDULER=`echo "noop" > /sys/block/mtdblock3/queue/scheduler/queue/rotational`;

for i in `busybox ls -1 /sys/block/mtdblock*`; do

echo "deadline" > $i/queue/scheduler;

done;

for k in $(busybox mount | cut -d " " -f3)

do

sync;

busybox mount -o remount,noatime,nodiratime $k;

done;

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

echo "deadline" > /sys/block/dm-0/queue/scheduler

echo "deadline" > /sys/block/dm-1/queue/scheduler

for i in $MMC $MTD $LOOP; do

echo 0 > $i/queue/rotational;

done;

for i in $MMC $MTD; do

echo "deadline" > $i/queue/scheduler;

done;

for i in $MMC; do

echo 4096 > $i/queue/read_ahead_kb;

echo 0 > $i/queue/rotational;

echo 1 > $i/queue/iosched/low_latency;

echo 16 > $i/queue/iosched/quantum;

echo 8192 > $i/queue/nr_requests;

echo 1000000000 > $i/queue/iosched/back_seek_max;

for i in $STL $BML $MMC;

do

echo $IO_SCHEDULER > $i/queue/scheduler;

case $IO_SCHEDULER in

"deadline")

echo 1 > $i/queue/iosched/fifo_batch;;

"cfq")

echo 1 > $i/queue/iosched/back_seek_penalty;

echo 3 > $i/queue/iosched/slice_idle;;

"bfq")

echo 1 > $i/queue/iosched/back_seek_penalty;

echo 3 > $i/queue/iosched/slice_idle;;

"noop")

echo 1 > $i/queue/iosched/back_seek_penalty;

echo 3 > $i/queue/iosched/slice_idle;;

esac;

done;

#Dalvik Cache

if [ ! -d /cache/dalvik-cache ]

then

busybox rm -rf /cache/dalvik-cache /data/dalvik-cache

mkdir /cache/dalvik-cache /data/dalvik-cache

fi

#Dalvik Cache

busybox chown 1000:1000 /cache/dalvik-cache

busybox chmod 0771 /cache/dalvik-cache

#bind mount dalvik-cache so we can still boot without the sdcard

busybox mount -o bind /cache/dalvik-cache /data/dalvik-cache

busybox chown 1000:1000 /data/dalvik-cache

busybox chmod 0771 /data/dalvik-cache

#Remove

busybox rm -rf /data/tombstones/*

#Zipalign

mount -o remount,rw -t yaffs2 `grep /system /proc/mounts | cut -d' ' -f1` /system

cd /system/app

for z in *.apk; do

zipalign -c 4 $z

if [ "$?" -ne "0" ]; then

echo zipalign $z !

zipalign -f 4 $z /tmp/$z

cp /tmp/$z $z

rm /tmp/$z

fi

done

mount -o remount,ro -t yaffs2 `grep /system /proc/mounts | cut -d' ' -f1` /system

mount -o remount,rw -t yaffs2 `grep /system /proc/mounts | cut -d' ' -f1` /data

cd /data/app

for z in *.apk; do

zipalign -c 4 $z

if [ "$?" -ne "0" ]; then

echo zipalign $z !

zipalign -f 4 $z /tmp/$z

cp /tmp/$z $z

rm /tmp/$z

fi

done

mount -o remount,ro -t yaffs2 `grep /system /proc/mounts | cut -d' ' -f1` /data

#Phone Lag Tweaks

MAX_PHONE() {

pidphone=`pidof com.android.phone`;

if [ $pidphone ]; then

echo -17 > /proc/$pidphone/oom_adj;

renice -20 $pidphone;

exit;

else

sleep 5;

MAX_PHONE;

fi;

}

(while [ 1 ]; do

sleep 10;

MAX_PHONE;

done &);

if [ $ENABLE_MAXPHONE -eq 1 ];

then

PROC_ADJUST "com.android.phone" "-20" &

fi;

for j in $DM $MTD $LOOP $RAM; do

echo 0 > $j/queue/rotational;

done;

strace -p $(pidof yourapp) # for all your running applications

ps aux | awk '{print$10,$11}' | sort -n # will list all running softs sorted by used cpu time

#CPUTweak's Variables

last_source="unknown";

charging_source=$(cat /sys/class/power_supply/battery/charging_source);

capacity=$(cat /sys/class/power_supply/battery/capacity);

if [ $ENABLE_SWITCH -eq 1 ];

then

ALLFREQS=`cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_frequencies`;

(while [ 1 ];

do

cat /sys/power/wait_for_fb_wake;

AWAKE_MODE;

cat /sys/power/wait_for_fb_sleep;

SLEEP_MODE;

done &)

fi;

BAT_SLEEP_GOV="powersave"

USB_SLEEP_GOV="powersave"

POW_SLEEP_GOV="powersave"

#CPUTweak's Functions

Battery() {

(while [ 1 ]; do

if [ $AWAKE = "awake" ]; then

echo $BAT_AWAKE_GOV > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor

echo 576000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq

echo 90 > /sys/devices/system/cpu/cpu0/cpufreq/ondemand/up_threshold

echo 100000 > /sys/devices/system/cpu/cpu0/cpufreq/ondemand/sampling_rate

echo 100 > /sys/devices/system/cpu/cpu0/cpufreq/ondemand/powersave_bias

AWAKE=

fi;

if [ $SLEEPING = "sleeping" ]; then

echo $BAT_SLEEP_GOV > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor

echo 576000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq

echo 245760 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq

echo 80 > /sys/devices/system/cpu/cpu0/cpufreq/powersave/up_threshold

echo 40000 > /sys/devices/system/cpu/cpu0/cpufreq/powersave/sampling_rate

echo 0 > /sys/devices/system/cpu/cpu0/cpufreq/powersave/powersave_bias

SLEEPING=

fi;

done &)

mount -o remount,ro -t yaffs2 /dev/block/mtdblock3

}

USB() {

(while [ 1 ]; do

if [ $AWAKE = "awake" ]; then

echo $USB_AWAKE_GOV > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor

echo 576000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq

echo 90 > /sys/devices/system/cpu/cpu0/cpufreq/ondemand/up_threshold

echo 20000 > /sys/devices/system/cpu/cpu0/cpufreq/ondemand/sampling_rate

echo 0 > /sys/devices/system/cpu/cpu0/cpufreq/ondemand/powersave_bias

AWAKE=

fi;

if [ $SLEEPING = "sleeping" ]; then

echo $USB_SLEEP_GOV > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor

echo 576000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq

echo 245760 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq

echo 90 > /sys/devices/system/cpu/cpu0/cpufreq/powersave/up_threshold

echo 20000 > /sys/devices/system/cpu/cpu0/cpufreq/powersave/sampling_rate

echo 0 > /sys/devices/system/cpu/cpu0/cpufreq/powersave/powersave_bias

SLEEPING=

fi;

done &)

}

Power() {

(while [ 1 ]; do

if [ $AWAKE = "awake" ]; then

echo $POW_AWAKE_GOV > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor

echo 576000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq

echo 90 > /sys/devices/system/cpu/cpu0/cpufreq/ondemand/up_threshold

echo 20000 > /sys/devices/system/cpu/cpu0/cpufreq/ondemand/sampling_rate

echo 0 > /sys/devices/system/cpu/cpu0/cpufreq/ondemand/powersave_bias

AWAKE=

fi;

if [ $SLEEPING = "sleeping" ]; then

echo $POW_SLEEP_GOV > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor

echo 576000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq

echo 245760 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq

echo 90 > /sys/devices/system/cpu/cpu0/cpufreq/powersave/up_threshold

echo 20000 > /sys/devices/system/cpu/cpu0/cpufreq/powersave/sampling_rate

echo 0 > /sys/devices/system/cpu/cpu0/cpufreq/powersave/powersave_bias

SLEEPING=

fi;

done &)

}

#

# Loopy Smoothness Tweak for X10

#

for n in 1 2

do

USER_LAUNCHER="com.sonyericsson.home"	# Change this to your launcher app

NUMBER_OF_CHECKS=35	# Total number of rechecks before ending 1st loop

SLEEP_TIME=3	# Number of seconds between rechecking processes

PROCESSES_TOTAL=4	# Must be edited to match the number of processes to be checked

DEBUG_ECHO=0	# Debug on/off

CHECK_COUNT=0	# Don't edit

P_CHECK=0	# Don't edit

CHECK_OK=0	# Unused

PROCESS_1=0; PROCESS_2=0; PROCESS_3=0; PROCESS_4=0; PROCESS_5=0; PROCESS_6=0;

PROCESS_7=0; PROCESS_8=0; PROCESS_9=0; PROCESS_10=0; PROCESS_11=0; PROCESS_12=0;

PROCESS_13=0; PROCESS_14=0; PROCESS_15=0; PROCESS_16=0; PROCESS_17=0; PROCESS_18=0;

PROCESS_19=0; PROCESS_20=0; PROCESS_21=0; PROCESS_22=0; PROCESS_23=0; PROCESS_24=0;

if [ $n -eq "1" ]; then

if [ $DEBUG_ECHO -eq "1" ]; then

echo ""

echo "LST Debug: $(date)"

echo "LST Debug: Initiate"

fi;

# Pause and then loop until kswapd0 is found, which should be instant anyway

sleep 1

SWAP_SLEEP_TIME=3; SWAP_NUMBER_OF_CHECKS=30; SWAP_CHECK_COUNT=0; SWAP_CHECK_COUNT_OK=0; while [ $SWAP_CHECK_COUNT -lt $SWAP_NUMBER_OF_CHECKS ]; do if [ `pidof kswapd0` ]; then renice 19 `pidof kswapd0`; SWAP_CHECK_COUNT=$SWAP_NUMBER_OF_CHECKS; SWAP_CHECK_COUNT_OK=1; else sleep $SWAP_SLEEP_TIME; fi; SWAP_CHECK_COUNT=`expr $SWAP_CHECK_COUNT + 1`; done; if [ $SWAP_CHECK_COUNT_OK -lt 1 ]; then echo "LST Debug: 'kswapd0' expired after `expr $SWAP_CHECK_COUNT \* $SWAP_SLEEP_TIME` seconds"; fi;

if [ $DEBUG_ECHO -eq "1" ]; then

echo "LST Debug: $(date)";

echo "LST Debug: kswapd0 found";

fi;

fi;

# Check briefly one more time

if [ $n -eq "2" ]; then

if [ $DEBUG_ECHO -eq "1" ]; then

echo "LST Debug: 2nd loop"

fi;

NUMBER_OF_CHECKS=6	# Editing not recommended

SLEEP_TIME=5	# Editing not recommended

fi;

while [ $CHECK_COUNT -lt $NUMBER_OF_CHECKS ];

do

# Resident system apps

if [ $PROCESS_1 -eq "0" ]; then PNAME="com.android.phone"; NICELEVEL=-20; if [ `pidof $PNAME` ]; then renice $NICELEVEL `pidof $PNAME`; PROCESS_1=1; P_CHECK=`expr $P_CHECK + 1`; fi; fi;

if [ $PROCESS_2 -eq "0" ]; then PNAME="$USER_LAUNCHER"; NICELEVEL=-19; if [ `pidof $PNAME` ]; then renice $NICELEVEL `pidof $PNAME`; PROCESS_2=1; P_CHECK=`expr $P_CHECK + 1`; fi; fi;

if [ $PROCESS_3 -eq "0" ]; then PNAME="com.sonyericsson.conversations"; NICELEVEL=-19; if [ `pidof $PNAME` ]; then renice $NICELEVEL `pidof $PNAME`; PROCESS_3=1; P_CHECK=`expr $P_CHECK + 1`; fi; fi;

if [ $PROCESS_4 -eq "0" ]; then PNAME="com.sonyericsson.music"; NICELEVEL=-19; if [ `pidof $PNAME` ]; then renice $NICELEVEL `pidof $PNAME`; PROCESS_4=1; P_CHECK=`expr $P_CHECK + 1`; fi; fi;

# If all processes are done, loop can finish early

if [ $P_CHECK -ge $PROCESSES_TOTAL ]; then CHECK_COUNT=$NUMBER_OF_CHECKS; else sleep $SLEEP_TIME; fi;

CHECK_COUNT=`expr $CHECK_COUNT + 1`;

done

if [ $DEBUG_ECHO -eq "1" ]; then

echo "LST Debug: $(date)"

if [ $PROCESS_1 -eq "0" ]; then echo "LST Debug: PROCESS_1 expired after `expr $CHECK_COUNT \* $SLEEP_TIME` seconds"; fi;

if [ $PROCESS_2 -eq "0" ]; then echo "LST Debug: PROCESS_2 expired after `expr $CHECK_COUNT \* $SLEEP_TIME` seconds"; fi;

if [ $PROCESS_3 -eq "0" ]; then echo "LST Debug: PROCESS_3 expired after `expr $CHECK_COUNT \* $SLEEP_TIME` seconds"; fi;

if [ $PROCESS_3 -eq "0" ]; then echo "LST Debug: PROCESS_3 expired after `expr $CHECK_COUNT \* $SLEEP_TIME` seconds"; fi;

echo "LST Debug: Checking complete"

fi;

done

if [ $DEBUG_ECHO -eq "1" ]; then

echo "LST Debug: Done"

echo ""

fi;

this is an exemple!

but you could use it !

it improve speed of your phone hahaha !!!

bip