[Xperia Arc Android Development] gu5t3r:
You have some BAD scripts in init.d...

06removecache

. REMOVE_CACHE=1

if busybox [ $REMOVE_CACHE -eq 1 ]; then
CACHE_DIR=(` busybox find /data/data -type d -iname *cache* -print `);
for dir in ${CACHE_DIR[*]}; do
busybox find $dir -type f -delete
done
log -p i -t boot "Cleared data cache..."
fi

doesn't do anything because there is no shell line...and that DOT is synonym for source command which doesn't make sense?

should be

#!/system/bin/sh

REMOVE_CACHE=1

if [ "$REMOVE_CACHE" -eq 1 ]; then
CACHE_DIR=(`busybox find /data/data -type d -iname *cache* -print`);
for dir in ${CACHE_DIR[*]}; do
busybox find $dir -type f -delete
done
log -p i -t boot "Cleared data cache..."
fi

97oom

#!/system/bin/sh

sleep 60

PPID=$(pidof com.sonyericsson.android.socialphonebook)
echo "-17" > /proc/$PPID/oom_adj
PPID=$(pidof com.android.phone)
echo "-17" > /proc/$PPID/oom_adj
PPID=$(pidof com.sonyericsson.home)
echo "-17" > /proc/$PPID/oom_adj
PPID=$(pidof com.sonyericsson.conversations)
echo "-17" > /proc/$PPID/oom_adj

On kernels with exec init.d support script is making phone stuck for 60 secs on kernel logo (it should be relaunched in background), and sleeping 60 secs is not guarantee launcher, messaging app and contacts app is working...Also Sony contacts and messaging exit on their own not matter how high adj you give them...So, this is just launcher BulletProofing if phone boots in 60 secs...You should remove this script or at least change to this:

#!/system/bin/sh

RunInBackground(){
while [ ! "`busybox ps | busybox grep android | busybox grep -v grep`" ]; do sleep 10; done

sleep 60

PPID=$(pidof com.sonyericsson.android.socialphonebook)
echo "-17" > /proc/$PPID/oom_adj
PPID=$(pidof com.android.phone)
echo "-17" > /proc/$PPID/oom_adj
PPID=$(pidof com.sonyericsson.home)
echo "-17" > /proc/$PPID/oom_adj
PPID=$(pidof com.sonyericsson.conversations)
echo "-17" > /proc/$PPID/oom_adj
}
exec > /dev/null 2>&1;
RunInBackground & exit 0;

99Pimp_my_Rom

#!/system/bin/sh
### Pimp my Rom : Optimization of all sqlite3 databases each boot
for sqlite3 in \
/data/system/accounts.db
/data/drm/marlin/marlindatabase.db
/data/data/com.sonyericsson.eventstream/databases/eventstream.db
/data/data/com.sonyericsson.credentialmanagerservice/credmgr.db
/data/data/com.sonyericsson.customizedsettings/databases/DefaultValue.db
/data/data/com.sonyericsson.lockscreen.uxpnxt/databases/lockscreenprovider.db
/data/data/com.android.providers.downloads/databases/downloads.db
/data/data/com.sonyericsson.provider.voipcalllog/databases/voip.db
/data/data/com.google.android.gm/databases/internal.zohaibtariq3@gmail.com.db
/data/data/com.google.android.gm/databases/mailstore.zohaibtariq3@gmail.com.db
/data/data/com.speedsoftware.rootexplorer/databases/explorer.db
/data/data/com.sonyericsson.socialpane.friends/databases/friends.db
/data/data/com.google.android.partnersetup/databases/rlz_data.db
/data/data/com.google.android.gsf/databases/talk.db
/data/data/com.google.android.gsf/databases/subscribedfeeds.db
/data/data/com.google.android.gsf/databases/googlesettings.db
/data/data/com.google.android.gsf/databases/gservices.db
/data/data/com.android.providers.media/databases/external-f86845f0.db
/data/data/com.android.providers.media/databases/internal.db
/data/data/com.android.phone/databases/rejectmsgs.db
/data/data/com.android.vending/databases/localappstate.db
/data/data/com.android.vending/databases/suggestions.db
/data/data/com.android.vending/databases/library.db
/data/data/com.sonyericsson.music/databases/playqueue.db
/data/data/com.sonyericsson.music/databases/tiles.db
/data/data/com.sonyericsson.organizer/databases/styles.db
/data/data/com.sonyericsson.organizer/databases/alarms.db
/data/data/com.android.providers.contacts/databases/contacts2.db
/data/data/com.android.providers.contacts/databases/profile.db
/data/data/com.sonyericsson.metadatacleanup/databases/mediaextra-external-f86845f0.db
/data/data/com.android.providers.telephony/databases/mmssms.db
/data/data/com.android.providers.telephony/databases/telephony.db
/data/data/com.android.providers.settings/databases/settings.db
/data/data/com.android.email/databases/EmailProviderBody.db
/data/data/com.android.email/databases/EmailProvider.db
/data/data/com.android.email/databases/EmailProviderBackup.db
/data/data/com.sonyericsson.home/databases/google_analytics.db
/data/data/com.facebook.katana/databases/webviewCookiesChromium.db
/data/data/com.facebook.katana/databases/bookmarks.db
/data/data/com.facebook.katana/databases/webview.db
/data/data/com.facebook.katana/databases/uploadmanager.db
/data/data/com.facebook.katana/databases/webviewCookiesChromiumPrivate.db
/data/data/com.facebook.katana/databases/fb.db
/data/data/com.android.browser/app_appcache/ApplicationCache.db
/data/data/com.android.browser/databases/webviewCookiesChromiumPrivate.db
/data/data/com.android.browser/databases/browser2.db
/data/data/com.android.browser/databases/webviewCookiesChromium.db
/data/data/com.android.browser/databases/autofill.db
/data/data/com.android.browser/databases/webview.db
/data/data/com.android.browser/app_geolocation/GeolocationPermissions.db
/data/data/com.android.browser/app_geolocation/CachedGeoposition.db
/data/data/com.android.browser/app_databases/Databases.db
/data/data/com.android.browser/app_icons/WebpageIcons.db
/data/data/com.sonyericsson.video/databases/metadata.db
/data/data/com.sonyericsson.video/databases/tiles.db
/data/data/com.android.providers.calendar/databases/calendar.db
/data/data/com.sonyericsson.android.smartsearch/databases/smartsearch.db
/data/data/com.sonymobile.musicslideshow/databases/external-f86845f0.db; do \
/system/xbin/sqlite3 'VACUUM;';
/system/xbin/sqlite3 'REINDEX;'; done;
### Pimp my Rom : Battery Savings
echo 500 > /proc/sys/vm/dirty_expire_centisecs
echo 1000 > /proc/sys/vm/dirty_writeback_centisecs
### Pimp my Rom : Strict Minfree Values
echo '2048,3840,14080,15360,17920,20480' > /sys/module/lowmemorykiller/parameters/minfree
###Disable log cat on boot
rm /dev/log/main

Has bad syntax in sqlite db optimizing (you don't specify db to optimize), does not run db optimizing in background and should look like this:

#!/system/bin/sh
### Pimp my Rom : Optimization of all sqlite3 databases each boot
OptimizeDatabases(){
if [ -e /system/xbin/sqlite3 ]; then
for i in `busybox find ./ -iname "*.db"`; do
/system/xbin/sqlite3 $i 'VACUUM;'
/system/xbin/sqlite3 $i 'REINDEX;'
done
fi
}
### Pimp my Rom : Battery Savings
echo 500 > /proc/sys/vm/dirty_expire_centisecs
echo 1000 > /proc/sys/vm/dirty_writeback_centisecs
### Pimp my Rom : Strict Minfree Values
echo '2048,3840,14080,15360,17920,20480' > /sys/module/lowmemorykiller/parameters/minfree
###Disable log cat on boot
rm /dev/log/main

exec > /dev/null 2>&1;
OptimizeDatabases & exit 0;

S86battery

#!/system/bih/sh
#
#

echo "500" > /proc/sys/vm/dirty_expire_centisecs;
echo "1000" > /proc/sys/vm/dirty_writeback_centisecs

#battery tweaks (sleepers)
mount -t debugfs none /sys/kernel/debug
echo NO_NEW_FAIR_SLEEPERS > /sys/kernel/debug/sched_features;
echo NO_NORMALIZED_SLEEPERS > /sys/kernel/debug/sched_features;
umount /sys/kernel/debug

if [ -e /proc/sys/kernel/sched_min_granularity_ns ]
then
echo 200000 > /proc/sys/kernel/sched_min_granularity_ns;
fi

if [ -e /proc/sys/kernel/sched_latency_ns ]
then
echo 400000 > /proc/sys/kernel/sched_latency_ns;
fi

if [ -e /proc/sys/kernel/sched_wakeup_granularity_ns ]
then
echo 100000 > /proc/sys/kernel/sched_wakeup_granularity_ns;
fi

if [ -e /proc/sys/kernel/hung_task_timeout_secs ]
then
echo 45 > /proc/sys/kernel/hung_task_timeout_secs;s
#(busybox expr `cat /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_transition_latency` \* 750 / 1000);
#echo $SAMPLING_RATE > /sys/devices/system/cpu/cpu0/cpufreq/ondemand/sampling_rate;
#echo 10000 > /sys/devices/system/cpu/cpu0/cpufreq/ondemand/sampling_rate;
echo 70 > /sys/devices/system/cpu/cpu0/cpufreq/ondemand/up_threshold;

SLEEP=120

if [ -e /data/.battery-calibrated ] ; then
exit 0
fi

(
while : ; do
LEVEL=$(cat /sys/class/power_supply/battery/capacity)
CUR=$(cat /sys/class/power_supply/battery/batt_current)
if [ "$LEVEL" == "100" ] && [ "$CUR" == "0" ] ; then
log -p i -t battery-calibration "*** LEVEL: $LEVEL CUR: $CUR***: calibrating..."
rm -f /data/system/batterystats.bin
touch /data/.battery-calibrated
exit 0
fi
# log -p i -t battery-calibration "*** LEVEL: $LEVEL CUR: $CUR ***: sleeping for $SLEEP s..."
sleep $SLEEP
done
)

I don't think this script improves battery as it makes tweaks to do quite opposite...It should be removed or at least battery calibration part relaunched in bg so it can't bootloop the phone; now I found it is missing fi closure tag, so i'm not sure if it even run, that may be the reason phone didn't bootloop

#!/system/bih/sh
#
#

echo "500" > /proc/sys/vm/dirty_expire_centisecs;
echo "1000" > /proc/sys/vm/dirty_writeback_centisecs

#battery tweaks (sleepers)
mount -t debugfs none /sys/kernel/debug
echo NO_NEW_FAIR_SLEEPERS > /sys/kernel/debug/sched_features;
echo NO_NORMALIZED_SLEEPERS > /sys/kernel/debug/sched_features;
umount /sys/kernel/debug

if [ -e /proc/sys/kernel/sched_min_granularity_ns ]; then
echo 200000 > /proc/sys/kernel/sched_min_granularity_ns;
fi

if [ -e /proc/sys/kernel/sched_latency_ns ]; then
echo 400000 > /proc/sys/kernel/sched_latency_ns;
fi

if [ -e /proc/sys/kernel/sched_wakeup_granularity_ns ]; then
echo 100000 > /proc/sys/kernel/sched_wakeup_granularity_ns;
fi

if [ -e /proc/sys/kernel/hung_task_timeout_secs ]; then
echo 45 > /proc/sys/kernel/hung_task_timeout_secs;s
#(busybox expr `cat /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_transition_latency` \* 750 / 1000);
#echo $SAMPLING_RATE > /sys/devices/system/cpu/cpu0/cpufreq/ondemand/sampling_rate;
#echo 10000 > /sys/devices/system/cpu/cpu0/cpufreq/ondemand/sampling_rate;
echo 70 > /sys/devices/system/cpu/cpu0/cpufreq/ondemand/up_threshold;
# YOU WERE MISSING THIS FI IN NEXT LINE
fi

if [ -e /data/.battery-calibrated ]; then
exit 0
fi

CalibrateBattery(){
SLEEP=120
while : ; do
LEVEL=$(cat /sys/class/power_supply/battery/capacity)
CUR=$(cat /sys/class/power_supply/battery/batt_current)
if [ "$LEVEL" == "100" ] && [ "$CUR" == "0" ] ; then
log -p i -t battery-calibration "*** LEVEL: $LEVEL CUR: $CUR***: calibrating..."
rm -f /data/system/batterystats.bin
touch /data/.battery-calibrated
exit 0
fi
# log -p i -t battery-calibration "*** LEVEL: $LEVEL CUR: $CUR ***: sleeping for $SLEEP s..."
sleep $SLEEP
done
}

exec > /dev/null 2>&1
CalibrateBattery & exit 0;

Speedy

#!/system/bin/sh
#
#
#
rm -r /data/local/tmp/*
rm -r /data/tmp/*
rm -r /data/system/usagestats/*
rm -r /data/system/appusagestats/*
rm -r /data/system/dropbox/*
rm -r /data/tombstones/*
rm -r /data/anr/*
busybox chmod 000 /data/system/userbehavior.db
busybox chmod 000 /data/system/usagestats/
busybox chmod 000 /data/system/dropbox/
busybox chmod 000 /data/anr/
busybox chmod 000 /data/tombstones/
busybox chmod 000 /data/system/appusagestats/
busybox chmod 000 /data/data/com.google.android.location/files/cache.cell
busybox chmod 000 /data/data/com.google.android.location/files/cache.wifi

# Remount each file system with noatime and nodiratime flags to save battery and CPU cycles
# and change journaling mode for data and cache
#
busybox mount -o remount,noatime,nodiratime,remount,rw,barrier=0,data=writeback /data;
busybox mount -o remount,noatime,nodiratime,remount,rw,barrier=0,data=writeback /cache;
busybox mount -o remount,noatime,nodiratime /dev;
busybox mount -o remount,noatime,nodiratime /proc;
busybox mount -o remount,noatime,nodiratime /sys;
busybox mount -o remount,noatime,nodiratime /system;

# Flag
# --------------
#
#
#.
#

MMC=`ls -d /sys/block/mmc*`;
for q in $MMC
do
#	echo "deadline" > $q/queue/scheduler;
#	echo "512" > $q/queue/read_ahead_kb;
echo "0" > $q/queue/rotational;
echo "1" > $q/queue/iosched/fifo_batch;
echo "1" > $q/queue/iosched/low_latency;
echo "1" > $q/queue/iosched/back_seek_penalty;
echo "1000000000" > $q/queue/iosched/back_seek_max;
echo "3" > $q/queue/iosched/slice_idle;
echo "16" > $q/queue/iosched/quantum
echo "512" > $q/queue/nr_requests;
done

echo "3072" > /sys/devices/virtual/bdi/179:0/read_ahead_kb; # Set sd card read ahead cache size
echo "2048" > /sys/devices/virtual/bdi/default/read_ahead_kb;

#
# END SECTION--------------

# /proc/sys/net/ipv4
sysctl -w net.ipv4.tcp_timestamps=0;
sysctl -w net.ipv4.tcp_tw_reuse=1;
sysctl -w net.ipv4.tcp_tw_recycle=1;
sysctl -w net.ipv4.tcp_sack=1;
sysctl -w net.ipv4.tcp_window_scaling=1;
sysctl -w net.ipv4.tcp_keepalive_probes=5; # Retries before connection is considered dead
sysctl -w net.ipv4.tcp_keepalive_intvl=156; #
sysctl -w net.ipv4.tcp_fin_timeout=30;
sysctl -w net.ipv4.tcp_rmem='6144	87380 524288'; # 65536	131072 524288
sysctl -w net.ipv4.tcp_wmem='6144	131072 524288'; # 65536	131072 524288
sysctl -w net.ipv4.tcp_ecn=0; # Explict Congestion Notification
sysctl -w net.ipv4.tcp_max_tw_buckets=360000; #
sysctl -w net.ipv4.tcp_synack_retries=2; #Default: 5

# Ignore all icmp packets or pings
sysctl -w net.ipv4.icmp_echo_ignore_all=1;
sysctl -w net.ipv6.icmp_echo_ignore_all=1;

# Net Core Settings
# Location: /proc/sys/net/core
sysctl -w net.core.wmem_max=524288; #404480
sysctl -w net.core.rmem_max=524288; #404480
sysctl -w net.core.rmem_default=110592;
sysctl -w net.core.wmem_default=110592;

#
sysctl -w net.ipv4.route.flush=1;

# EMP Kernel Tweaks
#
sysctl -w kernel.sched_features=15834233;
#sysctl -w kernel.msgmni=2048;
#sysctl -w kernel.msgmax=64000;
#sysctl -w kernel.shmmax=268435500;
#sysctl -w kernel.sem=500,512000,64,2048;
#sysctl -w kernel.hung_task_timeout_secs=0;
#sysctl -w kernel.sched_latency_ns=5000000; #600000
#sysctl -w kernel.sched_compat_yield=1;
#sysctl -w kernel.sched_shares_ratelimit=256000;
#sysctl -w kernel.sched_child_runs_first=0;
#sysctl -w kernel.threads-max=10000;

You are setting SD Card cache to 512, then 3072, and then again to 2048? What is point of this?

Anything bigger than 1024 for <512MB RAM phones will make them lag... Yes it will give higher bench results but will LAG in real life because if you started reading something, system can't interrupt reading for write until 2MB are read...

The best value I found for ArcS is 768kB...It has same bench results as 1024kB but less lag in real life....

And you are disabling write to cache files someone might need...

So script should be modified like this:

#!/system/bin/sh
#
#
#
rm -r /data/local/tmp/*
rm -r /data/tmp/*
rm -r /data/system/usagestats/*
rm -r /data/system/appusagestats/*
rm -r /data/system/dropbox/*
rm -r /data/tombstones/*
rm -r /data/anr/*
#busybox chmod 000 /data/system/userbehavior.db
#busybox chmod 000 /data/system/usagestats/
#busybox chmod 000 /data/system/dropbox/
#busybox chmod 000 /data/anr/
#busybox chmod 000 /data/tombstones/
#busybox chmod 000 /data/system/appusagestats/
#busybox chmod 000 /data/data/com.google.android.location/files/cache.cell
#busybox chmod 000 /data/data/com.google.android.location/files/cache.wifi

# Remount each file system with noatime and nodiratime flags to save battery and CPU cycles
# and change journaling mode for data and cache
#
busybox mount -o remount,noatime,nodiratime,remount,rw,barrier=0,data=writeback /data;
busybox mount -o remount,noatime,nodiratime,remount,rw,barrier=0,data=writeback /cache;
busybox mount -o remount,noatime,nodiratime /dev;
busybox mount -o remount,noatime,nodiratime /proc;
busybox mount -o remount,noatime,nodiratime /sys;
busybox mount -o remount,noatime,nodiratime /system;

# Flag
# --------------
#
#
#.
#

MMC=`ls -d /sys/block/mmc*`;
for q in $MMC
do
#	echo "deadline" > $q/queue/scheduler;
#	echo "768" > $q/queue/read_ahead_kb;
echo "0" > $q/queue/rotational;
echo "1" > $q/queue/iosched/fifo_batch;
echo "1" > $q/queue/iosched/low_latency;
echo "1" > $q/queue/iosched/back_seek_penalty;
echo "1000000000" > $q/queue/iosched/back_seek_max;
echo "3" > $q/queue/iosched/slice_idle;
echo "16" > $q/queue/iosched/quantum
echo "512" > $q/queue/nr_requests;
done

echo "768" > /sys/devices/virtual/bdi/179:0/read_ahead_kb; # Set sd card read ahead cache size

#
# END SECTION--------------

# /proc/sys/net/ipv4
sysctl -w net.ipv4.tcp_timestamps=0;
sysctl -w net.ipv4.tcp_tw_reuse=1;
sysctl -w net.ipv4.tcp_tw_recycle=1;
sysctl -w net.ipv4.tcp_sack=1;
sysctl -w net.ipv4.tcp_window_scaling=1;
sysctl -w net.ipv4.tcp_keepalive_probes=5; # Retries before connection is considered dead
sysctl -w net.ipv4.tcp_keepalive_intvl=156; #
sysctl -w net.ipv4.tcp_fin_timeout=30;
sysctl -w net.ipv4.tcp_rmem='6144	87380 524288'; # 65536	131072 524288
sysctl -w net.ipv4.tcp_wmem='6144	131072 524288'; # 65536	131072 524288
sysctl -w net.ipv4.tcp_ecn=0; # Explict Congestion Notification
sysctl -w net.ipv4.tcp_max_tw_buckets=360000; #
sysctl -w net.ipv4.tcp_synack_retries=2; #Default: 5

# Ignore all icmp packets or pings
sysctl -w net.ipv4.icmp_echo_ignore_all=1;
sysctl -w net.ipv6.icmp_echo_ignore_all=1;

# Net Core Settings
# Location: /proc/sys/net/core
sysctl -w net.core.wmem_max=524288; #404480
sysctl -w net.core.rmem_max=524288; #404480
sysctl -w net.core.rmem_default=110592;
sysctl -w net.core.wmem_default=110592;

#
sysctl -w net.ipv4.route.flush=1;

# EMP Kernel Tweaks
#
sysctl -w kernel.sched_features=15834233;
#sysctl -w kernel.msgmni=2048;
#sysctl -w kernel.msgmax=64000;
#sysctl -w kernel.shmmax=268435500;
#sysctl -w kernel.sem=500,512000,64,2048;
#sysctl -w kernel.hung_task_timeout_secs=0;
#sysctl -w kernel.sched_latency_ns=5000000; #600000
#sysctl -w kernel.sched_compat_yield=1;
#sysctl -w kernel.sched_shares_ratelimit=256000;
#sysctl -w kernel.sched_child_runs_first=0;
#sysctl -w kernel.threads-max=10000;