[Script]Sick Speed Tweaks - Android Software/Hacking General [Developers Only]

This gives a really nice boost to performance. I use it in my rom and thought i would share.
Just put them in init.d
02sicktweaks:
Code:
#!/system/bin/sh
#Sick Tweaks
rm -f /cache/*.apk
rm -f /cache/*.tmp
rm -f /data/dalvik-cache/*.apk
rm -f /data/dalvik-cache/*.tmp
busybox rm -f /data/system/userbehavior.db
busybox chmod 400 /data/system/usagestats/
busybox chmod 400 /data/system/appusagestats/
busybox mount -o remount,rw,noatime,noauto_da_alloc,nodiratime,barrier=0,nobh /system
busybox mount -o remount,noatime,noauto_da_alloc,nodiratime,nodev,barrier=0,nobh /data
busybox mount -o remount,noatime,noauto_da_alloc,nodiratime,nodev,barrier=0,nobh /cache
export sampling_rate=10000
export up_threshold=65
export READ_AHEAD_KB=3072
if [ -n ${up_threshold} ];
then echo ${up_threshold} > /sys/devices/system/cpu/cpu0/cpufreq/ondemand/up_threshold
fi
if [ -n ${sampling_rate} ];
then echo ${sampling_rate} > /sys/devices/system/cpu/cpu0/cpufreq/ondemand/sampling_rate
fi
if [ -e /sys/module/lowmemorykiller/parameters/adj ]; then
echo "0,1,2,4,7,15" > /sys/module/lowmemorykiller/parameters/adj
fi
if [ -e /sys/module/lowmemorykiller/parameters/minfree ]; then
echo "2560,4096,6144,12288,14336,18432" > /sys/module/lowmemorykiller/parameters/minfree
fi
if [ -e /sys/devices/virtual/bdi/179:0/read_ahead_kb ]; then
echo "3072" > /sys/devices/virtual/bdi/179:0/read_ahead_kb
fi
# Set io scheduler tweaks for mmc
echo "deadline" > /sys/block/mmcblk0/queue/scheduler
echo "0" > /sys/block/mmcblk0/queue/rotational
echo "2048" > /sys/block/mmcblk0/queue/nr_requests
echo ${READ_AHEAD_KB} > /sys/block/mmcblk0/queue/read_ahead_kb
echo "deadline" > /sys/block/mmcblk1/queue/scheduler
echo "0" > /sys/block/mmcblk1/queue/rotational
echo "2048" > /sys/block/mmcblk1/queue/nr_requests
echo ${READ_AHEAD_KB} > /sys/block/mmcblk1/queue/read_ahead_kb
for i in \ `find /data -iname "*.db"` do \ sqlite3
$i 'VACUUM;'
done
echo "6144 87380 524288" > /proc/sys/net/ipv4/tcp_wmem
echo "6144 87380 524288" > /proc/sys/net/ipv4/tcp_rmem
setprop ro.telephony.call_ring.delay 0
setprop ring.delay 0
#setprop windowsmgr.max_events_per_sec 100
setprop windowsmgr.support_rotation_270 true
setprop ro.HOME_APP_ADJ 1
setprop ro.HOME_APP_MEM 2048
setprop dalvik.vm.heapsize 72m
06sysctl:
Code:
#!/system/bin/sh
#sysctl stuff
sync
sysctl -w vm.oom_kill_allocating_task=0
sysctl -w fs.nr_open=1053696
sysctl -w fs.inotify.max_queued_events=32000
sysctl -w fs.inotify.max_user_instances=256
sysctl -w fs.inotify.max_user_watches=10240
sysctl -w fs.lease-break-time=10
sysctl -w fs.file-max=165164
sysctl -w vm.swappiness=0
sysctl -w vm.overcommit_memory=1
sysctl -w vm.page-cluster=3
sysctl -w vm.drop_caches=3
sysctl -w vm.min_free_kbytes=4096
sysctl -w vm.dirty_ratio=15
sysctl -w vm.dirty_background_ratio=4
sysctl -w vm.vfs_cache_pressure=10
sysctl -w vm.panic_on_oom=0
sysctl -w vm.dirty_expire_centisecs=200
sysctl -w vm.dirty_writeback_centisecs=500
sysctl -w kernel.sem=500,512000,64,2048
sysctl -w kernel.msgmax=64000
sysctl -w kernel.msgmni=64000
sysctl -w kernel.threads-max=525810
sysctl -w kernel.random.write_wakeup_threshold=256
sysctl -w kernel.random.read_wakeup_threshold=128
sysctl -w kernel.panic=5
sysctl -w kernel.shmall=16777216
sysctl -w kernel.shmmax=268435456
sysctl -w kernel.sched_latency_ns=10000000
sysctl -w kernel.sched_min_granularity_ns=2000000
sysctl -w kernel.sched_wakeup_granularity_ns=0
sysctl -w kernel.sched_compat_yield=1
sysctl -w net.ipv6.conf.default.use_tempaddr=2
sysctl -w net.ipv6.conf.all.use_tempaddr=2
sysctl -w net.ipv6.conf.all.temp_prefered_lft=3600
sysctl -w net.ipv6.conf.default.temp_prefered_lft=3600
setprop cm.filesystem.ready 1
setprop dc.filesystem.ready 1
setprop oxygen.filesystem.ready 1

does this work on all phones?

nice! very good! thanks!
edit: this is working on my htc evo 4g running cm7 nightly 215 w/ savagedzen kernel
edit 2: i made a cwm/RA flashable zip for the sick tweaks. download at www.unvisible.org/sicktweaksflashable.zip

Is it working on galaxy sl i9003?
Sent from my GT-I9003 using xda premium

sysctl -w kernel.sched_latency_ns=10000000
sysctl -w kernel.sched_min_granularity_ns=2000000
for performance, this values must be this big ?

vladnosferatu said:
sysctl -w kernel.sched_latency_ns=10000000
sysctl -w kernel.sched_min_granularity_ns=2000000
for performance, this values must be this big ?
Click to expand...
Click to collapse
nanoseconds

So what phones/roms does this work on....
Sent from my SCH-I500 using XDA Premium App

this turned off every thing disabled my root and killed superuser do not use its something strange about it

seems fine on my Arc running cm7.
Sent from my LT15i using XDA App

Applied on my Xperia Arc .. It works great! Thanks

going to try this mod, going to flash it with cwm. any way to delete the mod if i wanted to?

kistigun said:
going to try this mod, going to flash it with cwm. any way to delete the mod if i wanted to?
Click to expand...
Click to collapse
Delete the two files that are in
system/etc/init.d foler
Look in the zip for the file names.

ShyamSasi said:
Applied on my Xperia Arc .. It works great! Thanks
Click to expand...
Click to collapse
does the stock .42 arc rom support init.d access?

lastword112 said:
does the stock .42 arc rom support init.d access?
Click to expand...
Click to collapse
No...!!! You need a custom kernel...!!!
flash DoomLord's Kernel v13...!!!

just applied these tweaks to my htc heroc, can't really tell the difference yet. Would it be bad too have juwe's ram optimization tweak along with yours?

Do I just flash this in CWM?
SuperCharged GingerVolt B-) R U?

bhp117 said:
Do I just flash this in CWM?
SuperCharged GingerVolt B-) R U?
Click to expand...
Click to collapse
Yes, you can

Thanx
Would it work with v6 supercharger and KAK scripts?
SuperCharged GingerVolt B-) R U?

Will this work on the DInc2 with the tiamat oc kernel?

Thanks for the script.
My Xperia Arc S got a real nice boost.

Related

[TWEAK] Kernel tuning script -- UPDATED!

Hi all,
since I've said goodbye to my Milestone, in these days, prior to selling it, my good behavior said to me "okay, no customkernel, you can't help with RSA...so Milestone owners are ****ed...ouh, no, wait!"
...and then prior to selling it I've tested some things and I've found that sysctl is working!
Since sysctl is working and I'm on Linux from about 10 years, I've been played with our kernel in Milestone and tested some parameters.. and I've had a speedup in my daily operations: browse the net with Dolphin Browser HD, play some games, sync email, make calls, sms etc... and I've found that my Milestone is way more responsive and feels smoother!
Sysctls tested on the great CyanogenMod port by nadlabak.
So, well, here's the script. Feel free to execute it at boot (if you execute it at boot, your phone will boot slightly faster) and/or to integrate in your custom nandroid ROMs
Code:
#!/system/bin/sh
sysctl -p
#
#Disable normalized sleeper
#
mount -t debugfs none /sys/kernel/debug
echo NO_NORMALIZED_SLEEPER > /sys/kernel/debug/sched_features
#
# Memory management
#
echo 2048 > /proc/sys/kernel/msgmni
echo 64000 > /proc/sys/kernel/msgmax
echo 268435456 > /proc/sys/kernel/shmmax
echo "500 512000 64 2048" > /proc/sys/kernel/sem
sysctl -w net.core.wmem_max=524288
sysctl -w net.core.rmem_max=524288
sysctl -w net.ipv4.tcp_tw_recycle=1
sysctl -w net.ipv4.tcp_rmem='6144 87380 524288'
sysctl -w net.ipv4.tcp_wmem='6144 87380 524288'
sysctl -w kernel.sched_latency_ns=600000
sysctl -w kernel.sched_min_granularity_ns=400000
sysctl -w kernel.sched_wakeup_granularity_ns=400000
EDIT: UPDATE N.3
This script makes the Linux kernel to take a little more RAM, so I don't recommend to use it in HTC Sense builds, since Sense is already crashing because of heavy RAM usage, but with CM and LauncherPro, with a lot of progs open in background I've never went out of RAM!
NOTE: Make sure that you've got echo and sysctl in /system/xbin/ otherwise this won't have any effect!
Even if I'm returning to HTC I'm sad for my old Milestone, I like its shell so much...it's a really beautiful device!
Hoping for the best for u, Milestone users
-kholk
Very interesting. Could you please advice what I need to do to execute the script at boot?
kholk said:
I've found that sysctl is working!
Code:
#!/system/bin/sh
/system/xbin/echo 2048 > /proc/sys/kernel/msgmni
/system/xbin/echo 64000 > /proc/sys/kernel/msgmax
/system/xbin/echo 268435456 > /proc/sys/kernel/shmmax
/system/xbin/echo 500 512000 64 2048 > /proc/sys/kernel/sem
/system/xbin/sysctl -w net.core.wmem_max=524288
/system/xbin/sysctl -w net.core.rmem_max=524288
/system/xbin/sysctl -w net.ipv4.tcp_tw_recycle=1
/system/xbin/sysctl -w net.ipv4.tcp_rmem='6144 87380 524288'
/system/xbin/sysctl -w net.ipv4.tcp_wmem='6144 87380 524288'
Hoping for the best for u, Milestone users
-kholk
Click to expand...
Click to collapse
ciao kholk
Want to know if you put a sysctl binary in xbin?
Cause your script suppose to have sysctl in xbin right?
Can you make a download of it? Or is a symlink from busybox?
Grazie per questa drittona per il pietrone
EDIT: okok resolved, had to --install busybox -s xD
NO PROBLEM now testing!!
This script is supposing that you've got echo and sysctl in /system/xbin/
If you haven't got echo and sysctl in /system/xbin/ this script won't have any effect.
And how would i go about obtaining those?
Sent from my Milestone using XDA App
Install busybox and with it you should have installed those.
I didn't think sysctl would work on this kernel. Since it does, here's some more optimizations that I know work for Eclair and earlier:
Code:
/system/xbin/sysctl -w kernel.sched_latency_ns=600000
/system/xbin/sysctl -w kernel.sched_min_granularity_ns=400000
/system/xbin/sysctl -w kernel.sched_features=24188
The default latencies were a little ridiculous. And the CFS features disabled here are pointless, even on desktops.
That said, thanks for pointing out that it works! Much appreciated. Best of luck with your HTC device.
Very nice, thanks kholk!
Thanks xslntx!
Script updated.
-- Absolute path not needed.
-- Added scheduler tuning for granularity latencies
-- Normalized sleeper disabled.
Testing it with great results (in combination with xlsntx parameters)
graphic performance are improved, usage is clearly improved,
in opposition to that bench are lower, I mean, I donot understan:
In Quadrant, I have nearly 3\4 fps MORE than normal in EACH test (except for the planet one) -wich is nealrly the performance a droid2 has...- and have a result like 20\25 point lower...dunno...another dimostration that benchs aren't much reliable...
Sounds great!
So, I have Busybox installed. How do I actually activate the script file?
Just placing a file, for example "optimize" in system/xbin with the script content and thats it? Or do I have to do anything else to actually load the optimization from boot?
@89luca89
Can you add this modification in next update to your OpenRecovery with andrea???
As you have more knowledge, plsease make your test and put the best combination in next update to your OpenRecovery...
Just a question - can I use these commands also with the stock(rooted) ROM? I don't have CM6 and actually I'm pretty satisfied with the my stone. But I would like to have the performance a little bit more improved
Is this only for CM6 or what?
TheSSJ said:
Just a question - can I use these commands also with the stock(rooted) ROM? I don't have CM6 and actually I'm pretty satisfied with the my stone. But I would like to have the performance a little bit more improved
Is this only for CM6 or what?
Click to expand...
Click to collapse
here is the answer from the previous page of thios thread:
xslntx said:
I didn't think sysctl would work on this kernel. Since it does, here's some more optimizations that I know work for Eclair and earlier:
Code:
/system/xbin/sysctl -w kernel.sched_latency_ns=600000
/system/xbin/sysctl -w kernel.sched_min_granularity_ns=400000
/system/xbin/sysctl -w kernel.sched_features=24188
The default latencies were a little ridiculous. And the CFS features disabled here are pointless, even on desktops.
That said, thanks for pointing out that it works! Much appreciated. Best of luck with your HTC device.
Click to expand...
Click to collapse
thanks for the nice script
fantastic job - works great on my CM6 MS.
Can somebody upload the neccesary files for make it work...
And some instractions please....
I suppose all have the "echo" file in system/xbin. So as i understand we need the "sysctl" file to put it in system/xbin and the propiate script...
So if everyone could upload these 2 it would be nice...
Thanks
Edit: Sorry "sysctl" file already excists in my /system/xbin....
So i have to create a script file without the .sh extention and put in in system/etc/init.d right?
Yeah, I'd like to know as well where to put the file... and with extension or without. I got the files needed in the mentioned folders.
I'd like to point out that the tweaks that have to deal with the network connection seem rather pointless for mobile devices. We simply don't have the bandwidth to necessitate giving such functions any more of our (limited) memory. It also appears to cause a sluggish startup.
Removing
Code:
sysctl -w net.core.wmem_max=524288
sysctl -w net.core.rmem_max=524288
sysctl -w net.ipv4.tcp_tw_recycle=1
sysctl -w net.ipv4.tcp_rmem='6144 87380 524288'
sysctl -w net.ipv4.tcp_wmem='6144 87380 524288'
actually yields noticeably snappier performance.
Tutorial please

[TWEAKS][SCRIPTS] Collection of 'em all - build.prop; init.d; etc.

On my ROMs adventure I've been collecting some tweaks and scripts and seems to me it's now time to share it. While some values in terms of optimization might fluctuate from device to device, I've found these pretty consistent throughout many.
Build.prop
(edit your /system/build.prop with a file manager with root access)
Careful for already existing settings. In this case, just change the values.
1. Force launcher into memory
Code:
ro.HOME_APP_ADJ=1
2. Raise JPG quality to 100%
Code:
ro.media.enc.jpeg.quality=100
3. VM Heapsize; higher the RAM, higher the hp can be
Code:
dalvik.vm.heapsize=48m
4. Render UI with GPU
Code:
debug.sf.hw=1
5. Decrease dialing out delay
Code:
ro.telephony.call_ring.delay=0
6. Helps scrolling responsiveness
Code:
windowsmgr.max_events_per_sec=150
7. Save battery
Code:
wifi.supplicant_scan_interval=180
pm.sleep_mode=1
ro.ril.disable.power.collapse=0
8. Disable debugging notify icon on statusbar
Code:
persist.adb.notify=0
9. Increase overall touch responsiveness
Code:
debug.performance.tuning=1
video.accelerate.hw=1
10. Raise photo and video recording quality
Code:
ro.media.dec.jpeg.memcap=8000000
ro.media.enc.hprof.vid.bps=8000000
11. Signal (3G) tweaks
Code:
ro.ril.hsxpa=2
ro.ril.gprsclass=10
ro.ril.hep=1
ro.ril.enable.dtm=1
ro.ril.hsdpa.category=10
ro.ril.enable.a53=1
ro.ril.enable.3g.prefix=1
ro.ril.htcmaskw1.bitmask=4294967295
ro.ril.htcmaskw1=14449
ro.ril.hsupa.category=5
12. Net speed tweaks
Code:
net.tcp.buffersize.default=4096,87380,256960,4096,16384,256960
net.tcp.buffersize.wifi=4096,87380,256960,4096,16384,256960
net.tcp.buffersize.umts=4096,87380,256960,4096,16384,256960
net.tcp.buffersize.gprs=4096,87380,256960,4096,16384,256960
net.tcp.buffersize.edge=4096,87380,256960,4096,16384,256960
13. Disable blackscreen issue after a call
Code:
ro.lge.proximity.delay=25
mot.proximity.delay=25
14. Fix some application issues
Code:
ro.kernel.android.checkjni=0
15. Phone will not wake up from hitting the volume rocker
Code:
ro.config.hwfeature_wakeupkey=0
16. Force button lights on when screen is on
Code:
ro.mot.buttonlight.timeout=0
17. Disable boot animation for faster boot
Code:
debug.sf.nobootanimation=1
18. Miscellaneous flags
Code:
ro.config.hw_menu_unlockscreen=false
persist.sys.use_dithering=0
persist.sys.purgeable_assets=1
dalvik.vm.dexopt-flags=m=y
ro.mot.eri.losalert.delay=1000
19. Specifics to some LG devices
Code:
persist.service.pcsync.enable=0
persist.service.lgospd.enable=0
user.feature.flex=true
user.feature.lgdrm=false
user.feature.lgresource=false
user.feature.lgpoweroff=false
user.feature.ls_event=false
user.feature.ls_normal=false
user.feature.sui=false
Init.d
(needs ROM with init.d access and busybox, open empty file, insert header #!/system/bin/sh and put these there, save in /system/etc/init.d and name it something like 77tweaks)
1. strict minfree handler tweak
Code:
echo "2048,3072,6144,15360,17920,20480" > /sys/module/lowmemorykiller/parameters/minfree
2. internet speed tweaks
Code:
echo "0" > /proc/sys/net/ipv4/tcp_timestamps;
echo "1" > /proc/sys/net/ipv4/tcp_tw_reuse;
echo "1" > /proc/sys/net/ipv4/tcp_sack;
echo "1" > /proc/sys/net/ipv4/tcp_tw_recycle;
echo "1" > /proc/sys/net/ipv4/tcp_window_scaling;
echo "5" > /proc/sys/net/ipv4/tcp_keepalive_probes;
echo "30" > /proc/sys/net/ipv4/tcp_keepalive_intvl;
echo "30" > /proc/sys/net/ipv4/tcp_fin_timeout;
echo "404480" > /proc/sys/net/core/wmem_max;
echo "404480" > /proc/sys/net/core/rmem_max;
echo "256960" > /proc/sys/net/core/rmem_default;
echo "256960" > /proc/sys/net/core/wmem_default;
echo "4096,16384,404480" > /proc/sys/net/ipv4/tcp_wmem;
echo "4096,87380,404480" > /proc/sys/net/ipv4/tcp_rmem;
3. vm management tweaks
Code:
echo "4096" > /proc/sys/vm/min_free_kbytes
echo "0" > /proc/sys/vm/oom_kill_allocating_task;
echo "0" > /proc/sys/vm/panic_on_oom;
echo "0" > /proc/sys/vm/laptop_mode;
echo "0" > /proc/sys/vm/swappiness
echo "50" > /proc/sys/vm/vfs_cache_pressure
echo "90" > /proc/sys/vm/dirty_ratio
echo "70" > /proc/sys/vm/dirty_background_ratio
4. misc kernel tweaks
Code:
echo "8" > /proc/sys/vm/page-cluster;
echo "64000" > /proc/sys/kernel/msgmni;
echo "64000" > /proc/sys/kernel/msgmax;
echo "10" > /proc/sys/fs/lease-break-time;
echo "500,512000,64,2048" > /proc/sys/kernel/sem;
5. battery tweaks
Code:
echo "500" > /proc/sys/vm/dirty_expire_centisecs
echo "1000" > /proc/sys/vm/dirty_writeback_centisecs
6. EXT4 tweaks (greatly increase I/O)
(needs /system, /cache, /data partitions formatted to EXT4)
a) removes journalism
Code:
tune2fs -o journal_data_writeback /block/path/to/system
tune2fs -O ^has_journal /block/path/to/system
tune2fs -o journal_data_writeback /block/path/to/cache
tune2fs -O ^has_journal /block/path/to/cache
tune2fs -o journal_data_writeback /block/path/to/data
tune2fs -O ^has_journal /block/path/to/data
b) perfect mount options
Code:
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
7. Flags blocks as non-rotational and increases cache size
Code:
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 "2048" > $j/queue/read_ahead_kb;
done
8. microSD card speed tweak
Code:
echo "2048" > /sys/devices/virtual/bdi/179:0/read_ahead_kb;
9. Defrags database files
Code:
for i in \
`find /data -iname "*.db"`
do \
sqlite3 $i 'VACUUM;';
done
9. Remove logger
Code:
rm /dev/log/main
10. Ondemand governor tweaks
Code:
SAMPLING_RATE=$(busybox expr `cat /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_transition_latency` \* 750 / 1000)
echo 95 > /sys/devices/system/cpu/cpufreq/ondemand/up_threshold
echo $SAMPLING_RATE > /sys/devices/system/cpu/cpu0/cpufreq/ondemand/sampling_rate
11. Auto change governor and I/O Scheduler
a) I/O Scheduler (Best: MTD devices - VR; EMMC devices - SIO) - needs kernel with these
Code:
echo "vr" > /sys/block/mmcblk0/queue/scheduler
or
echo "sio" > /sys/block/mmcblk0/queue/scheduler
b) Governor (Best: Minmax > SavagedZen > Smoothass > Smartass > Interactive) - needs kernel with these
Code:
echo "governor-name-here" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
12. Auto-zipalign on boot
(needs zipalign bin)
Code:
[url]http://forum.xda-developers.com/showthread.php?t=860586[/url]
13. Loopy Smoothness tweak
Code:
[url]http://forum.xda-developers.com/showthread.php?t=1137554[/url]
[url]http://forum.xda-developers.com/showthread.php?t=1205744[/url]
14. Move dalvik-cache to cache partition (if it's big enough) to free up data partition space
Code:
CACHESIZE=$(df -k /cache | tail -n1 | tr -s ' ' | cut -d ' ' -f2)
if [ $CACHESIZE -gt 80000 ]
then
echo "Large cache detected, moving dalvik-cache to /cache"
if [ ! -d /cache/dalvik-cache ]
then
busybox rm -rf /cache/dalvik-cache /data/dalvik-cache
mkdir /cache/dalvik-cache /data/dalvik-cache
fi
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
else
echo "Small cache detected, dalvik-cache will remain on /data"
fi
15. Disable normalize sleeper
Code:
mount -t debugfs none /sys/kernel/debug
echo NO_NORMALIZED_SLEEPER > /sys/kernel/debug/sched_features
16. OOM groupings and priorities tweaks - SuperCharger
Code:
[url]http://forum.xda-developers.com/showthread.php?t=991276[/url]
GPS.conf
(create or edit your /system/etc/gps.conf with a file manager with root access)
For improving GPS lock time and signal.
a) European NTP server (replace for america or asia in your case)
Code:
NTP_SERVER=europe.pool.ntp.org
XTRA_SERVER_1=http://xtra1.gpsonextra.net/xtra.bin
XTRA_SERVER_2=http://xtra2.gpsonextra.net/xtra.bin
XTRA_SERVER_3=http://xtra3.gpsonextra.net/xtra.bin
b) SE supl for A-GPS (better than Nokia's or Google's)
Code:
SUPL_HOST=supl.sonyericsson.com
SUPL_PORT=7275
Other tweaks or guidelines
1. Patch your hosts file for blocking Ads
(please think before doing this; many developers are supported through this way)
Code:
You can use AdFree application for this or changing manually your hosts file.
Here are some databases:
http://www.mvps.org/winhelp2002/hosts.txt
http://pgl.yoyo.org/adservers/serverlist.php?showintro=0;hostformat=hosts
2. Use CyanogenMOD's APN list file - it's one of the most complete.
Code:
It's located in /system/etc/apns-conf.xml
3. Use UOT kitchen for basic theming on your device.
Code:
http://uot.dakra.lt/
4. Use Google's dns servers
Code:
Create an empty file, name it resolv.conf and put there these 2 lines:
nameserver 8.8.8.8
nameserver 8.8.4.4
Save to /system/etc/.
5. Update Superuser and su binary to latest version (3.0 beta)
Code:
http://goo-inside.me/superuser/
6. Disable sync feature in sqlite
(author: ownhere - needs a source for your device so you can compile the /system/lib/libsqlite.so)
Code:
Patch file here: http://forum.xda-developers.com/showthread.php?t=903507
7. Do not use task killers.
Alright, I think this is it for now.
If you have any other tweaks or better values, you can PM me and I'll include them.
Wow... Neojn, will tis work on lg optimus one? I know u used to have a optimus one...
Sent from LGE Secret phone using tapatalk app...
Most of them will, yeah.
Noejn said:
Most of them will, yeah.
Click to expand...
Click to collapse
Will try, thanks...
Sent from LGE Secret phone using tapatalk app...
my word thats a MASSIVE list lol thanks, some interesting tweaks there
Sent from my HTC Desire using XDA App
If I have time in the future I can create a script that applies them all.
(with a check of already existing tweaks / compatibility with the device, etc)
If some script fail it may cause bootloop? And can use for all device?
thanks for answer.
Deaw^^ said:
If some script fail it may cause bootloop? And can use for all device?
thanks for answer.
Click to expand...
Click to collapse
None of them should cause bootloop, at least if you follow everything I wrote.
Yes, they work on most devices. Just read what it needs.
how do i test this one because i cant remember what i rename the bold parts to lol
tune2fs -o journal_data_writeback /block/path/to/system
tune2fs -O ^has_journal /block/path/to/system
tune2fs -o journal_data_writeback /block/path/to/cache
tune2fs -O ^has_journal /block/path/to/cache
tune2fs -o journal_data_writeback /block/path/to/data
tune2fs -O ^has_journal /block/path/to/data
thanks in advanced
Eoghan
I hav another question..What is "Flags"?
- 18. Miscellaneous flags
- 7. Flags blocks as non-rotational and increases cache size
thanks for answer
eoghan2t7 said:
how do i test this one because i cant remember what i rename the bold parts to lol
tune2fs -o journal_data_writeback /block/path/to/system
tune2fs -O ^has_journal /block/path/to/system
tune2fs -o journal_data_writeback /block/path/to/cache
tune2fs -O ^has_journal /block/path/to/cache
tune2fs -o journal_data_writeback /block/path/to/data
tune2fs -O ^has_journal /block/path/to/data
thanks in advanced
Eoghan
Click to expand...
Click to collapse
It's like it says, you need the /dev/block/ path to system, data and cache partitions.
And they need to be formatted to ext4 of course.
This varies from device to device, whether it is emmc or mtd.
Running the command "mount" should give you the answer for both.
Deaw^^ said:
I hav another question..What is "Flags"?
- 18. Miscellaneous flags
- 7. Flags blocks as non-rotational and increases cache size
thanks for answer
Click to expand...
Click to collapse
As a noun it's like a property, as a verb is like defining.
Either way, I think I may have some time during next week to make a script to deploy these tweaks on most ROMs.
thanks ya knzo.
thanks . If you have time it would be awesome if you make a zip that can be flashed to CWM
I need a little help creating the script files. I dont need all of these tweaks. So, I need instructions on how to create the file with only what I need.
Can I create just one script file for all the tweaks or do they have to be seperate?
Sent from my Nexus One using Tapatalk
dgart08 said:
I need a little help creating the script files. I dont need all of these tweaks. So, I need instructions on how to create the file with only what I need.
Can I create just one script file for all the tweaks or do they have to be seperate?
Sent from my Nexus One using Tapatalk
Click to expand...
Click to collapse
Pm the tweaks you want and i can make the script for you
Sent from my GT540 using XDA Premium App
eoghan2t7 said:
Pm the tweaks you want and i can make the script for you
Sent from my GT540 using XDA Premium App
Click to expand...
Click to collapse
Thanks! I will PM you shortly...
Question... will these tweaks interfere w/ Juwe's Ram Script? Can they replace it?
dgart08 said:
Thanks! I will PM you shortly...
Question... will these tweaks interfere w/ Juwe's Ram Script? Can they replace it?
Click to expand...
Click to collapse
I will make it so it doesnt interfere with them
Sent from my GT540 using XDA Premium App
eoghan2t7 said:
I will make it so it doesnt interfere with them
Sent from my GT540 using XDA Premium App
Click to expand...
Click to collapse
...and maybe neither with supercharger/kickasskernel/3gturbocharger?
eoghan2t7 said:
I will make it so it doesnt interfere with them
Sent from my GT540 using XDA Premium App
Click to expand...
Click to collapse
PM sent. Thanks!
post removed

zRam on Gingerbread

Ok so the reason why I made this topic is because Coertmans asked me about virtual ram in android (2.3.6), which is available in CM9, so I went surfing on the interwebs to find about this zRam, first thing I found was this:
Site: http://code.google.com/p/compcache/ (ramzswap_32a.ko/ramzswap_32b.ko)
Instructions: http://code.google.com/p/compcache/wiki/CompilingAndUsingNew
This is the link to the zRam modules for linux kernels, as I'm not sure if it's able to import it into GB I continued searching and found a GB ROM (CM7) which has zRam. I downloaded the rom and searched for the files that possible could be the zRam. All ram/swap related items I got are these:
in /system/etc/init.d/07script
Code:
ZRAM=`ls -d /sys/block/zram*`;
for z in $ZRAM
do
echo 256 > $z/queue/read_ahead_kb;
echo 0 > $z/queue/iostats
done
if [ -e /sys/kernel/mm/ksm/run ]; then
echo "Kernel Samepage Merging support ON for RAM managment speedup."
echo 1 > /sys/kernel/mm/ksm/run
fi
ZRAM=`ls -d /sys/block/zram*`;
for z in $ZRAM
do
echo 256 > $z/queue/read_ahead_kb;
echo 0 > $z/queue/iostats
done
in /sdcard/gscript/swapon.sh
Code:
echo "Enabling SWAP Now! Please Wait."
echo "OFFLINE"
free | grep Swap
swapon -a
echo "ONLINE"
free | grep Swap
sleep 2
echo "DONE, Have a Nice Day!"
in /sdcard/gscript/swapoff.sh
Code:
echo "Disabling SWAP Now! Please Wait."
echo "ONLINE"
free | grep Swap
swapoff -a
echo "OFFLINE"
free | grep Swap
sleep 2
echo "DONE, Dont forget to turn it back ON"
in /sdcard/gscript/system-to-ram-off.sh
Code:
#!/system/bin/sh
#System unmount from ram by Dorimanx!
umount -l /system/app/ 2> /dev/null
umount -l /system/framework 2> /dev/null
echo "DONE. system is removed from RAM, do your changes now."
In /sdcard/gscript/ram-clean.sh
Code:
#!/system/bin/bash
#Created by Dorimanx for cron ram managment
CPULOAD=$(cat /proc/loadavg | cut -d " " -f1)
sleep 1
while [[ ! $CPULOAD < 2.00 ]]
do
echo "Waiting For CPU to cool down"
sleep 30
CPULOAD=$(cat /proc/loadavg | cut -d " " -f1)
sleep 1
done
#Boosting CPU
CHECKMAXFREQ=`cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq`
CHECKMINFREQ=`cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq`
echo 998400 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
echo 998400 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq
sync
ZRAMUSE=`cat /proc/swaps | grep -v /dev/block/mmcblk0p3 | grep -v /sd-ext/swap | grep -v /sdcard/mnt/swap | grep -v /sdcard/swap | grep -v Used | cut -s -f3`
if [[ $ZRAMUSE < 10000 ]]
then
echo "no need to clean zram"
else
if [ -e /dev/block/mmcblk0p3 ]
then
sysctl -w vm.drop_caches=3
swapoff /dev/block/zram0
sleep 2
swapon /dev/block/zram0
sleep 2
swapoff /dev/block/mmcblk0p3
sleep 2
swapon /dev/block/mmcblk0p3
elif [ -e /sdcard/swap ]
then
sysctl -w vm.drop_caches=3
swapoff /dev/block/zram0
sleep 2
swapon /dev/block/zram0
sleep 2
swapoff /sdcard/swap
sleep 2
swapon /sdcard/swap
elif [ -e /sd-ext/swap ]
then
sysctl -w vm.drop_caches=3
swapoff /dev/block/zram0
sleep 2
swapon /dev/block/zram0
sleep 2
swapoff /sd-ext/swap
sleep 2
swapon /sd-ext/swap
fi
fi
#In case no secondary SWAP detected and ZRAM use lower than 80MB then we can safely clean it.
ZRAMUSE=`cat /proc/swaps | grep -v /dev/block/mmcblk0p3 | grep -v /sd-ext/swap | grep -v /sdcard/mnt/swap | grep -v /sdcard/swap | grep -v Used | cut -s -f3`
if [[ $ZRAMUSE < 80000 ]]
then
swapoff /dev/block/zram0
sleep 2
swapon /dev/block/zram0
fi
sync
sysctl -w vm.drop_caches=3
date > /data/cron-clear-swap
echo "runing clear swap every 4:20AM" >> /data/cron-clear-swap
echo "ram and swap cleared"
#Restoring CPU
echo $CHECKMAXFREQ > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
echo $CHECKMINFREQ > /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq
developer comment on the files in gscripts
dorimanx said:
About SWAP!
ROM will activate 3 kind of swap
It's will turn ON (only if you have already created swap file on partition, or set partition for swap (the hard way) )
SD-EXT SWAP
SD-SWAP
EXT dedicated SWAP partition
***If you have SWAP already, or EXT or SD-SWAP/EXT-SWAP, no need to run the swap activation scripts.
***I have created 2 scripts for disabling SD swap before use of USB storage.
I have put them in your /sdcard/gscript
so you only need the app (gscript light or full)
then load this scripts, when you need usb storage run swapoff script. when done run swapon.
or you can install dual mount app. i can’t live without it so try it.
Click to expand...
Click to collapse
and
dorimanx said:
SD SWAP THE EASY WAY!
In Easy way Swap you don't need to reformat or even reboot your phone to create swap!
If you installed my ROM and you don't have swap but you want to stay on HIGH END ROM,
Then you can do this to enable SD swap
Download script sdswap200.sh or dataswap250.sh from my mirror.
Run in in GSCRIPT App or copy it to SDCARD root,
Click to expand...
Click to collapse
sdswap200.sh
Code:
#!/system/bin/sh
# Created by Dorimanx
echo "WORKING PLEASE WAIT A MINUTE"
echo "Remounting System to allow WRITE"
mount -o rw,remount -t yaffs2 /dev/block/mtdblock3 /system
if [ -e /sdcard/swap ]; then
swapoff -a
rm -f /sdcard/swap
fi
if [ -d /mnt/sdcard ]; then
echo "Creating SWAP on SDCARD"
busybox dd if=/dev/zero of=/sdcard/swap bs=1k count=250000 > /dev/null
mkswap /sdcard/swap > /dev/null
echo "/sdcard/swap swap swap" >> /system/etc/fstab
echo 50 > /proc/sys/vm/swappiness
swapon -a
echo "DONE CREATING, ENJOY MORE RAM"
free
sleep 3
else
echo "Your SDCARD NOT MOUNTED, SWAP CANT BE CREATED"
fi
dataswap250.sh
Code:
#!/system/bin/sh
# Created by Dorimanx
echo "WORKING PLEASE WAIT A MINUTE"
echo "Remounting System to allow WRITE"
mount -o remount,rw /system
if [ -e /sd-ext/swap ]; then
swapoff -a
rm -f /sd-ext/swap
fi
if [ -d /sd-ext ]; then
echo "Creating SWAP on SD-EXT"
busybox dd if=/dev/zero of=/sd-ext/swap bs=1k count=250000 > /dev/null
mkswap /sd-ext/swap > /dev/null
echo "/sd-ext/swap swap swap" >> /system/etc/fstab
echo 50 > /proc/sys/vm/swappiness
swapon -a
echo "DONE CREATING, ENJOY MORE RAM"
free
sleep 3
else
echo "You do not have EXT partition!, Cant create SWAP"
fi
in /sdcard/gscripts/swaphard.sh
Code:
echo "Activating EXT SWAP Please Wait"
mount -o rw,remount -t yaffs2 /dev/block/mtdblock3 /system
mkswap /dev/block/mmcblk0p3
echo "/dev/block/mmcblk0p3 swap swap" >> /system/etc/fstab
swapon -a
echo "DONE"
free
sleep 3
So what do you guys think about it? It seems to me that this is really possible on GB
This is what I tried so far:
Code:
adb shell
su
mount -o remount rw /system
busybox dd if=/dev/zero of=/sdcard/swap bs=1k count=250000 > /dev/null
busybox mkswap /sdcard/swap > /dev/null
echo "/sdcard/swap swap swap" >> /system/etc/vold.fstab
echo 50 > /proc/sys/vm/swappiness
swapon -a
Now I don't get an error, but also nothing seems to happen, I'm going to try to make the sdcard "swappable ready" the manual way now
edit: Hmm I can only pick my internal sdcard for partitioning the sdcard, someone knows how to do that for external?
And how can I see if the virtual ram is actually working?
btw here is the mirror with the files I used: http://www.bourseanalyse.fr/dorimanx/
btw, totally of topic, but I saw 2 cars on fire so I made a video
broodplank1337 said:
And how can I see if the virtual ram is actually working?
Click to expand...
Click to collapse
The easiest and the only way i know of to check how ram, swap, and memory is used is by going into Terminal Emulator and typing in "free" and click enter... (without the quotations)
shahbaz5588 said:
The easiest and the only way i know of to check how ram, swap, and memory is used is by going into Terminal Emulator and typing in "free" and click enter... (without the quotations)
Click to expand...
Click to collapse
Ok thanks, used: "free | grep Swap" seems it's not working yet.
Hello
do you know the app swapper2 ?
it do the same what you try to do here !
But in the german forum there are some people who bricked their device with this app so i just want to say that you really have to pay attention with swapping
PortoBraso said:
Hello
do you know the app swapper2 ?
it do the same what you try to do here !
But in the german forum there are some people who bricked their device with this app so i just want to say that you really have to pay attention with swapping
Click to expand...
Click to collapse
they bricked it because of partition of internal sdcard If all of us will partition internal sdcard we have more than 50% chances to brick our device. It seems that partioning internal SD affects the 1-8 boot partitions (dunno how to explain it better) I`ve just woke up lol
Also we need a kernel that supports swap
And we don't have such a kernel
Sent from my GT-I9001 using XDA
broodplank1337 said:
Ok thanks, used: "free | grep Swap" seems it's not working yet.
Click to expand...
Click to collapse
if u are getting all 0's in swap then it is not working... i thik you can try going thru htc dream (G1) gingerbread roms.... they used swap and zramk a lot... well it was essential for the rom to run on that device
If it looks like this (with zeros in the swap line), you do not have swap/compcache:
total used free shared buffers
Mem: 97932 96640 1292 0 272
Swap: 0 0 0
Total: 97932 96640 1292
If it looks like this (with anything other than zeros in the swap line), you do have swap/compache:
total used free shared buffers
Mem: 97932 96004 1928 0 332
Swap: 24472 0 24472
Total: 122404 96004 26400
I had a swap partition on my galaxy 3 and i just wanted to say that it isnt fun...it makes the phone laggy cause you can never have a sd-card which is as fast as a ram module
Sent from my GT-I9001 using XDA
Yes! SDcards even class 10, ain't that stable. Anyhow what's the big deal ?
we never fall short of ram on our device.
Had tried ram swapping on my I9003 and i managed to screw up everything,made it a paper weight (Hard bricked it).
Had to get the board replaced from samsung, on the good side i got the latest latona board with 16gb onboard memory
but i no longer have the i9003
I tried swap while I had Galaxy 3 (it only has 256MB RAM) and I didn't like it. Also many other people reported that it was only slowing down system (even with class 10 cards) SD Cards just aren't fast enough to be used as a RAM...plus, Android is based on a though that free RAM is wasted RAM, right? 512MB for our phone is enough for me, and I've never fallen short of RAM..swap is not needed..but that's just my opinion
I'm not going to continue on this anyway, making your sdcard a swap drives really ****s it up, when I tried to install an app my phone shut down..

[GUIDE][HOW-TO] customize your xperia phone

Let's customize our ROM.
This thread's goal is to make you understand better about your ROM, how to maintain it, and how to modify it to satisfy your desire. this thread is based of this thread http://forum.xda-developers.com/showthread.php?t=1590330 which I've write several months ago. however, our system is a lil bit different with the one in SGY. this thread will contain more specific information about ICS based rom especially the xperia phones.
I'll made this thread into several section. the first section will explain about the file structure in our system. the second one will tell you about app/system modification, and the thirdth one is about tweaking.
1. KNOW BETTER ABOUT YOUR SYSTEM
1.1 SYSTEM STRUCTURE
first of all, when I said "system" here, what I mean is all the stuff under your system partition. if you're browsing with your file explorer, it's all the files inside /system folder. please don't mix it with a complete android system. if you open your /system folder, you'll find these folders.
1. app : contain all the system's app and the odex file of system app
2. bin : contain the command and bin files for the rom
3. vendor: specified vendor system. you have your specific vendor's app, libs, and config files here.
4. etc : additional setting and files for the rom.
5. font : the fonts
6. framework : system's framework files and the odex file for framework
7. lib : drivers, modules, kernel related files for the rom
8. media : media files-ringtones, notification, bootanimation.
9. sd : folder created by a2sd darktremor. (only modified rom have it)
10. usr : files needed for keyboard, bluetooth, etc.
11. xbin : additional command and bin files (busybox is usually installed here)
12. build.prop file : contain your system default prop
13. ts.conf : a configuration file for your system. you'd better stay away from it.
1.2 DEODEX VS ODEX
Most of custom rom available is deodexed rom while our stock rom is half deodexed rom. I'll try to explain it in most simple way. First of all, we should understand that mostly every app in android consist of three part, *apk files, *dex/odex files, and lib files.
ODEXED rom means that *dex file needed to run the app is extracted from the apk file and placed in same folder with the apk files (/system/app). the positive side, it consume less internal memory and a execute faster. the negative side, it makes the app uncostumizable (cannot apply custom themes) and need more space in system partition.
DEODEXED rom means that *dex file needed to run the app is extracted from the apk file and placed in /data/dalvik-cache. the positive side, the app can be themed (full customizable) and consume less system partition. we could put more app in /system/app in deodexed rom. the negative side, it consume a lot of internal memory. please be cautious with the internal memory space if you use deodexed rom. (NOTE: if you start from stock rom, you may use dsixdia to convert odexed to deodexed rom).
2. APP/SYSTEM MODIFICATION
basicly, you modify your system in two ways. push a file to add/replace file into your system and modify your files with file explorer. it can be done in several ways. if you want to modify your system, you should remember these stuff:
1. file compatibilty : if you push a file, especially some apps, you should make sure that file is compatible with your system. some app require different framework, additional libs, and some other dependencies. make sure you already had all of them in your system.
2. correct file permission: some file don't need special permission. however, some other file require special permission like execution.
3. system free memory : you have limited system partition size. you can't put everything inside it. please be aware with the system partition size and the free memory.
4. always backup before doing everything.
2.1 ADD MORE APP INTO YOUR SYSTEM
it can be done in two ways. the first one, you can add that app into /system/app. the second one, you can add that app into /system/vendor/app. both of them works on xperia's phone. most of the files inside inside /system/vendor work just like in /system. so, if you have an apk in /system/vendor/app, it's not different with having that apk in /system/app. nevertheless, all file in /system/vendor is more prioritizied than the one in /system. it means, if you have two file with same name, the one in /system/vendor will be used instead of the one in /system.
please note that. this trick only work for anything under /system/vendor/app, /system/vendor/etc, and /system/vendor/lib. for an instance, if you create /system/vendor/framework, it won't recognized by system. this trick will usefull for you if you want to modifying your system without touching your original system files. you'll also easiliy distinguish your modification and easily remove it from your system without worying about bootloop.
Click to expand...
Click to collapse
2.2 CREATE THEME FOR YOR OWN ROM
simple theming stuff could be done by replacing the pic files inside the apk, especially framework-res.apk in /system/framework. a hardcore theming need apk modification. this thread doesn't recover about this stuff since it's too long. please search it by yourself if you interested about it. for a basic theme, you need to modify systemUI.apk and framework-res.apk. the systemUI.apk contain your statusbar. the framework-res.apk contain your system interface.
3. TWEAK UP YOUR ROM
there are a lot of tweak. I'll divide it into two categories. scripts and props. scripts, is a tweak run by specified script. this tweak only work if you have a rom with init.d support or you're using script manager app. most of these stuff can be found in /system/etc/init.d/.
props, is a file contain your system properties. the famous one your build.prop inside /system. aside of it you actually have default.prop but this file is stored in your ramdisk and can't be modified without kernel modification. you have a lot of method to modify your prop stuff.
1. modify your build.prop file. you can put your own prop or modify the prop value inside this file. seems easy, but this is the most risky one. you can brick your device easily if you're not carefull when modifying it. I don't recommend it for new android user.
2. create a file "local.prop" in /data. the less risky method. it works just like when you modify your build.prop directly. however, it's less risky since if you got bootloop, you only need to delete it and your device will revived. I always prefer this method for my rom modification
3. create script in init.d. the basic form will be
Code:
#!/system/bin/sh
# the custom prop
setprop <prop key><space><prop value>
for an instance, if you have a prop in your build.prop "dalvik.vm.heapsize=128m" you can type "setprop dalvik.vm.heapsize 128m" in your script. this trick is usefull if you're a rom modificator and want to install something which require specific prop. in this way, you don't need to know anything inside build.prop/local.prop. you can make an universal mod which can be installed on a lot of device. bravia engine mod works fine with this method.
BONUS FOR TWEAKERS
if you have time, you can rewrite all the stuff by yourself to avoid double typed script with different value. its easy but need a lil more patience. I'll try to give quick explanation. our tweaks mostly work via init.d script. the basic structure will be.
Code:
#!/system/bin/sh --> the header. tell the system to use "sh" command on the script below
echo bla bla bla. --> the script
I'll differentiate the scripts into two parts. the one run a bash script and the one used to change our device setting. the first one is quite complicated and usually written on separated file. the famous one might be zipalign script and sqlite script. basicly you only need to add the script and the required files (the libs and the binary file in /system/bin) into your system and need no modification. just add and leave it.
the second part is the one used to change our device setting. we can differentiate this stuff into two things. the setprop stuff and the "other stuff". the setprop stuff is quite easy to use. the setprop stuff basic form is "setprop <key> <value>" for an example:
Code:
setprop ro.ril.enable.dtm 1
setprop ro.ril.gprsclass 10
setprop ro.ril.hep 1
setprop ro.ril.enable.3g.prefix 1
setprop ro.ril.hsdpa.category 8
setprop ro.ril.hsupa.category 6
setprop ro.ril.hsxpa 2
setprop ro.ril.enable.a53 1
some of these script written in form of "setprop ro.ril.hep=1". that's the wrong way. the correct way is as I've described above.
the second part, the "other stuff" work in three different way. for an example, look at these files
Code:
/proc/sys/kernel/shmmni
/proc/sys/kernel/shmmax
/proc/sys/kernel/shmall
these files have certain value on it. if we want to change the value written on it, we can use three different way.
1. use "sysctl -w <key>=<value>" form. in your init.d script you'll type
Code:
sysctl -w kernel.shmmni=4096
sysctl -w kernel.shmmax=268435456
sysctl -w kernel.shmall=2097152
2. use sysctl.conf file. in your sysctl.conf file, you'll write
Code:
kernel.shmmni=4096
kernel.shmmax=268435456
kernel.shmall=2097152
while in your init.d script you'll write "sysctl -p".
personally I prefer the number 1 since I can made a simple test to check whether if the script is running or not and add it into my log files. anyway, these trick only work for the files under /proc/sys. if you want to change the value of different files, you'll need to use method number 3.
3. use echo command. the form is "echo "<value>" > /path/to/file". in your init.d you'll write
Code:
echo "0" > /sys/module/lowmemorykiller/parameters/debug_level
echo "64" > /sys/module/lowmemorykiller/parameters/cost
echo "0,1,3,5,7,15" > /sys/module/lowmemorykiller/parameters/adj
echo "4096,5182,6400,15360,17920,20480" > /sys/module/lowmemorykiller/parameters/minfree
to avoid double typed script, we can categorize our tweak into several group. I'll show you my tweak as an example. you can learn it or start with it. I don't take credits, so that you can modify it anytime without asking my permission.
Code:
#!/system/bin/sh
# kuro tweak1: the echo stuff
# [email protected] (2012) - lol...i'm just joking. no copyright or whatsoever
# contact : [email protected]
# v.1 - first release
# v.1.1 - new log system and new tweak added.
# v.1.2 - new tweak for xperia
# v.1.3(4-11-12) - new form
LOG_FILE=/data/kuro_tweak1.log
LOG_FILEZ=/data/kuro_sqlite.log
if [ -e $LOG_FILE ]; then
rm $LOG_FILE;
fi;
if [ -e $LOG_FILEZ ]; then
rm $LOG_FILEZ;
fi;
# the preface
echo "==========================
# TWEAK KURO1-LOG FILE #
==========================
in the name of Allah,
the most beneficent,
the most mercifull
==========================
system information:
vendor : $( getprop ro.product.brand )
model : $( getprop ro.product.model )
ROM : $( getprop ro.build.display.id )
running the script...
start at:
$( date +"%m-%d-%Y %H:%M:%S" )
==========================" | tee -a $LOG_FILE;
# perfect mount
mount -o remount,noatime,commit=500,noauto_da_alloc,barrier=0 /system /system;
mount -o remount,noatime,commit=500,noauto_da_alloc,barrier=0 /data /data;
mount -o remount,noatime,commit=500,noauto_da_alloc,barrier=0 /cache /cache;
echo "perfect mount---------[OK]" | tee -a $LOG_FILE;
# sdcard speed fix
# not working yet - need root permission to change these value
if [ -e /sys/devices/virtual/bdi/179:0/read_ahead_kb ]; then
busybox echo "2048" > /sys/devices/virtual/bdi/179:0/read_ahead_kb
busybox echo "2048" > /sys/devices/virtual/bdi/179:32/read_ahead_kb
echo "sdcard speed fix------[OK]
-value set to $( cat /sys/devices/virtual/bdi/179:0/read_ahead_kb )
-value set to $( cat /sys/devices/virtual/bdi/179:32/read_ahead_kb )" | tee -a $LOG_FILE; else
echo "sdcard speed fix----[FAIL]" | tee -a $LOG_FILE;
fi
# kernel kick
sysctl -w kernel.shmmni=4096
sysctl -w kernel.shmmax=268435456
sysctl -w kernel.shmall=2097152
sysctl -w kernel.msgmni=4096
sysctl -w kernel.msgmax=64000
# sysctl -w kernel.sched_latency_ns=20000000
# sysctl -w kernel.sched_wakeup_granularity_ns=2500000
# sysctl -w kernel.sched_min_granularity_ns=10000000
sysctl -w kernel.sem="500 512000 64 2048"
sysctl -w kernel.panic=30
sysctl -w kernel.panic_on_oops=0
sysctl -w kernel.threads-max=10000
sysctl -w kernel.panic=30
# sysctl -w kernel.sched_compat_yield=1
# sysctl -w kernel.sched_shares_ratelimit=256000
sysctl -w kernel.ctrl-alt-del=0
sysctl -w fs.lease-break-time=10
sysctl -w fs.file-max=65536
echo "kernel kick-----------[OK]" | tee -a $LOG_FILE;
# OOM
sysctl -w vm.laptop_mode=0
sysctl -w vm.swappiness=40
sysctl -w vm.dirty_writeback_centisecs=3000
sysctl -w vm.dirty_expire_centisecs=500
sysctl -w vm.dirty_ratio=15
sysctl -w vm.dirty_background_ratio=10
sysctl -w vm.lowmem_reserve_ratio="100 100"
sysctl -w vm.overcommit_ratio=70
sysctl -w vm.highmem_is_dirtyable=1
sysctl -w vm.min_free_order_shift=4
sysctl -w vm.oom_kill_allocating_task=0
sysctl -w vm.panic_on_oom=0
sysctl -w vm.page-cluster=3
sysctl -w vm.drop_caches=3
sysctl -w vm.min_free_kbytes=5120
sysctl -w vm.vfs_cache_pressure=50
sysctl -w vm.block_dump=0
echo "memory management-----[OK]" | tee -a $LOG_FILE;
# network boost
sysctl -w net.ipv4.tcp_congestion_control=cubic
sysctl -w net.ipv4.tcp_timestamps=0
sysctl -w net.ipv4.tcp_tw_reuse=1
sysctl -w net.ipv4.tcp_sack=1
sysctl -w net.ipv4.tcp_dsack=1
sysctl -w net.ipv4.tcp_tw_recycle=1
sysctl -w net.ipv4.tcp_window_scaling=1
sysctl -w net.ipv4.tcp_keepalive_probes=5
sysctl -w net.ipv4.tcp_keepalive_intvl=30
sysctl -w net.ipv4.tcp_fin_timeout=30
sysctl -w net.ipv4.tcp_moderate_rcvbuf=1
sysctl -w net.ipv4.tcp_max_tw_buckets=1440000
sysctl -w net.ipv4.tcp_mem="57344 57344 524288"
sysctl -w net.ipv4.tcp_synack_retries=2
sysctl -w net.ipv4.tcp_syn_retries=2
sysctl -w net.ipv4.tcp_max_syn_backlog=1024
sysctl -w net.ipv4.icmp_echo_ignore_all=1
sysctl -w net.ipv4.route/flush=1
sysctl -w net.ipv4.udp_rmem_min=6144
sysctl -w net.ipv4.udp_wmem_min=6144
sysctl -w net.ipv4.tcp_rfc1337=1
sysctl -w net.ipv4.ip_no_pmtu_disc=0
sysctl -w net.ipv4.tcp_ecn=0
sysctl -w net.ipv4.tcp_wmem="6144 87380 524288"
sysctl -w net.ipv4.tcp_rmem="6144 87380 524288"
sysctl -w net.ipv4.tcp_fack=1
sysctl -w net.ipv4.tcp_synack_retries=2
sysctl -w net.ipv4.tcp_syn_retries=2
sysctl -w net.ipv4.tcp_no_metrics_save=1
sysctl -w net.ipv4.tcp_keepalive_time=1800
sysctl -w net.ipv4.ip_forward=0
sysctl -w net.ipv4.ip_dynaddr=0
sysctl -w net.ipv4.conf.all.accept_source_route=0
sysctl -w net.ipv4.conf.all.accept_redirects=0
sysctl -w net.ipv4.conf.all.rp_filter=1
sysctl -w net.ipv4.conf.all.secure_redirects=0
sysctl -w net.ipv4.conf.default.accept_redirects=0
sysctl -w net.ipv4.conf.default.secure_redirects=0
sysctl -w net.ipv4.conf.default.accept_source_route=0
sysctl -w net.core.rmem_max=524288
sysctl -w net.core.wmem_max=524288
sysctl -w net.core.rmem_default=262144
sysctl -w net.core.wmem_default=262144
sysctl -w net.core.optmem_max=20480
sysctl -w net.core.netdev_max_backlog=25000
sysctl -w net.unix.max_dgram_qlen=50
echo "network boost---------[OK]" | tee -a $LOG_FILE;
# cleaner
busybox rm -f /data/anr/*.*
busybox rm -f /data/cache/*.*
busybox rm -f /data/local/log/*.*
busybox rm -f /data/local/tmp/*.*
busybox rm -f /data/last_alog/*
busybox rm -f /data/last_kmsg/*
busybox rm -f /data/mlog/*
busybox rm -f /data/tombstones/*
busybox rm -f /data/system/dropbox/*
chmod 400 /data/system/dropbox
busybox rm /dev/log/main
busybox rm -f /data/system/usagestats/*
busybox chmod 400 /data/system/usagestats
export sampling_rate=10000
export up_threshold=80
echo "memory cleaner--------[OK]" | tee -a $LOG_FILE;
if [ -e /data/anr/*.* ]; then
echo "-anr not cleaned" | tee -a $LOG_FILE; else
echo "-anr cleaned" | tee -a $LOG_FILE
fi;
if [ -e /data/local/tmp/*.* ]; then
echo "-local/tmp not cleaned" | tee -a $LOG_FILE; else
echo "-local/tmp cleaned" | tee -a $LOG_FILE
fi;
if [ -e /data/cache/*.* ]; then
echo "-cache not cleaned" | tee -a $LOG_FILE; else
echo "-cache cleaned" | tee -a $LOG_FILE
fi;
if [ -e /data/last_log/*.* ]; then
echo "-log not cleaned" | tee -a $LOG_FILE; else
echo "-log cleaned" | tee -a $LOG_FILE
fi;
if [ -e /data/tombstones/*.* ]; then
echo "-tombstones not cleaned" | tee -a $LOG_FILE; else
echo "-tombstones cleaned" | tee -a $LOG_FILE
fi;
# minfree
echo "64" > /sys/module/lowmemorykiller/parameters/cost
echo "0,1,3,5,7,15" > /sys/module/lowmemorykiller/parameters/adj
echo "4096,5182,6400,15360,17920,20480" > /sys/module/lowmemorykiller/parameters/minfree
echo "minfree setting-------[OK]
-minfree value
$( cat /sys/module/lowmemorykiller/parameters/adj )
$( cat /sys/module/lowmemorykiller/parameters/minfree )" | tee -a $LOG_FILE;
# end
echo "==========================
done at:
$( date +"%m-%d-%Y %H:%M:%S" )
all praise is due to Allah
==========================
-- have a nice day --
[email protected]
==========================" | tee -a $LOG_FILE;
note that the line started with # are not executed.
Code:
#!/system/bin/sh
# kuro tweak2: the setprop stuffs and journalismoff
# [email protected] (2012) - lol...i'm just joking. no copyright or whatsoever
# contact : [email protected]
# v.1 - first release
# v.1.1 - new log system and new tweak added.
# v.1.2 - new tweak for xperia
LOG_FILE=/data/kuro_tweak2.log
if [ -e $LOG_FILE ]; then
rm $LOG_FILE;
fi;
# the preface
echo "==========================
# TWEAK KURO2-LOG FILE #
==========================
in the name of Allah,
the most beneficent,
the most mercifull
==========================
system information:
vendor : $( getprop ro.product.brand )
model : $( getprop ro.product.model )
ROM : $( getprop ro.build.display.id )
running the script...
start at:
$( date +"%m-%d-%Y %H:%M:%S" )
==========================" | tee -a $LOG_FILE;
# 3g mod
setprop ro.ril.enable.dtm 1
setprop ro.ril.gprsclass 10
setprop ro.ril.hep 1
setprop ro.ril.enable.3g.prefix 1
setprop ro.ril.hsdpa.category 8
setprop ro.ril.hsupa.category 6
setprop ro.ril.hsxpa 2
setprop ro.ril.enable.a53 1
setprop ro.ril.htcmaskw1.bitmask 4294967295
setprop ro.ril.htcmaskw1 14449
setprop ro.config.hw_fast_dormancy 1
echo "3g signal mod---------[OK]" | tee -a $LOG_FILE;
# battery mod n media
setprop debug.performance.tuning 1
setprop pm.sleep_mode 1
setprop windowsmgr.max_events_per_sec 90
setprop ro.ril.disable.power.collapse 0
setprop wifi.supplicant_scan_interval 180
setprop ro.media.enc.jpeg.quality 100
setprop debug.sf.hw 1
setprop ro.vold.umsdirtyratio 20
echo "battery n media-------[OK]" | tee -a $LOG_FILE;
# performance
# setprop persist.sys.purgeable_assets 1
setprop dalvik.vm.execution-mode int:jit
setprop dalvik.vm.dexopt-flags l=x,n=z,m=y
setprop dalvik.vm.verify-bytecode false
setprop dalvik.vm.heapsize 64m
setprop dalvik.vm.heapgrowthlimit 48m
setprop dalvik.vm.dexopt-data-only 1
setprop dalvik.vm.jmiopts forcecopy
setprop dalvik.vm.lockprof.treshold 250
setprop ro.kernel.android.checkjni 0
setprop ro.telephony.call_ring.delay 0
setprop debug.kill_allocating_task 1
# defaul is zero
# mem adj
setprop ro.FOREGROUND_APP_ADJ 0
setprop ro.VISIBLE_APP_ADJ 4
setprop ro.SECONDARY_SERVER_ADJ 6
setprop ro.HIDDEN_APP_MIN_ADJ 8
setprop ro.CONTENT_PROVIDER_ADJ 12
setprop ro.EMPTY_APP_ADJ 15
# mem minfree
setprop ro.FOREGROUND_APP_MEM 1536
setprop ro.VISIBLE_APP_MEM 2048
setprop ro.SECONDARY_SERVER_MEM 4096
setprop ro.HIDDEN_APP_MEM 5120
setprop ro.CONTENT_PROVIDER_MEM 5632
setprop ro.EMPTY_APP_MEM 6144
echo "performance-----------[OK]" | tee -a $LOG_FILE;
# Disable debugging notify icon on statusbar
setprop persist.adb.notify 0
# Disable blackscreen issue after a call
setprop ro.lge.proximity.delay 0
setprop mot.proximity.delay 0
# Phone will not wake up from hitting the volume rocker
# setprop ro.config.hwfeature_wakeupkey 0
# Enable display Dithering
# setprop persist.sys.use_dithering 1
# xperia mental
setprop persist.android.strictmode 0
setprop persist.sys.ui.hw 1
setprop ro.max.fling_velocity 12000
setprop ro.min.fling_velocity 2000
setprop ro.mot.eri.losalert.delay 1000
setprop ro.kernel.checkjni 0
setprop ro.config.nocheckin 1
setprop debug.qctwa.statusbar 1
setprop debug.qctwa.preservebuf 1
setprop debug.qc.hardware true
setprop com.qc.hardware true
setprop profiler.force_disable_err_rpt 1
setprop profiler.force_disable_ulog 1
setprop logcat.live disable
setprop net.ppp0.dns1 8.8.8.8
setprop net.ppp0.dns2 8.8.4.4
setprop net.dns1 8.8.8.8
setprop net.rmnet0.dns1 8.8.8.8
setprop net.rmnet0.dns2 8.8.4.4
setprop net.dns2 8.8.4.4
setprop debug.egl.profiler 1
setprop debug.egl.hw 1
setprop debug.composition.type gpu
echo "Xperia tweak----------[OK]" | tee -a $LOG_FILE;
# no journal
tune2fs -o journal_data_writeback /dev/block/mmcblk0p10
tune2fs -o journal_data_writeback /dev/block/mmcblk0p11
tune2fs -o journal_data_writeback /dev/block/mmcblk0p15
echo "no journal------------[OK]" | tee -a $LOG_FILE;
# end
echo "==========================
done at:
$( date +"%m-%d-%Y %H:%M:%S" )
all praise is due to Allah
==========================
-- have a nice day --
[email protected]
==========================" | tee -a $LOG_FILE;
the journalism stuff require tune2fs binary file installed into your system.
Code:
#!/system/bin/sh
#keep beats
PPID=$(pidof org.equalizerapp);
echo "17" > /proc/$PPID/oom_adj;
renice -18 $PPID;
#set
setprop.keep_app_1 org.equalizerapp
#audio resample
setprop af.resample 48000;
setprop af.resampler.quality 255;
setprop ro.audio.samplerate 48000;
setprop ro.audio.pcm.samplerate 48000;
setprop persyst.af.resample 48000;
setprop persyst.af.resampler.quality 255;
setprop persyst.ro.audio.samplerate 48000;
setprop persyst.ro.audio.pcm.samplerate 48000;
setprop persyst.dev.pm.dyn_samplingrate 1;
this one is modifying our sound quality. some of the part are still under my investigation but the audio resample part is really working.
Code:
#!/system/bin/sh
# DarkyROM 2011
# Much faster zipalign.
# Changelog:
# 1.3 (5/8/12) new log system. system remount deleted (by: kurotsugi)
# 1.2 (17/1/11) Added /data/zipalign.db file for faster apk check (ninpo,Bo$s)
# 1.1 (12/1/09) Switched to zipalign -c 4 to check the apk instead of MD5 (oknowton)
# 1.0 (11/30/09) Original
LOG_FILE=/data/kuro_zalign.log
ZIPALIGNDB=/data/kuro_zalign.db
if [ -e $LOG_FILE ]; then
rm $LOG_FILE;
fi;
if [ ! -f $ZIPALIGNDB ]; then
touch $ZIPALIGNDB;
fi;
# the preface
echo "==========================
# TWEAK KURO-ZALIGN FILE #
==========================
in the name of Allah,
the most beneficent,
the most mercifull
==========================
system information:
vendor : $( getprop ro.product.brand )
model : $( getprop ro.product.model )
ROM : $( getprop ro.build.display.id )
running the script...
start at:
$( date +"%m-%d-%Y %H:%M:%S" )
==========================" | tee -a $LOG_FILE;
# zipalign script (not modified)
for DIR in /system/app /data/app ; do
cd $DIR
for APK in *.apk ; do
if [ $APK -ot $ZIPALIGNDB ] && [ $(grep "$DIR/$APK" $ZIPALIGNDB|wc -l) -gt 0 ] ; then
echo "zipaligned: $DIR/$APK" | tee -a $LOG_FILE
else
zipalign -c 4 $APK
if [ $? -eq 0 ] ; then
echo "now zipaligned: $DIR/$APK" | tee -a $LOG_FILE
grep "$DIR/$APK" $ZIPALIGNDB > /dev/null || echo $DIR/$APK >> $ZIPALIGNDB
else
echo "Now aligning: $DIR/$APK" | tee -a $LOG_FILE
zipalign -f 4 $APK /cache/$APK
busybox mount -o rw,remount /system
cp -f -p /cache/$APK $APK
busybox rm -f /cache/$APK
grep "$DIR/$APK" $ZIPALIGNDB > /dev/null || echo $DIR/$APK >> $ZIPALIGNDB
fi
fi
done
done
touch $ZIPALIGNDB
# end
echo "==========================
done at:
$( date +"%m-%d-%Y %H:%M:%S" )
all praise is due to Allah
==========================
-- have a nice day --
[email protected]
==========================" | tee -a $LOG_FILE;
the famous zipalign script. i modify the log system. you need the zipalign binary to use it
Code:
#!/system/bin/sh
# kuro akuro: new data2sd method
# [email protected] (2012) - lol...i'm just joking. no copyright or whatsoever
# contact : [email protected]
# v.1 - first release
# v.1.1 - automated system, new build,
LOG_FILE=/data/kuro_akuro.log
if [ -e $LOG_FILE ]; then
rm $LOG_FILE;
fi;
# the preface
echo "==========================
# TWEAK AKURO-LOG FILE #
==========================
in the name of Allah,
the most beneficent,
the most mercifull
==========================
system information:
vendor : $( getprop ro.product.brand )
model : $( getprop ro.product.model )
ROM : $( getprop ro.build.display.id )
running the script...
start at:
$( date +"%m-%d-%Y %H:%M:%S" )
==========================" | tee -a $LOG_FILE;
# fix sdcard speed
if [ -e /sys/devices/virtual/bdi/179:0/read_ahead_kb ]; then
echo "2048" > /sys/devices/virtual/bdi/179:0/read_ahead_kb;
echo "fix sdcard speed tweak [OK]" | tee -a $LOG_FILE;
fi;
# create sdext dir in /system
if [ ! -e /system/sd ]; then
echo "WARNING!: no sdext dir
please create dir /system/sd" | tee -a $LOG_FILE;
fi;
echo "SDEXT directory check [OK]" | tee -a $LOG_FILE;
# mount sdcard all type
busybox mount -o noatime,nodiratime,nosuid,nodev /dev/block/mmcblk0p2 /system/sd;
mountext=`busybox mount | egrep 'ext2|ext3|ext4'`;
if [ -n "$mountext" ]; then
chown 1000:1000 /system/sd;
chmod 771 /system/sd;
fi;
echo "akuro: sd-ext mount [OK]" | tee -a $LOG_FILE;
# create the directories
if [ ! -e /system/sd/app ]; then
mkdir /system/sd/app;
busybox mv /data/app/* /system/sd/app;
fi;
if [ ! -e /system/sd/dalvik-cache ]; then
mkdir /system/sd/dalvik-cache;
busybox mv /data/dalvik-cache/* /system/sd/dalvik-cache;
fi;
echo "akuro: preparation step [OK]" | tee -a $LOG_FILE;
# mount sd to data directories
mount -o bind /system/sd/app /data/app;
chown 1000:1000 /system/sd/app;
chmod 771 /system/sd/app;
if [ -e /system/sd/app ]; then
echo "akuro: app mount step [OK]" | tee -a $LOG_FILE; else
echo "akuro: app mount step [FAIL]" | tee -a $LOG_FILE;
fi;
mount -o bind /system/sd/dalvik-cache /data/dalvik-cache;
chown 1000:1000 /system/sd/dalvik-cache;
chmod 771 /system/sd/dalvik-cache;
if [ -e /system/sd/dalvik-cache ]; then
echo "akuro: dalvik mount step [OK]" | tee -a $LOG_FILE; else
echo "akuro: dalvik mount step [FAIL]" | tee -a $LOG_FILE;
fi;
if [ -e /system/sd/data ]; then
mount -o bind /system/sd/data /data/data;
chown 1000:1000 /system/sd/data;
chmod 771 /system/sd/data;
fi;
if [ -e /system/sd/data ]; then
echo "akuro: data mount step [OK]" | tee -a $LOG_FILE; else
echo "akuro: data mount step [FAIL]" | tee -a $LOG_FILE;
fi;
# end
echo "==========================
done at:
$( date +"%m-%d-%Y %H:%M:%S" )
all praise is due to Allah
==========================
-- have a nice day --
[email protected]
==========================" | tee -a $LOG_FILE;
my own made akuro script. it works to move dalvik-cache,app, and /data/folder from our internal memory to ext2/3/4 partition on our sdcard. it will save our internal mem space. sadly this one is for samsung device. you need to modify some part of it.
have a nice tweaking
EDIT: btw, for my first and second tweak, you should use your own value. my value is taken from sgy and still under investigation to get better result.
as I've promised I'll tell you how to build your own rom. however, I made this thread for someone who started to build his own rom. I want to made this post understandable even for a newb in android world. this guide doesn't recover stuffs like how to customize the theme or add more feature into your your rom. that one require a lot of resources and you need to learn it by yourself.
the first thing you need is the system files. you can get it by dumping your system partition, modify an existed rom of even build it from scratch by yourself. assume if you already have one, the next thing you should learn is the updater script.
basic rom installer structure will be something like this.
1. meta-inf folder : contain updater script and updater binary to install your rom
2. system folder : contain your system files
3. additional files and script.
for a start, you can get meta-inf folder from here http://www.mediafire.com/?nxgiz0993brp9re
it contain a basic updater script to install a rom. it designed to install a rom for another device. you need to modify it if you want to use it.
if you open the updater script, you'll see this
Code:
ui_print("Installing ...");
ui_print(" ");
unmount("/system");
mount("ext3", "EMMC", "/dev/block/mmcblk0p2", "/system");
show_progress(0.100000, 0);
delete_recursive("/system");
show_progress(0.100000, 0);
show_progress(0.500000, 40);
ui_print("Installing System...");
package_extract_dir("system", "/system");
symlink("toolbox", "/system/bin/schedtop");
symlink("toolbox", "/system/bin/df");
symlink("toolbox", "/system/bin/insmod");
symlink("toolbox", "/system/bin/top");
symlink("toolbox", "/system/bin/iftop");
symlink("toolbox", "/system/bin/getevent");
symlink("toolbox", "/system/bin/rm");
symlink("toolbox", "/system/bin/rmmod");
symlink("toolbox", "/system/bin/printenv");
symlink("toolbox", "/system/bin/start");
symlink("toolbox", "/system/bin/kill");
symlink("toolbox", "/system/bin/vmstat");
symlink("toolbox", "/system/bin/stop");
symlink("toolbox", "/system/bin/ioctl");
symlink("toolbox", "/system/bin/cmp");
symlink("toolbox", "/system/bin/ps");
symlink("toolbox", "/system/bin/chmod");
symlink("toolbox", "/system/bin/sendevent");
symlink("toolbox", "/system/bin/netstat");
symlink("toolbox", "/system/bin/setconsole");
symlink("toolbox", "/system/bin/cat");
symlink("toolbox", "/system/bin/mount");
symlink("toolbox", "/system/bin/ln");
symlink("toolbox", "/system/bin/log");
symlink("toolbox", "/system/bin/reboot");
symlink("toolbox", "/system/bin/dd");
symlink("toolbox", "/system/bin/id");
symlink("toolbox", "/system/bin/getprop");
symlink("toolbox", "/system/bin/lsmod");
symlink("toolbox", "/system/bin/ionice");
symlink("toolbox", "/system/bin/newfs_msdos");
symlink("toolbox", "/system/bin/setprop");
symlink("toolbox", "/system/bin/sync");
symlink("toolbox", "/system/bin/umount");
symlink("toolbox", "/system/bin/watchprops");
symlink("toolbox", "/system/bin/route");
symlink("toolbox", "/system/bin/notify");
symlink("toolbox", "/system/bin/uptime");
symlink("toolbox", "/system/bin/wipe");
symlink("toolbox", "/system/bin/nandread");
symlink("toolbox", "/system/bin/lsof");
symlink("toolbox", "/system/bin/mkdir");
symlink("toolbox", "/system/bin/rmdir");
symlink("toolbox", "/system/bin/hd");
symlink("toolbox", "/system/bin/ls");
symlink("toolbox", "/system/bin/chown");
symlink("toolbox", "/system/bin/dmesg");
symlink("toolbox", "/system/bin/sleep");
symlink("toolbox", "/system/bin/renice");
symlink("toolbox", "/system/bin/ifconfig");
symlink("toolbox", "/system/bin/mv");
symlink("toolbox", "/system/bin/date");
symlink("toolbox", "/system/bin/smd");
symlink("dumpstate", "/system/bin/dumpmesg");
set_perm_recursive(0, 0, 0755, 0644, "/system");
set_perm_recursive(0, 0, 0777, 0777, "/system/etc/init.d");
set_perm_recursive(0, 2000, 0755, 0755, "/system/bin");
set_perm(0, 3003, 06755, "/system/bin/ip");
set_perm(0, 3003, 02750, "/system/bin/netcfg");
set_perm(0, 3004, 02755, "/system/bin/ping");
set_perm(0, 2000, 06750, "/system/bin/run-as");
set_perm_recursive(1002, 1002, 0755, 0440, "/system/etc/bluetooth");
set_perm(0, 0, 0755, "/system/etc/bluetooth");
set_perm(1000, 1000, 0640, "/system/etc/bluetooth/auto_pairing.conf");
set_perm(3002, 3002, 0444, "/system/etc/bluetooth/blacklist.conf");
set_perm(1002, 1002, 0755, "/system/etc/dbus.conf");
set_perm(1014, 2000, 0755, "/system/etc/dhcpcd/dhcpcd-run-hooks");
set_perm(0, 2000, 0550, "/system/etc/init.goldfish.sh");
set_perm(0, 0, 04755, "/system/bin/bash");
symlink("/system/bin/bash", "/system/bin/sh");
set_perm(0, 0, 0777, "/system/bin/a2sd");
set_perm(0, 0, 0777, "/system/rtc/init.d/S95allinone");
set_perm(0, 0, 0777, "/system/etc/init.d/00banner");
set_perm(0, 0, 0777, "/system/etc/init.d/01sysctl");
set_perm(0, 0, 0777, "/system/etc/init.d/02firstboot");
set_perm(0, 0, 0777, "/system/etc/init.d/03mountsd");
set_perm(0, 0, 0777, "/system/etc/init.d/04apps2sd");
set_perm(0, 0, 0777, "/system/etc/init.d/99complete");
set_perm(0, 0, 0777, "/system/bin/launcha2sd");
set_perm(0, 0, 0777, "/system/bin/starta2sd");
set_perm(0, 0, 0777, "/system/bin/jita2sd");
set_perm(0, 0, 0777, "/system/bin/chka2sd");
set_perm(0, 0, 0777, "/system/bin/zipalign");
set_perm(0, 0, 0777, "/system/bin/sysinit");
set_perm(0, 0, 0777, "/system/bin/busybox.a2sd");
set_perm(0, 0, 0644, "/system/bin/apps2sd.hlp");
set_perm(0, 0, 0777, "/system/xbin/a2sd");
set_perm(0, 0, 0777, "/system/bin/dtinstall");
set_perm(0, 0, 06755, "/system/bin/su");
symlink("/system/bin/su", "/system/xbin/su");
set_perm_recursive(0, 0, 0755, 0555, "/system/etc/ppp");
set_perm_recursive(0, 2000, 0755, 0755, "/system/xbin");
show_progress(0.1, 10);
show_progress(0.2, 0);
set_perm(0, 1000, 0755, "/system/xbin/busybox");
package_extract_file("installbusybox", "/tmp/installbusybox");
set_perm(0, 0, 0777, "/tmp/installbusybox");
run_program("/tmp/installbusybox");
ui_print("Installing Boot...");
show_progress(0.2, 10);
show_progress(0.100000, 0);
ui_print(" ");
ui_print("Installation Completed!!!!");
ui_print(" ");
ui_print("Enjoy...");
ui_print(" ");
unmount("/system");
ui_print("Welcome to MySs Rom ");
lets breakdown the updater script. basic updater script contain several parts. from above script, we can divide it into these parts:
1. UI SCRIPT
it will give you information about your rom installation.
it consist of two part. the first one is the ui_print, it used to show some text when you install the rom. for an example, ui_print("Welcome to MySs Rom "); it will print Welcome to MySs Rom on your screen. the form is
Code:
ui_print("<your text>")
the second one is the show progress stuff. for an example show_progress(0.5, 20);.the form is
Code:
show_progress(<the progress part 0 to 1>, <time needed to reach progress part>);
if you look into the example, it means that the installation progress bar will reach 50% in 20 second.
2. INSTALLER SCRIPT
the most crucial part. it install the files into your system partition.
it consist of three part. the first one is the mounter script. it used to mount a certain partition when you install the rom. this is one of the example mount("ext3", "EMMC", "/dev/block/mmcblk0p2", "/system");. the basic form is
Code:
mount("<partition file>", "<partition type>", "<partition location>", "<place where it mounted>");
the second part is formater script. you can do it by format the entire partition or simply delete all the files in the partition. I always choose the second one to avoid getting a corrupted partition. the basic form is
Code:
delete_recursive("<folder address>")
# or in an example
delete_recursive("/system");
the last part is the one used to copy the files into your system. you can do it in two ways. the first one you copy the files one by one. you'll use something like this.package_extract_file("installbusybox", "/tmp/installbusybox");. the form is package_extract_file("<file name and address>", "<where you want to copy it>");. the second one is you copy the entire folder. you'll use package_extract_dir("system", "/system");. the form is package_extract_dir("<folder name inside your zip file>", "<where to copy it>");
3. MODIFIER SCRIPT
to change the permission you'll use
Code:
set_perm_recursive(0, 2000, 0755, 0755, "/system/bin");
# if you want to change it based on the folder
# basic form
set_perm_recursive(<1st owner>, <2nd owner>, <folder permission>, <file permission>, "/system/bin")
set_perm(0, 3003, 06755, "/system/bin/ip");
# if you want to change it file by file
# basic form
set_perm(<1st owner>, <2nd owner>, <permission>, "/system/bin/ip")
to create symlink
Code:
symlink("toolbox", "/system/bin/ls");
# basic form
symlink("<the file name>", "<the link name>");
4. ADDITIONAL SCRIPT
it mainly use to run certain script. for an example
Code:
package_extract_file("installbusybox", "/tmp/installbusybox");
set_perm(0, 0, 0777, "/tmp/installbusybox");
run_program("/tmp/installbusybox"); [code] first thing you should remember is that you need to extract the script first. in this case, is the installbusybox file to /tmp. to run the script you'll need to change the permission and run it with run_program. the basic form is [b]run_program("<the file>")[/b]
[/hide]
now, after you know about the updater script, you need to create the proper updater script for your rom. the basic script will be.
1. mount all needed partition. some rom installation need to mount /data, /cache, etc. make sure you already mount all of them
2. delete all the old system files.
3. copy all new system files into your system.
4. change the owner and the permission of certain files and folders. make sure you have the exact owner and permission setting of all the files copied into /system. the default is owner: root. permission: rw-r-r.
5. create symlinks.
6. run the additional script.
the last step, pack all the files into a single zip file and install your rom. enjoy your rom.
ADDITIONAL RESOURCE
1. introduction for edify updater script [url]http://forum.xda-developers.com/showthread.php?t=1669489[/url]
2. dsixda's kitchen [url]http://forum.xda-developers.com/showthread.php?t=633246[/url]
3. kernel kitchen [url]http://forum.xda-developers.com/showthread.php?t=1659584[/url]
Thanks king! Always wanted to learn that!
Sent from my ST23i using xda app-developers app
nice one..thanks for your work.:good:
thanks, nice info
Good post will wait for some more cool stuffs
thread updated...I don't know. I hope you can understand this simple guide. I made this thread so that we will have more rom devs in near future. please don't use it to steal another's works.
help
kurotsugi said:
thread updated...I don't know. I hope you can understand this simple guide. I made this thread so that we will have more rom devs in near future. please don't use it to steal another's works.
Click to expand...
Click to collapse
hai gan.. terimakasih untuk tut.nya kembangkan terus skill yang anda punya.
saya jadi ikut bangga .. heee.
gan saya boleh minta tolong. kenapa kalau saya buat jaringan ad hoc dikomputer lalu saya coba check di hp saya (sony tipo) itu nggak mau kedeteksi dan konek? denger-denger katanya suruh modif wpa_nya tapi tetep nggak bisa.
tolong bantu saya gan,
terimakasih. :angel:
Pls keep the language to english
Inviato dal mio ST26i con Tapatalk 2
thanks for this tut, I'll bookrmark this topic since I'm still new to this android thingy
Beautiful tutorial Thanks:highfive:
Java_Indo said:
hai gan.. terimakasih untuk tut.nya kembangkan terus skill yang anda punya.
saya jadi ikut bangga .. heee.
gan saya boleh minta tolong. kenapa kalau saya buat jaringan ad hoc dikomputer lalu saya coba check di hp saya (sony tipo) itu nggak mau kedeteksi dan konek? denger-denger katanya suruh modif wpa_nya tapi tetep nggak bisa.
tolong bantu saya gan,
terimakasih. :angel:
Click to expand...
Click to collapse
Pakai bahasa inggris..
This is international forum, all around the world is here..
Anyway, thanka for this guide.. bookmarked this
Thanks a lot!

[Tweak][Guide] Init.d Tweaks

Init.d Tweaks
(Needs ROM (Kernel) With init.d Access And Busybox, Open Empty File In Text Editor (Notepad ++ Or Similar), Insert Tweak You Want In Header,Save in /system/etc/init.d and name it Lomething Like 73tweaks)
1. Strict minfree handler tweak
Code:
echo "2048,3072,6144,15360,17920,20480" > /sys/module/lowmemorykiller/parameters/minfree
2. Internet speed tweaks
Code:
echo "0" > /proc/sys/net/ipv4/tcp_timestamps;
echo "1" > /proc/sys/net/ipv4/tcp_tw_reuse;
echo "1" > /proc/sys/net/ipv4/tcp_sack;
echo "1" > /proc/sys/net/ipv4/tcp_tw_recycle;
echo "1" > /proc/sys/net/ipv4/tcp_window_scaling;
echo "5" > /proc/sys/net/ipv4/tcp_keepalive_probes;
echo "30" > /proc/sys/net/ipv4/tcp_keepalive_intvl;
echo "30" > /proc/sys/net/ipv4/tcp_fin_timeout;
echo "404480" > /proc/sys/net/core/wmem_max;
echo "404480" > /proc/sys/net/core/rmem_max;
echo "256960" > /proc/sys/net/core/rmem_default;
echo "256960" > /proc/sys/net/core/wmem_default;
echo "4096,16384,404480" > /proc/sys/net/ipv4/tcp_wmem;
echo "4096,87380,404480" > /proc/sys/net/ipv4/tcp_rmem;
3. Vm management tweaks
Code:
echo "4096" > /proc/sys/vm/min_free_kbytes
echo "0" > /proc/sys/vm/oom_kill_allocating_task;
echo "0" > /proc/sys/vm/panic_on_oom;
echo "0" > /proc/sys/vm/laptop_mode;
echo "0" > /proc/sys/vm/swappiness
echo "50" > /proc/sys/vm/vfs_cache_pressure
echo "90" > /proc/sys/vm/dirty_ratio
echo "70" > /proc/sys/vm/dirty_background_ratio
4. Misc kernel tweaks
Code:
echo "8" > /proc/sys/vm/page-cluster;
echo "64000" > /proc/sys/kernel/msgmni;
echo "64000" > /proc/sys/kernel/msgmax;
echo "10" > /proc/sys/fs/lease-break-time;
echo "500,512000,64,2048" > /proc/sys/kernel/sem;
5. Battery tweaks
Code:
echo "500" > /proc/sys/vm/dirty_expire_centisecs
echo "1000" > /proc/sys/vm/dirty_writeback_centisecs
6. EXT4 tweaks (greatly increase I/O)
(needs /system, /cache, /data partitions formatted to EXT4)
a) removes journalism
Code:
tune2fs -o journal_data_writeback /block/path/to/system
tune2fs -O ^has_journal /block/path/to/system
tune2fs -o journal_data_writeback /block/path/to/cache
tune2fs -O ^has_journal /block/path/to/cache
tune2fs -o journal_data_writeback /block/path/to/data
tune2fs -O ^has_journal /block/path/to/data
b) perfect mount options
Code:
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
7. Flags blocks as non-rotational and increases cache size
Code:
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 "2048" > $j/queue/read_ahead_kb;
done
8. microSD card speed tweak
Code:
echo "2048" > /sys/devices/virtual/bdi/179:0/read_ahead_kb;
9. Defrags database files
Code:
for i in \
`find /data -iname "*.db"`
do \
sqlite3 $i 'VACUUM;';
done
9. Remove logger
Code:
rm /dev/log/main
10. Ondemand governor tweaks
Code:
SAMPLING_RATE=$(busybox expr `cat /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_transition_latency` \* 750 / 1000)
echo 95 > /sys/devices/system/cpu/cpufreq/ondemand/up_threshold
echo $SAMPLING_RATE > /sys/devices/system/cpu/cpu0/cpufreq/ondemand/sampling_rate
11. Auto change governor and I/O Scheduler
a) I/O Scheduler (Best: MTD devices - VR; EMMC devices - SIO) - needs kernel with these
Code:
echo "vr" > /sys/block/mmcblk0/queue/scheduler
or
Code:
echo "sio" > /sys/block/mmcblk0/queue/scheduler
b) Governor (Best: Minmax > SavagedZen > Smoothass > Smartass > Interactive) - needs kernel with these
Code:
echo "governor-name-here" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
12. Move dalvik-cache to cache partition (if it's big enough) to free up data partition space
Code:
CACHESIZE=$(df -k /cache | tail -n1 | tr -s ' ' | cut -d ' ' -f2)
if [ $CACHESIZE -gt 80000 ]
then
echo "Large cache detected, moving dalvik-cache to /cache"
if [ ! -d /cache/dalvik-cache ]
then
busybox rm -rf /cache/dalvik-cache /data/dalvik-cache
mkdir /cache/dalvik-cache /data/dalvik-cache
fi
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
else
echo "Small cache detected, dalvik-cache will remain on /data"
fi
13. Disable normalize sleeper
Code:
mount -t debugfs none /sys/kernel/debug
echo NO_NORMALIZED_SLEEPER > /sys/kernel/debug/sched_features
14. GPS.conf
(create or edit your /system/etc/gps.conf with a text editor)
a) European NTP server (replace for america or asia in your case)
Code:
NTP_SERVER=europe.pool.ntp.org
XTRA_SERVER_1=http://xtra1.gpsonextra.net/xtra.bin
XTRA_SERVER_2=http://xtra2.gpsonextra.net/xtra.bin
XTRA_SERVER_3=http://xtra3.gpsonextra.net/xtra.bin
b) SE supl for A-GPS (better than Nokia's or Google's)
Code:
SUPL_HOST=supl.sonyericsson.com
SUPL_PORT=7275
Warning: Using these tweaks may brick your device. Use it with caution.
:good::good::good:
How can I know that my ROM / kernel support Init.d or not??
AK205 said:
How can I know that my ROM / kernel support Init.d or not??
Click to expand...
Click to collapse
Install Universal Init.d from Play Store and follow in-app instructions. Init.d support will be enabled on your device. Your device must be rooted first.
Build.prop tweaks by @bravonova
bravonova said:
Install Universal Init.d from Play Store and follow in-app instructions. Init.d support will be enabled on your device. Your device must be rooted first.
Click to expand...
Click to collapse
I make and init.d script and i copy your custom values to my init.d script. However, on net speed tweaks, the tcp_rmem and tcp_wmem didn't change the value at all even i edited it. Any help?
Should it be in text file or script file?
So we create a different text document containing each code for each tweak?? Not all In one document in the init.d folder??
Nice write up, bro. Thanks. Will have to try.
Guys so why aren't these enhancing tweaks and buildprop tweaks already available in our phones? Why aren't our phones optimized?
Tweaks good for one person or situation are not necessarily optimal for every case in general .
Medyredy said:
Guys so why aren't these enhancing tweaks and buildprop tweaks already available in our phones? Why aren't our phones optimized?
Click to expand...
Click to collapse
Can you help please?
Hello, I'm a newbie here. I wish to overclock my stock kernal, So it can be done through tweak? or I have to compile new overclock kernal from stock kernal source? Their's already a overclocked kernal for my device but its for cm11 and i want to use it on 4.1.2 JB stock ROM. Is their any simple way out?
Your help will be appreciated. Thanks .
use cm11 for s7392 or try
cm12 new developed
or stock i did give it to you before
choice is yours.......
i no longer have this device
rony raj said:
use cm11 for s7392 or try
cm12 new developed
or stock i did give it to you before
choice is yours.......
i no longer have this device
Click to expand...
Click to collapse
Thanks for suggesting new Cm12 kernal.
As of cm11, X264 encoding is important for me, plus their were some other minor bugs in that build. Though i agree its the best build compiled rom for Trend.
I will myself start some project after June~July.
What happened to your device though? You are among the few members who are guiding peoples on threads related to this device and i really appreciate it.

Categories

Resources