[Package][SCRIPTS][Tweaks]LagFreeV2.0.1[Upd:14March] - Galaxy S I9000 Android Development

Introduction:
Well,After Some Devices Like the Galaxy ACE,SGS-SCLD,Fit and Gio today I present to You the Newer version of LagFree For SGS I9000 and It's Variants!
Lagfree Is not Just a RAM Manager It a Complete Script With a lot of Tweaks and Iprovements
Improvements:
-MinFree enabled
-Touchscreen sensivity increased
-Zipaligning apps while Booting
-Less aggressive settings for kernel
-Better VM management
-system tweaks
-Battery Life improvements
-Better Multitasking
-Database Tweaks
-Wi-Fi and NetWork Tweaks
-Kernel Tweaks
-A Lot More!!
Requirements:
-Android Gingerbread 2.3.x or Higher
-Root
-Kernel that supports init.d (like CF-Root,Semaphore,etc...)
-Ext4 lagfix if you want to use the remount script
How to install:
1-you need to have CWM4 or 5 installed
2-Download the flashable Zip
3-Reboot into recovery
4-Install Zip from SD card then choose Zip from SD card then choose
LagFree......Zip
5-reboot
6-Please Fix permissions to all Via Root-explorer
-Happy testing
Credits:
-Thanks to The Great Scripter In SGS and XDA Community:
*Pikachu01
*Zeppelinrox
*Juwe11
-A Big Thanks to broodplank1337 For Helping Me a lot!!!
-Thanks to ChainFire Too for the TouchScreen sensivity Valories
-thanks To Darkyy To For the Zipalign Script!!
-Any XDA Member That helps Me out in This Project

ChangeLogs of All Version
Changelog of All Version:
-V1:Initial release of lagFree For SGS
-V1.1:
-Rewritted Script,(Major Update)
-Fixed errors,repetetion
-Optimized
-Reduced script size from 38Kb to 10Kb
-Add LagFree recovery
-V1.2:
-Fixed Issue That Make th script stoping when there is an error
-Fixed More Errors
-Added more Build.prop Tweaks on the Script
-V1.3:
-Compatible With Supercharger V6 and thunderBolt(LMK addon only)Use atteched File Witch is compatible
-Deleted very agressive Parameter in the script
-V1.4:
-Fixed Error:sys/Block/stl* and sys/block/bml*
-adjusted Build.prop Tweaks For SGS and It variants
-V2:
-Major Update
-Version Compatible With SGS and All it variants including SGS+
-LagFree Now is a Package
-Including a Tweaked Version of SuperChargerV6
-Automatic Zipalign Fixed
-SD card readahead is 3072Kb
-TouchScreen sensivity is in a New Script
-Fixed All Errors
-V2.0.1:
-Deleted LagFree Recovery as It was Only an experimental Feature
-Balanced Low Memory Killer Parameter Valories
-Many others Smalls improvements For Speed and Battery life

Supported Devices:
Supported Devices are:
-Samsung Galaxy S GT-I9000
-Samsung Nexus S
-Samsung Captivate
-Samsung Vibrant
-Samsung Galaxy S 4G
-Samsung Infuse 4G
-Samsung Galaxy S Plus i9001
-Samsung Galaxy SL i9003
-Samsung fascinate

AWESOME bro!
I will try this soon. I guess it can conflict with other scripts (like v6 supercharger), right?

Will it work with Thunderbolt! and V6 Supercharger?
If it's ok i'll test, thanks!

So does 2.3.+ or higher mean it will work on 4.0+??

Same question as Trojan but only with Thunderbolts? I think not because you take some scripts to Thunderbolts but we never know ;o)
And if i can't use both, what does your script brings more than Thunderbolts?
Thanks for your work and answers ;o)

matthewgwilt said:
So does 2.3.+ or higher mean it will work on 4.0+??
Click to expand...
Click to collapse
Yes It Works With ICS you only need custom Kernel supporting Init.d Like Glitch ICY or Devil,Sock CM Kernel(not supporting it)

Will test it and post results

Tuga_Droid said:
Same question as Trojan but only with Thunderbolts? I think not because you take some scripts to Thunderbolts but we never know ;o)
And if i can't use both, what does your script brings more than Thunderbolts?
Thanks for your work and answers ;o)
Click to expand...
Click to collapse
I will Soon Make an alternative Version of the Kernel(Without RAM Management )Witch Make it Compatible With Supercharger and Thunder Bolt(Only LMK Add-on)

nice work
nice work mate. keep it up.

nasif619 said:
nice work mate. keep it up.
Click to expand...
Click to collapse
Thanks For the apreciation,it Helps Me A lot to Continue My Work!
A Big Think to you too for the 4.0.4 ROM !

How can I know whether it work or not?

Typo on line 214, it should read umount not unmount.
Syntax error on line 351

skymera said:
Typo on line 214, it should read umount not unmount.
Syntax error on line 351
Click to expand...
Click to collapse
what did you mean? I don't understand.

is this can be used on miui or cm7?

kettont said:
what did you mean? I don't understand.
Click to expand...
Click to collapse
Just reading the log output.
Code:
Starting FV Automatic ZipAlign 03-08-2012 00:47:41
--------------------------
Automatic ZipAlign finished at 03-08-2012 00:47:42
modprobe: module 'ipv6' not found
/sys/block/stl*: No such file or directory
/sys/block/bml*: No such file or directory
S95Lagfree[155]: cannot create /sys/block/mmcblk0/queue/iosched/low_latency: No such file or directory
S95Lagfree[155]: cannot create /sys/block/mmcblk0/queue/iosched/back_seek_penalty: No such file or directory
S95Lagfree[155]: cannot create /sys/block/mmcblk0/queue/iosched/back_seek_max: No such file or directory
S95Lagfree[155]: cannot create /sys/block/mmcblk0/queue/iosched/slice_idle: No such file or directory
S95Lagfree[155]: cannot create /sys/block/mmcblk0/queue/iosched/quantum: No such file or directory
S95Lagfree[155]: cannot create /sys/block/mmcblk0/queue/iosched/fifo_batch: No such file or directory
S95Lagfree[155]: cannot create /sys/block/mmcblk1/queue/iosched/low_latency: No such file or directory
S95Lagfree[155]: cannot create /sys/block/mmcblk1/queue/iosched/back_seek_penalty: No such file or directory
S95Lagfree[155]: cannot create /sys/block/mmcblk1/queue/iosched/back_seek_max: No such file or directory
S95Lagfree[155]: cannot create /sys/block/mmcblk1/queue/iosched/slice_idle: No such file or directory
S95Lagfree[155]: cannot create /sys/block/mmcblk1/queue/iosched/quantum: No such file or directory
S95Lagfree[155]: cannot create /sys/block/mmcblk1/queue/iosched/fifo_batch: No such file or directory
S95Lagfree[163]: cannot create /proc/sys/kernel/sched_latency_ns: No such file or directory
S95Lagfree[164]: cannot create /proc/sys/kernel/sched_wakeup_granularity_ns: No such file or directory
S95Lagfree[165]: cannot create /proc/sys/kernel/sched_min_granularity_ns: No such file or directory
SD card read ahead kb SET to 2049
SD card read ahead kb SET to 2049
mount: Device or resource busy
S95Lagfree[211]: cannot create /sys/kernel/debug/sched_features: Permission denied
S95Lagfree[212]: cannot create /sys/kernel/debug/sched_features: Permission denied
S95Lagfree[213]: cannot create /sys/kernel/debug/sched_features: Permission denied
S95Lagfree[214]: unmount: not found
SD card read ahead kb SET to 2049
SD card read ahead kb SET to 2049
SD card read ahead kb SET to 2049
SD card read ahead kb SET to 2049
SD card read ahead kb SET to 2049
SD card read ahead kb SET to 2049
SD card read ahead kb SET to 2049
SD card read ahead kb SET to 2049
-k: No such file or directory
S95Lagfree[351]: syntax error: '$i' unexpected

skymera said:
Just reading the log output.
Code:
Starting FV Automatic ZipAlign 03-08-2012 00:47:41
--------------------------
Automatic ZipAlign finished at 03-08-2012 00:47:42
modprobe: module 'ipv6' not found
/sys/block/stl*: No such file or directory
/sys/block/bml*: No such file or directory
S95Lagfree[155]: cannot create /sys/block/mmcblk0/queue/iosched/low_latency: No such file or directory
S95Lagfree[155]: cannot create /sys/block/mmcblk0/queue/iosched/back_seek_penalty: No such file or directory
S95Lagfree[155]: cannot create /sys/block/mmcblk0/queue/iosched/back_seek_max: No such file or directory
S95Lagfree[155]: cannot create /sys/block/mmcblk0/queue/iosched/slice_idle: No such file or directory
S95Lagfree[155]: cannot create /sys/block/mmcblk0/queue/iosched/quantum: No such file or directory
S95Lagfree[155]: cannot create /sys/block/mmcblk0/queue/iosched/fifo_batch: No such file or directory
S95Lagfree[155]: cannot create /sys/block/mmcblk1/queue/iosched/low_latency: No such file or directory
S95Lagfree[155]: cannot create /sys/block/mmcblk1/queue/iosched/back_seek_penalty: No such file or directory
S95Lagfree[155]: cannot create /sys/block/mmcblk1/queue/iosched/back_seek_max: No such file or directory
S95Lagfree[155]: cannot create /sys/block/mmcblk1/queue/iosched/slice_idle: No such file or directory
S95Lagfree[155]: cannot create /sys/block/mmcblk1/queue/iosched/quantum: No such file or directory
S95Lagfree[155]: cannot create /sys/block/mmcblk1/queue/iosched/fifo_batch: No such file or directory
S95Lagfree[163]: cannot create /proc/sys/kernel/sched_latency_ns: No such file or directory
S95Lagfree[164]: cannot create /proc/sys/kernel/sched_wakeup_granularity_ns: No such file or directory
S95Lagfree[165]: cannot create /proc/sys/kernel/sched_min_granularity_ns: No such file or directory
SD card read ahead kb SET to 2049
SD card read ahead kb SET to 2049
mount: Device or resource busy
S95Lagfree[211]: cannot create /sys/kernel/debug/sched_features: Permission denied
S95Lagfree[212]: cannot create /sys/kernel/debug/sched_features: Permission denied
S95Lagfree[213]: cannot create /sys/kernel/debug/sched_features: Permission denied
S95Lagfree[214]: unmount: not found
SD card read ahead kb SET to 2049
SD card read ahead kb SET to 2049
SD card read ahead kb SET to 2049
SD card read ahead kb SET to 2049
SD card read ahead kb SET to 2049
SD card read ahead kb SET to 2049
SD card read ahead kb SET to 2049
SD card read ahead kb SET to 2049
-k: No such file or directory
S95Lagfree[351]: syntax error: '$i' unexpected
Click to expand...
Click to collapse
thanks, but still don't get it. I just installed but I feel like nothing happen.

dude,
Code:
if [ -e /sys/devices/virtual/bdi/179:0/read_ahead_kb ]
then
/system/xbin/echo "4096" > /sys/devices/virtual/bdi/179:0/read_ahead_kb;
...
READ_AHEAD_KB="2049"
if [ -e /sys/devices/virtual/bdi/179:0/read_ahead_kb ]; then
echo $READ_AHEAD_KB > /sys/devices/virtual/bdi/179:0/read_ahead_kb
2 times:
Code:
for k in $(busybox mount | grep relatime | cut -d " " -f3) ; do
sync;
busybox mount -o remount,noatime $k;
done;
and rofl @
Code:
!/system/bin/sh
in line 387
to name a few.
2nd rofl to
Lagfree Is not Just a RAM Manager It a Complete Script With a lot of Tweaks and Iprovements
Click to expand...
Click to collapse
Yeah, it's not a manager, it is just a script.

Fr4gg0r said:
dude,
Code:
if [ -e /sys/devices/virtual/bdi/179:0/read_ahead_kb ]
then
/system/xbin/echo "4096" > /sys/devices/virtual/bdi/179:0/read_ahead_kb;
...
READ_AHEAD_KB="2049"
if [ -e /sys/devices/virtual/bdi/179:0/read_ahead_kb ]; then
echo $READ_AHEAD_KB > /sys/devices/virtual/bdi/179:0/read_ahead_kb
2 times:
Code:
for k in $(busybox mount | grep relatime | cut -d " " -f3) ; do
sync;
busybox mount -o remount,noatime $k;
done;
and rofl @
Code:
!/system/bin/sh
in line 387
to name a few.
2nd rofl to
Yeah, it's not a manager, it is just a script.
Click to expand...
Click to collapse
Sorry cause i'm stupid, but how can I know It work or not? I have everything you're mention above.

Related

init.d performance startup script

I've adapted the original performance tweaks by 'hardcore' @ XDA for my overclocked/undervolted Galaxy Tab. The tweaked values are pretty much the same as the ones recommended by the original poster, but my simple init.d/ script allows me to log default system values when pushing new values, which is useful for debugging. The script also contains comments to describe the role of each setting. Note that if you don't have init.d/ support in your kernel / initramfs, you can still run the script manually at each system start (use an app like GScript).
Code:
#!/system/bin/sh
#
# Original tweaks by 'hardcore' @ XDA
# http://forum.xda-developers.com/showthread.php?t=813309
# This is a startup script designed for /system/etc/init.d/.
# Note that "run-parts" support (for init.d/ scripts) is normally provided by custom a initramfs,
# which should bundle busybox in /sbin/. The /sbin/run-parts.sh script should take care of
# running init scripts (by calling /sbin/runparts), and it should subsequently trigger
# the device startup (using "setprop filesystem.ready 1", or similar).
# Note that the recovery mode typically doesn't run /system/etc/init.d/ startup scripts.
# Ensure /sbin/busybox takes precedence.
# Normally this is redundant, because the /init.rc startup script already sets the correct path.
export PATH=/sbin:$PATH
# Logging of old/new sysfs values, useful for double-checking.
logFile=/data/local/tmp/S_perf_tweaks.log
if [ -f $logFile ]
then
rm $logFile
fi
touch $logFile
# This function logs the old value and writes the new value.
echo_()
{
echo '' >> $logFile
echo -n "${2}${3} (${1}): " >> $logFile
#head -1 ${2}${3} >> $logFile
#read $firstLine < ${2}${3}
#echo -n $firstLine >> $logFile
contents=`echo -n $(cat ${2}${3})`
echo -n $contents >> $logFile
echo -n " ---> " >> $logFile
echo $1 > ${2}${3}
contents=`echo -n $(cat ${2}${3})`
echo -n $contents >> $logFile
}
# Note that the settings pushed by VoltageControl.apk
# could also be managed here (this only applies to kernels with clock/frequency tables and undervolt sysfs support):
#echo_ "50 50 50 25 25 25 25 " "/sys/devices/system/cpu/cpu0/cpufreq" "/UV_mV_table"
#echo_ 1400000 "/sys/devices/system/cpu/cpu0/cpufreq" "/scaling_max_freq"
echo "---------" >> $logFile
# Remount all partitions that use relatime with noatime and nodiratime instead.
# Note: atime generates a write-after-every-read, relatime is an optimized version of atime.
for k in $(mount | grep relatime | cut -d " " -f3)
do
echo "mount -o remount,noatime,nodiratime $k" >> $logFile
sync
mount -o remount,noatime $k
done
# Here is a sample test to measure read/write performance on rfs partitions:
### test for write: dd if=/dev/zero of=/data/test count=30000
### test for read: dd if=/data/test of=/dev/zero
echo "---------" >> $logFile
# Log the mount table
mount >> $logFile
echo "---------" >> $logFile
# Optimize the cfq/bfq I/O scheduler for flash memory (defaults are designed for spinning harddisks).
# Lower the idle wait, re-enable the low latency mode, remove the penalty for back-seeks,
# and explicitly tell the kernel that the storage is not a spinning disk.
for i in $(ls -1 /sys/block/stl*) $(ls -1 /sys/block/mmc*) $(ls -1 /sys/block/bml*) $(ls -1 -d /sys/block/tfsr*)
#for i in `ls /sys/block/stl* /sys/block/mmc* /sys/block/bml* /sys/block/tfsr*`;
do
# DEF noop anticipatory deadline cfq [bfq]
echo_ "bfq" $i "/queue/scheduler"
# DEF 1 ?
echo_ "0" $i "/queue/rotational"
# DEF 1 ?
echo_ "1" $i "/queue/iosched/low_latency"
# DEF 2 ?
echo_ "1" $i "/queue/iosched/back_seek_penalty"
# DEF 16384 ?
echo_ "1000000000" $i "/queue/iosched/back_seek_max"
# DEF 6 ?
echo_ "3" $i "/queue/iosched/slice_idle"
sync
done
# Set tendency of kernel to swap to minimum, since swap isn't used anyway.
# (swap = move portions of RAM data to disk partition or file, to free-up RAM)
# (a value of 0 means "do not swap unless out of free RAM", a value of 100 means "swap whenever possible")
# (the default is 60 which is okay for normal Linux installations)
# DEF 60
echo_ "0" "/proc/sys/vm" "/swappiness"
# Lower the amount of unwritten write cache to reduce lags when a huge write is required.
# DEF 20
echo_ "10" "/proc/sys/vm" "/dirty_ratio"
# Increase minimum free memory, in theory this should make the kernel less likely to suddenly run out of memory.
# DEF 3102
echo_ "4096" "/proc/sys/vm" "/min_free_kbytes"
# Increase tendency of kernel to keep block-cache to help with slower RFS filesystem.
# DEF 100
echo_ "1000" "/proc/sys/vm" "/vfs_cache_pressure"
# Increase the write flush timeouts to save some battery life.
# DEF 250
echo_ "2000" "/proc/sys/vm" "/dirty_writeback_centisecs"
# DEF 200
echo_ "1000" "/proc/sys/vm" "/dirty_expire_centisecs"
# Make the task scheduler more 'fair' when multiple tasks are running,
# which improves user-interface and application responsiveness.
# DEF 10000000
echo_ "20000000" "/proc/sys/kernel" "/sched_latency_ns"
# DEF 2000000
echo_ "2000000" "/proc/sys/kernel" "/sched_wakeup_granularity_ns"
# DEF 1000000
echo_ "1000000" "/proc/sys/kernel" "/sched_min_granularity_ns"
sync
# Miscellaneous tweaks
setprop dalvik.vm.startheapsize 8m
#setprop wifi.supplicant_scan_interval 90
echo '' >> $logFile
echo "---------" >> $logFile
#This apply a tweaked deadline scheduler to all RFS (and ext2/3/4, if existent) partitions.
#for i in /sys/block/*
#do
# DEF noop anticipatory deadline cfq [bfq]
#echo deadline > $i/queue/scheduler
#echo 4 > $i/queue/iosched/writes_starved
#echo 1 > $i/queue/iosched/fifo_batch
#echo 256 > $i/queue/nr_requests
#done
Thanks for this Daniel - since I know absolutely nothing about anything Android, all I can say is that I have 2 questions
1 - Would this script be any benefit to someone running a custom ROM (Overcome 1.1.3 in my case) and a custom kernel (Richard Trip's 1.4gHz EXT4)? I ask because I don't know if these guys have already including these tweaks or not... but maybe I should ask them instead...
2 - Is there any way you could put that script - in its most efficient, non-debugging form - in to a script file that us speed-freaks can just toss in to init.d and reboot?
Please do forgive me for any newbishness I have displayed here.
So should I put this script in /system/etc/init.d/ ?
UPDATE: Ok, I've done the script(without extension at the back of the file name) and put it in ~/init.d/, it runs well. I comment out the remount and logging function tho Tested it on some games that required load time like gangstar which lags alot previously, now just dnt have any lag time in it! Thanks!
Anyway, im running Overcome rom with richard's kernel, other than voltage script, i saw 2 more script that does the following:
10fixsh does:
"#!/system/bin/sh
busybox mount -o remount,rw /
find /sbin -maxdepth 1 -type l -exec rm {} \;
busybox mount -o remount,ro /
"
99done does:
"#!/system/bin/sh
sync;
setprop mcr.filesystem.ready 1;
"
So I just add your script as userinit since they do not have conflicting calls
Personally thinks that similar tweaks should be included in custom kernels so that those who wish to do more extreme settings can go with it while those who just wants increased performance as it is can still have the boost provided by such init script.
fastcx said:
Personally thinks that similar tweaks should be included in custom kernels so that those who wish to do more extreme settings can go with it while those who just wants increased performance as it is can still have the boost provided by such init script.
Click to expand...
Click to collapse
so basically just copy and paste the whole "code" in the first post, and create it as userinit.sh and put the userinit.sh file in /system/etc/init.d ?
am i right?
kay_kiat88 said:
so basically just copy and paste the whole "code" in the first post, and create it as userinit.sh and put the userinit.sh file in /system/etc/init.d ?
am i right?
Click to expand...
Click to collapse
still need more time to test, after some verification, none of the "/proc/sys/kernel" setting works with any of the kernel i'm using. thats y i need more time to rectify..
used richard's kernel and overcome kernel, both dont do anything now..perhaps wrong command in the script? Cause run-parts.sh does specify where to run script, and init.d does have 2 script in there that runs. So i'll need more time to make sure it works now..
Dont need to have .sh as extension, just a name for your script like the other 2 script that i posted in previous reply. And I did not copy the whole script to run, as the script seems questionable in some part..
fastcx said:
still need more time to test, after some verification, none of the "/proc/sys/kernel" setting works with any of the kernel i'm using. thats y i need more time to rectify..
used richard's kernel and overcome kernel, both dont do anything now..perhaps wrong command in the script? Cause run-parts.sh does specify where to run script, and init.d does have 2 script in there that runs. So i'll need more time to make sure it works now..
Dont need to have .sh as extension, just a name for your script like the other 2 script that i posted in previous reply. And I did not copy the whole script to run, as the script seems questionable in some part..
Click to expand...
Click to collapse
okay.. so basically just copy everything under the "code" and create it as userinit?
edit: hmmm okay thanks for you help. i don't think it's of any use for me now as my tab is quite fast and i don't do any intensive stuff on it. thanks anyway!
kay_kiat88 said:
okay.. so basically just copy everything under the "code" and create it as userinit?
edit: hmmm okay thanks for you help. i don't think it's of any use for me now as my tab is quite fast and i don't do any intensive stuff on it. thanks anyway!
Click to expand...
Click to collapse
Now i'm editing init.rc file instead, but it's not the safest thing to do
Wow all the best.. lol.
Sent from my GT-P1000 using Tapatalk
fastcx said:
Now i'm editing init.rc file instead, but it's not the safest thing to do
Click to expand...
Click to collapse
The init.rc file gets extracted from the initramfs ramdisc (packaged inside the zImage kernel) at each device startup. Changing this file's content is not a good idea. Regards, Dan
fastcx said:
So should I put this script in /system/etc/init.d/ ?
UPDATE: Ok, I've done the script(without extension at the back of the file name) and put it in ~/init.d/, it runs well.
Click to expand...
Click to collapse
Yes, the filename of the startup script must start with "S_" and must not end with ".sh". This is standard Linux stuff.
fastcx said:
find /sbin -maxdepth 1 -type l -exec rm {}
Click to expand...
Click to collapse
Removing the symlinks from "/sbin/" ... why ?
Normally Busybox should be installed properly in "/sbin/" by your kernel provider, you shouldn't have to touch this folder.
fastcx said:
99done does:
"#!/system/bin/sh
sync;
setprop mcr.filesystem.ready 1;
"
Click to expand...
Click to collapse
The "mcr.filesystem.ready" is only relevant if the "init.rc" file in the kernel zImage's initramfs ramdisc responds to a change to the "mcr.filesystem.ready" property (for example, when its value changes from 0 to 1). This is typically used to start the device normally, after *all* of the "/system/etc/init.d/" startup scripts have been executed.
The line of code "setprop mcr.filesystem.ready 1" is therefore typically included in "/sbin/runparts.sh", not in one of the "S_startup_scripts" (as this may trigger the device normal startup prematurely).
It really depends on your kernel, so it should be documented by your kernel provider.
daniel.weck said:
Yes, the filename of the startup script must start with "S_" and must not end with ".sh". This is standard Linux stuff.
It really depends on your kernel, so it should be documented by your kernel provider.
Click to expand...
Click to collapse
Great! thanks for clarifying! Sadly none of the kernel provider states any info on such matter. Will try your script again, as previously running thru gscript not all command works..
Copied your script 100%, put it in init.d with chmod 755, named it S_userinit, doesnt run..i double checked by cat value that I stated to change in the script.
Help? It obviously runs the UV script in init.d tho.
EDIT: Got it to work by editing the UV script, now settings are in! Great! Time to test anyway, nodiratime is not needed, noatime already has it
So how can I use this script - I want to
Hi, Just connected to my galaxy tab running froyo, and went looking in my filesystem for the init.d folder and yeah there isn't one
do i create one? where? and what permissions?
I try to keep this brief and not waste too much of your time.
many thanks for the script
Ttime & effort ++
andytof46 said:
Hi, Just connected to my galaxy tab running froyo, and went looking in my filesystem for the init.d folder and yeah there isn't one
do i create one? where? and what permissions?
I try to keep this brief and not waste too much of your time.
many thanks for the script
Ttime & effort ++
Click to expand...
Click to collapse
you will need a kernel that support init script, after that, /etc/init.d(or /system/etc/init.d) will be created
fastcx said:
Copied your script 100%, put it in init.d with chmod 755, named it S_userinit, doesnt run..i double checked by cat value that I stated to change in the script.
Help? It obviously runs the UV script in init.d tho.
EDIT: Got it to work by editing the UV script, now settings are in! Great! Time to test anyway, nodiratime is not needed, noatime already has it
Click to expand...
Click to collapse
Don't suppose you could post a copy of your trimmed & tweaked version of Daniel's script for us to use?
Cuz I, for example, have no idea what's useful in the original script, and what's not useful. But I at least know how to edit the UV script, heh.
jeebspawnshop said:
Don't suppose you could post a copy of your trimmed & tweaked version of Daniel's script for us to use?
Cuz I, for example, have no idea what's useful in the original script, and what's not useful. But I at least know how to edit the UV script, heh.
Click to expand...
Click to collapse
LOL here it goes
Code:
#!/system/bin/sh
#set UV
echo "0 0 0 0 0 0 0 0 " > /sys/devices/system/cpu/cpu0/cpufreq/UV_mV_table
echo 1000000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
#select enabled states
echo "0 0 0 0 0 0 0 0 " > /sys/devices/system/cpu/cpu0/cpufreq/states_enabled_table
#set scheduler for stl, bml and mmc
for i in `ls /sys/block/stl*` /sys/block/bml* /sys/block/mmcblk*
do
echo "bfq" > $i/queue/scheduler
echo "0" > $i/queue/rotational
echo "1" > $i/queue/iosched/low_latency
echo "1" > $i/queue/iosched/back_seek_penalty
echo "1000000000" > $i/queue/iosched/back_seek_max
echo "3" > $i/queue/iosched/slice_idle
done
# Remount all partitions with noatime
for k in $(busybox mount | grep relatime | cut -d " " -f3)
do
sync
busybox mount -o remount,noatime $k
done
# Tweak kernel VM management
echo "0" > /proc/sys/vm/swappiness
echo "10" > /proc/sys/vm/dirty_ratio
echo "4096" > /proc/sys/vm/min_free_kbytes
# Tweak kernel scheduler, less aggressive settings
echo "18000000" > /proc/sys/kernel/sched_latency_ns
echo "3000000" > /proc/sys/kernel/sched_wakeup_granularity_ns
echo "1500000" > /proc/sys/kernel/sched_min_granularity_ns
# Misc tweaks for battery life
echo "2000" > /proc/sys/vm/dirty_writeback_centisecs
echo "1000" > /proc/sys/vm/dirty_expire_centisecs
# Miscellaneous tweaks
setprop dalvik.vm.startheapsize 8m
done
NOTE: If you change any settings in uv app, u'll revert S_volt_scheduler to ONLY UV settings, so It's recommended to edit your UV setting on this file instead of using uv app from now on if you wants to keep your other settings
Thanks dude!
I hit your Thanks Button too.
jeebspawnshop said:
Thanks dude!
I hit your Thanks Button too.
Click to expand...
Click to collapse
Thanks U should thanks the thread starter too U should just take it as reference, modify any that you feels ok, and perhaps post here as feedback on which makes things better, especially disc scheduler and task scheduler settings.
UPDATE: Made some changes to suggested value by daniel for "fairness", these setting really deals with multitasking better
echo "20000000" > /proc/sys/kernel/sched_latency_ns
echo "2000000" > /proc/sys/kernel/sched_wakeup_granularity_ns
echo "1000000" > /proc/sys/kernel/sched_min_granularity_ns
hey fastcx, i copied and pasted your script in the UV scheduler file in init.d but it seems that it's not working as the values don't apply. any ideas why?

[Tweak] Boost RAM Management - get more free RAM! // [23.03.2011] Fixed Permissions.

Memory Tweak - get more free RAM to use for apps and less lag.
// This was first intended for other ROM chefs, so they can include this tweak in their ROMs. I'm aware that there are apps which can do this. But it's the idea to have it included automatically, so you don't have to annoy your users
However, this is also for normal users. Those just flash the CWM Package thunderteaser made here. Thanks for this.
I made a script which boosts the RAM Management significantly.
You can use this in any ROM - those values have been created from my mind and were being tested for several days in heavy use.
IMHO, it's the perfect combination of RAM Management.
HOW TO IMPLEMENT IT INTO YOUR ROM
Just make a new bash script and place the following code into it.
NOTE: bash files created on Windows don't work. Create them with a UNIX like Linux (Ubuntu, Fedora, whatever) or Mac OS X.
Place the script in /system/etc/init.d so it gets automatically executed at every startup. You have to make this because init.rc (in root dir /) gets executed first and will also set the RAM Management (minfree) on his own.
UPDATE - 20.03.2011
Supercurio said, there is support for init.d in his Voodoo injected kernel for JV1 Gingerbread.
This means, the script is fully working and the Gingerbread JV1 memory leaks are fixed when using those values.
This also means, my current ROM v10.0 Beta 3 already has the Memory Hack integrated.
Code:
#!/system/bin/sh
# DarkyROM 2011 - Joël Staub (darkyy)
# This will stabilize the memory leaks in Gingerbread and other ROMs.
# Adjusting Memory Settings
# The values in MB: 10, 16, 24, 68, 76, 92
if [ -e /sys/module/lowmemorykiller/parameters/minfree ]; then
echo "Modifying minfree parameters"
echo "2560,4096,6144,17408,19456,23552" > /sys/module/lowmemorykiller/parameters/minfree
else
echo "minfree not found"
fi
Permissions
You may want to adjust the permissions of the script when it's on your phone.
You can do it with ADB.
First, connect to your phone.
Code:
adb shell
Get root access.
Code:
su
Set the permissions.
Code:
chmod 777 /system/etc/init.d/ramtweak
Code:
chown root:root /system/etc/init.d/ramtweak
When you're a ROM chef, you can include those permissions either with update(r)-script or with a bash file.
Thanks to zacharias.maladroit for the hint with the permissions.
- darkyy.
Darkyy said:
Ignore the # You're not allowed to use this script without giving proper credits. - EVERYONE IS WELCOME TO IMPLEMENT THIS INTO HIS / HER ROM - I don't need credits.
Click to expand...
Click to collapse
If you don't mean it, take it out
Ok this looks awesome but for the most part of the members can u make a proper tutorial ? I really don't understand how to implement your hack, how to create a bash script init.d ?
sorry for my noobiness
And when you say in every ROM, did you also mean every custom kernel ?
chambo622 said:
If you don't mean it, take it out
Click to expand...
Click to collapse
I will, sorry for this crap
I'm a bit too tired...
touness69 said:
Ok this looks awesome but for the most part of the members can u make a proper tutorial ? I really don't understand how to implement your hack, how to create a bash script init.d ?
sorry for my noobiness
And when you say in every ROM, did you also mean every custom kernel ?
Click to expand...
Click to collapse
You just make a new file on your COMPUTER.
Or it would even work on your SGS (but I'm writing now for the Computer).
Example:
Let's say, you're on Windows - create a NEW text file and remove the .txt extension (you need to have this option activated in the explorer settings).
You can leave it to no extension or just make it end on .sh
You got a file called randomname.sh now.
Now to make it easy, just copy this file to the C: drive in NO subfolder.
Now just ADB push this file to your SGS into:
Code:
adb push /randomname.sh /system/etc/init.d
Or just copy the .sh file to your SGS via USB Storage mount and copy it to the directory with Root Explorer or Super Manager.
Yes, this should work with every kernel (Android 2.2.1) here.
Thanks for doing this testing to find good settings. Forgive me if I'm misinformed, but is there anything particularly innovative about new minfree settings? I do appreciate your testing and finding ones that work well for you.
have a good rest, Darkyy !
thanks for this script
so you noticed improved interactivity with "apps and less lag" ?
gotta try this with CM7
FYI:
the defaults of the CM7 kernel are:
Code:
cat /sys/module/lowmemorykiller/parameters/minfree
2048,3072,4096,6144,7168,8192
edit2:
make sure that you get the right permissions for the file on the phone afterwards
say:
Code:
chmod 750 /system/etc/init.d/99rambooster
chown root:shell /system/etc/init.d/99rambooster
thanks for explanation ! I have done what you say and rebooted my phone after that. I renamed the file to init.d after placing it into the /system/etc/ directory and setted the défault permissions for this file rwxrwxrwx (or something like that)
But how I find if I have the hack succesfuly installed ?
chambo622 said:
Thanks for doing this testing to find good settings. Forgive me if I'm misinformed, but is there anything particularly innovative about new minfree settings? I do appreciate your testing and finding ones that work well for you.
Click to expand...
Click to collapse
Not innovative - this is nothing new.
It's just that many ROM devs aren't aware of this and I thought I could share my script.
zacharias.maladroit said:
have a good rest, Darkyy !
thanks for this script
so you noticed improved interactivity with "apps and less lag" ?
gotta try this with CM7
FYI:
the defaults of the CM7 kernel are:
Code:
cat /sys/module/lowmemorykiller/parameters/minfree
2048,3072,4096,6144,7168,8192
edit2:
make sure that you get the right permissions for the file on the phone afterwards
say:
Code:
chmod 750 /system/etc/init.d/99rambooster
chown root:shell /system/etc/init.d/99rambooster
Click to expand...
Click to collapse
Strange permissions...
This would be rwx r-x --- [Owner, Group, Other]
EDIT:
Ouch, CM7 really has 2048,3072,4096,6144,7168,8192?
That's really not the best value... looks close like JV1 RAM Management at first glance...
I'm gonna check that later.
Darkyy said:
Not innovative - this is nothing new.
It's just that many ROM devs aren't aware of this and I thought I could share my script.
Strange permissions...
This would be rwx r-x --- [Owner, Group, Other]
EDIT:
Ouch, CM7 really has 2048,3072,4096,6144,7168,8192?
That's really not the best value... looks close like JV1 RAM Management at first glance...
I'm gonna check that later.
Click to expand...
Click to collapse
yes,
and those are really the permissions
ls -l
-rwxr-x--- 1 root shell 365 Aug 1 2008 00banner
-rwxr-x--- 1 root shell 27 Aug 1 2008 01sysctl
-rwxr-x--- 1 root shell 229 Aug 1 2008 03firstboot
-rwxr-x--- 1 root shell 201 Aug 1 2008 04modules
-rwxr-x--- 1 root shell 1452 Aug 1 2008 05mountsd
-rwxr-x--- 1 root shell 272 Aug 1 2008 06mountdl
-rwxr-x--- 1 root shell 925 Aug 1 2008 20userinit
-rwxr-x--- 1 root shell 2533 Mar 19 02:20 89system_tweak
-rwxr-x--- 1 root shell 2848 Aug 1 2008 90screenstate_scaling
Click to expand...
Click to collapse
good thing you came up with these improved values,
I'm gonna include these in the next revision of my script / kernel
thanks again
Thanks Darkyy! Once again, you kicketh ass!
I am gonna give this a try.
Nice, some info on min free settings:
http://www.androidcentral.com/fine-tuning-minfree-settings-improving-androids-multi-tasking
while we're at it:
you could include lots of stuff from the
tweak script for the Galaxy Spica
in your next revision of ROM
I'm using some of those
and planning to continually add more after having tested them
DocRambone said:
Nice, some info on min free settings:
http://www.androidcentral.com/fine-tuning-minfree-settings-improving-androids-multi-tasking
Click to expand...
Click to collapse
Thanks Doc, will add it tomorrow in the OP.
zacharias.maladroit said:
while we're at it:
you could include lots of stuff from the
tweak script for the Galaxy Spica
in your next revision of ROM
I'm using some of those
and planning to continually add more after having tested them
Click to expand...
Click to collapse
Nice, but most things are specially for the low-end device Spica.
I'll sure look into it
Thank you
Gah this is such a retarded suggestion. Darky your SGS ROM is really nice and I'm currently running it, but please think about things like this before you post them.
The SGS has, comparatively, RAM out the wazoo. Why do we want more of it sitting idle and unused? RAM is there to be used, not sit there looking unused and pretty like a virgin at an eastern european slave auction in a free -m command. Twatting about with this setting on behalf of the Android Low Memory Killer is essentially like telling the ROM you have less RAM than you actually do since it will always endeavour to keep that much RAM -free- as in -unused- by the GUI itself as well as Android apps.
Darkyy said:
Memory Tweak - get more free RAM to use for apps and less lag.
I made a script which boosts the RAM Management significantly.
You can use this in any ROM - those values have been created from my mind and were being tested for several days in heavy use.
IMHO, it's the perfect combination of RAM Management.
HOW TO IMPLEMENT IT INTO YOUR ROM
Just make a new bash script and place the following code into it.
Place the script in /system/etc/init.d so it gets automatically executed at every startup. You have to make this because init.rc (in root dir /) gets executed first and will also set the RAM Management (minfree) on his own.
This doesn't work on JV1 now because we don't have the kernel sources to implement init.d support.
Code:
#!/system/bin/sh
# DarkyROM 2011 - Joël Staub (darkyy)
# This will stabilize the memory leaks in Gingerbread and other ROMs.
# Adjusting Memory Settings
# Old Hack (you can ignore this, it's just another method of doing it)
#if [ -e /sdcard/darky_tweak/init.rc ]; then
# echo "Copying init.rc to /"
# cp /sdcard/darky_tweak/init.rc /
# else
# echo "No init.rc found"
#fi
# New Method [15.03.2011]
if [ -e /sys/module/lowmemorykiller/parameters/minfree ]; then
echo "Modifying minfree parameters"
echo "2560,4096,6144,17408,19456,23552" > /sys/module/lowmemorykiller/parameters/minfree
else
echo "minfree not found"
fi
- darkyy.
Click to expand...
Click to collapse
How to do it. any video to show us. ??
touness69 said:
thanks for explanation ! I have done what you say and rebooted my phone after that. I renamed the file to init.d after placing it into the /system/etc/ directory and setted the défault permissions for this file rwxrwxrwx (or something like that)
But how I find if I have the hack succesfuly installed ?
Click to expand...
Click to collapse
He said to place it inside init.d not call it init.d. Are you honestly this illiterate?
shaldi said:
How to do it. any video to show us. ??
Click to expand...
Click to collapse
How to create a text file and place it where he says to place it? Are you honestly this illiterate?
Darkyy said:
You just make a new file on your COMPUTER.
Or it would even work on your SGS (but I'm writing now for the Computer).
Example:
Let's say, you're on Windows - create a NEW text file and remove the .txt extension (you need to have this option activated in the explorer settings).
You can leave it to no extension or just make it end on .sh
You got a file called randomname.sh now.
Now to make it easy, just copy this file to the C: drive in NO subfolder.
Now just ADB push this file to your SGS into:
Code:
adb push /randomname.sh /system/etc/init.d
Or just copy the .sh file to your SGS via USB Storage mount and copy it to the directory with Root Explorer or Super Manager.
Yes, this should work with every kernel (Android 2.2.1) here.
Click to expand...
Click to collapse
Darkyy, so I just copy the codes, paste in notepad then save as [anygivenname.sh] then paste into system/ect/init.d using root explorer and reboot my galaxy s?
Darky is this included in your rom? if not is it going to be?
bernard134 said:
Darkyy, so I just copy the codes, paste in notepad then save as [anygivenname.sh] then paste into system/ect/init.d using root explorer and reboot my galaxy s?
Click to expand...
Click to collapse
guys
seriously: read what comes after the 1st ,2nd and 3rd post - or the first 1-3 (or 5 sites) if it's a larger topic
you'll see that you need to change the permissions & owner
you do that via logging in via adb, becoming root (su)
and navigating to /system/etc/init.d/
or do it explicitly from the folder where you are - like I posted
0) prepare file on windows / linux / mac
Code:
#!/system/bin/sh
# DarkyROM 2011 - Joël Staub (darkyy)
# This will stabilize the memory leaks in Gingerbread and other ROMs.
# Adjusting Memory Settings
# Old Hack (you can ignore this, it's just another method of doing it)
#if [ -e /sdcard/darky_tweak/init.rc ]; then
# echo "Copying init.rc to /"
# cp /sdcard/darky_tweak/init.rc /
# else
# echo "No init.rc found"
#fi
# New Method [15.03.2011]
if [ -e /sys/module/lowmemorykiller/parameters/minfree ]; then
echo "Modifying minfree parameters"
echo "2560,4096,6144,17408,19456,23552" > /sys/module/lowmemorykiller/parameters/minfree
else
echo "minfree not found"
fi
e.g. save as:
99rambooster
1) dl & install Android SDK
http://www.talkandroid.com/android-sdk-install-guide/
2) connect phone
navigate to tools folder (or from Linux: launch from terminal via command)
3) put it on the phone
Code:
adb push 99rambooster /sdcard/
4) log in to phone & become root
Code:
adb shell
(now in phone)
Code:
su
5) copy it to init.d folder [you eventually need to remount /system rw]
Code:
cp /sdcard/99rambooster /system/etc/init.d/
6) adjust permissions:
Code:
chmod 750 /system/etc/init.d/99rambooster
chown root:shell /system/etc/init.d/99rambooster

[INSTALLER]Universal NativeSD installer for all roms v0.1

Hey guys people here have constant troubles flashing mods to NativeSD roms as they can't be flashed the normal way like gapps,etc
I intend to provide people a solution to patch their roms with the mods of their choice.
Also chefs cooking/porting roms can use this to patch their roms while debugging
Also people willing to contribute mods circulating XDA can also put them up here in the thread
How it works:
This is Aroma based installer based on tytung's NexusHD2 JB 1.0
This is a zip file so people have to first extract it,place the respective mod files/apps in the system folder zip it again and flash
Devs/Chefs working on roms can also place the patches to be made in the system folder.also the original files can be placed in the system-original folder so that patches can be reverted to see what works and what not
Most importantly don't forget to change the ROM_NAME to the nativesd name of the rom you wish to flash in the mount_nativesd.sh file with the help of any text editor(If using your android device,it can be done using jota text editor set to linefinder)
v0.1(Modified by wwchang originally for JellyBelly rom)
DOWNLOAD
MODs by me
Acid Audio Engine Version 5
DOWNLOAD
After flashing this add these lines to build.prop
HTML:
#Sony Xloud & Clearbass +
ro.semc.sound_effects_enabled=true
ro.semc.xloud.supported=true
persist.service.xloud.enable=1
ro.semc.enhance.supported=true
persist.service.enhance.enable=1
ro.semc.clearaudio.supported=true
persist.service.clearaudio.enable=1
ro.sony.walkman.logger=1
ro.somc.clearphase.supported=true
persist.service.clearphase.enable=1
#Resampling
af.resampler.quality=255
persist.af.resampler.quality=255
#Beats Engine
htc.audio.swalt.enable=1
htc.audio.swalt.mingain=14512
Native 720p mod for any of the existing JB roms out there
DOWNLOAD
Reserved#2
Anurag pandey said:
Most importantly don't forget to change the ROM_NAME to the nativesd name of the rom you wish to flash in the mount_nativesd.sh file with the help of any text editor(If using your android device,it can be done using jota text editor set to linefinder)
Click to expand...
Click to collapse
There are a few of these installers floating about (with a few made by myself); the last one I had extracted the rom name from the initrd.gz in /sdcard/NativeSD, thus removing the need for the above, if I can find it feel free to modify the installer, it should cut down on some of the work for end users (and make 1 zip usable with multiple ROMs without further modification)
Edit. Changing Mount_NativeSD.sh to:
Code:
#!/sbin/sh
mmcblk0p2=`ls /dev/block/mmcblk0p2`
# Mount the ext4 partition
if [ $mmcblk0p2 == "/dev/block/mmcblk0p2" ]
then
mkdir -p /ext4p
mount -t ext4 /dev/block/mmcblk0p2 /ext4p
cp /ext4p/NativeSD/initrd.gz /tmp/initrd.gz
mkdir /tmp/ramd
cd /tmp/ramd
gzip -d -c ../initrd.gz | cpio -i -d
if [-a "init.android"]
then
sed -n '/rom_name=/w romname.txt' /tmp/ramd/init
sed -i 's/rom_name=//' romname.txt
else
sed -n '/--bind/,/system/w initrc.txt' init.rc
sed -n '1w romname.txt' initrc.txt
sed -i 's,exec /bin/busybox mount --bind /NativeSD/,,
s,/system /system,,
s/ *//g' romname.txt
fi
export ROM_NAME=`cat romname.txt`
mount --bind /ext4p/$ROM_NAME/system /system
mount --bind /ext4p/$ROM_NAME/data /data
#the sd-ext directories are ready, so flag the updater-script
echo "NativeSD=true" >> /tmp/nfo.prop
else
#no ext4 partition found
echo "NativeSD=false" >> /tmp/nfo.prop
fi
should do it, you may want to run your eye through it first.
Good work anuraj as always...
@Hypoturtle... i saw this script on Sportstar too, but I havent tried it... Seems quite interesting but afraid to try (as hd2 is my primary and only phone...) Dont understand much of these code but, is there any way the script uncomment or remove the following lines in init.rc or init.htcleo.rc?
mount yaffs2 [email protected] /system noatime nodiratime
mount yaffs2 [email protected] /data nosuid nodev noatime nodiratime
mount yaffs2 [email protected] /mnt/cache nosuid nodev
Sorry I'm still learning, and dont have unserstand any language C,C++ or Java...
macs18max said:
Good work anuraj as always...
@Hypoturtle... i saw this script on Sportstar too, but I havent tried it... Seems quite interesting but afraid to try (as hd2 is my primary and only phone...) Dont understand much of these code but, is there any way the script uncomment or remove the following lines in init.rc or init.htcleo.rc?
mount yaffs2 [email protected] /system noatime nodiratime
mount yaffs2 [email protected] /data nosuid nodev noatime nodiratime
mount yaffs2 [email protected] /mnt/cache nosuid nodev
Sorry I'm still learning, and dont have unserstand any language C,C++ or Java...
Click to expand...
Click to collapse
This script is different to whats on Sportstar's thread (I think, not sure what your referencing)
All that code does is take the ROM_NAME from the currently used ROM and set it as the ROM for the update to be applied to.
If you want to check if it works then just add a text file into the system folder and see if it installs into the currently running ROM.
The patcher (look at sig.) does the commenting of yaffs in init.rc (as well as other stuff to turn a NAND ramdisk into a NativeSD one).
sense 3.5 kernel
who can help(assist) me to make a sense 3.5 kernel nativeSD able?
pixelfreak
-pixelfreak- said:
who can help(assist) me to make a sense 3.5 kernel nativeSD able?
pixelfreak
Click to expand...
Click to collapse
Try hypoturtle's patcher On linux
http://forum.xda-developers.com/showthread.php?t=1953428
Sent from my NexusHD2 using xda premium
re
Anurag pandey said:
Try hypoturtle's patcher On linux
http://forum.xda-developers.com/showthread.php?t=1953428
Sent from my NexusHD2 using xda premium
Click to expand...
Click to collapse
many thanks this is not whas i mean. in the kernel must change the init.rc file with script for nativeSD. and this must change in my sense 3.5 kernel thats work sense 3.5 with nativeSD
i am not a linux coder i work with windows. thats work must make a profesionel coder for kernel "tytung or other user"
pixelfreak
Anurag pandey said:
MODs by me
Acid Audio Engine Version 5
DOWNLOAD
After flashing this add these lines to build.prop
HTML:
#Sony Xloud & Clearbass +
ro.semc.sound_effects_enabled=true
ro.semc.xloud.supported=true
persist.service.xloud.enable=1
ro.semc.enhance.supported=true
persist.service.enhance.enable=1
ro.semc.clearaudio.supported=true
persist.service.clearaudio.enable=1
ro.sony.walkman.logger=1
ro.somc.clearphase.supported=true
persist.service.clearphase.enable=1
#Resampling
af.resampler.quality=255
persist.af.resampler.quality=255
#Beats Engine
htc.audio.swalt.enable=1
htc.audio.swalt.mingain=14512
Click to expand...
Click to collapse
Thanks for your mods. I downloaded the file Acid audio engine for jellybelly.zip. How do I flash it to the Jellybelly NativeSD ROM?
Can I use 4EXT Recovery for the same?
Well I had some people reporting that NativeSd Gapps installer that i put together using script from HypoTurtle is not working on PAC rom.
So I checked it and it seems that PAC has somewhat different was of mounting, rom name is located in mounts.sh script.
Anyway I've updated it, and now it should also work on such ROMs.
Code:
#!/sbin/sh
mmcblk0p2=`ls /dev/block/mmcblk0p2`
# Mount the ext4 partition
if [ $mmcblk0p2 == "/dev/block/mmcblk0p2" ]
then
mkdir -p /ext4p
mount -t ext4 /dev/block/mmcblk0p2 /ext4p
cp /ext4p/NativeSD/initrd.gz /tmp/initrd.gz
mkdir /tmp/ramd
cd /tmp/ramd
gzip -d -c ../initrd.gz | cpio -i -d
#!/bin/sh
if [ -a "init.android" ]
then
sed -n '/rom_name=/w romname.txt' /tmp/ramd/init
sed -i 's/rom_name=//' romname.txt
else
if [ -f "mountfs.sh" ]
then
sed -n '/rom_name=/w mount.txt' mountfs.sh
sed -n '1w romname.txt' mount.txt
sed -i 's/rom_name="//' romname.txt
sed -i 's/"//' romname.txt
else
sed -n '/--bind/,/system/w initrc.txt' init.rc
sed -n '1w romname.txt' initrc.txt
sed -i 's,exec /bin/busybox mount --bind /NativeSD/,,
s,/system /system,,
s/ *//g' romname.txt
sed -i 's/[[:blank:]]//g' romname.txt
fi
fi
export ROM_NAME=`cat romname.txt`
mount --bind /ext4p/$ROM_NAME/system /system
mount --bind /ext4p/$ROM_NAME/data /data
#the sd-ext directories are ready, so flag the updater-script
echo "NativeSD=true" >> /tmp/nfo.prop
else
#no ext4 partition found
echo "NativeSD=false" >> /tmp/nfo.prop
fi
how can i flash another kernel to a native sd rom?
firebird11 said:
how can i flash another kernel to a native sd rom?
Click to expand...
Click to collapse
For now download tytungs jb kernel and replace his kernel files with the kernel u want to install.
I guess tytungs jb kernel is based on aroma installer for nativesd
Sent from my LG-P990 using xda premium
Anurag pandey said:
For now download tytungs jb kernel and replace his kernel files with the kernel u want to install.
I guess tytungs jb kernel is based on aroma installer for nativesd
Sent from my LG-P990 using xda premium
Click to expand...
Click to collapse
thank you but tytungs kernel doesn't have aroma installer,,
i'll change the files in the rom before flashing
Link is down.
Hello,
I know this thread is quite old but I tried to download the Universar NativeSD installer to install a mod into my current NativeSD rom, but the link is down. Where can I get the installer? Is there another way to do what I'm trying?
Thanks.
Regards,
pepemonje said:
Hello,
I know this thread is quite old but I tried to download the Universar NativeSD installer to install a mod into my current NativeSD rom, but the link is down. Where can I get the installer? Is there another way to do what I'm trying?
Thanks.
Regards,
Click to expand...
Click to collapse
The link to the 720p mod is still working, you could change the system files and rom-name in that one to suit. Or just put your files in your NativeSD rom.zip and re-flash without wiping, backup first though
Robbie P said:
The link to the 720p mod is still working, you could change the system files and rom-name in that one to suit. Or just put your files in your NativeSD rom.zip and re-flash without wiping, backup first though
Click to expand...
Click to collapse
Thanks Robbie P for your help. But I was referring to the Universal NativeSD installer for all roms v0.1 download link. Anyway, what is the 720p mod?
pepemonje said:
Thanks Robbie P for your help. But I was referring to the Universal NativeSD installer for all roms v0.1 download link. Anyway, what is the 720p mod?
Click to expand...
Click to collapse
the 720p mod is in post#2, it allows people to play 720p quality video files. afaik it uses the same install method as the original installer.
You can delete the system folder in the zip and add yours. You would also need to change the rom_name in mount_NativeSD.sh to whatever the rom you are modifying uses (same name as the folder in /sdcard/NativeSD)
Note that permissions and possibly symlinks for the new files might need changing after installation.
If you put the mod files in your original rom.zip and reflash as i mentioned earlier, there is no need to change rom-name.

Metasploit console on ADB without chroot, working!

Well I've been working on getting the Kali Linux toolkit to run on Android without a chroot and I did it, just gotta mount all the subfiletree's or whatever to where they belong in Androids root dir ,"/" (NOT "/root") and set up the paths in the enviroment a it seems to be working.
I spent way more time researching and planning out exactly how I was going to exicute this, it still has some kinks as some of the filesystems clash or have files of the same name but with slightly moified content, I guess I gotta dig through all those and patch em up so it all flows together, I just ran on the presumtion that it was all compiled for arm and I think it all runs on the android kernel when you chroot into an img file. I basically just mounted the kali.img file and instead of chrooting into that I went backwords and moved everything into Androids root.
Im working on a script with sanity checks and error collection and all that, I am still learning bash, linux, kernel, android, all like a summer cram session so please forgive me if I dont know or it takes time to share something I think is even slightly worthy for ya'll.
Anyways for those interested here is a bit of the tail end of what all this research has become, I think metasploit uses ruby, so if msf is working I guess that is too... here it is
Code:
localhost etc # ls
CHANGELOG-CM.txt gps.conf ppp
CHANGES.txt hosts recovery-resource.dat
NOTICE.html.gz init.d security
apns-conf.xml init.goldfish.sh snd_soc_msm
audio_effects.conf init.qcom.efs.sync.sh ssh
audio_policy.conf init.qcom.mdm_links.sh system_fonts.xml
bash init.qcom.modem_links.sh terminfo
bluetooth init.qcom.post_boot.sh thermald-8064.conf
boot_fixup init.qcom.thermal_conf.sh thermald-8930.conf
build-manifest.xml media_codecs.xml thermald-8960.conf
dbus.conf media_profiles.xml thermald.conf
dhcpcd mkshrc vold.fstab
event-log-tags nano wifi
fallback_fonts.xml nfcee_access.xml
firmware permissions
localhost / # mount --rbind $subset/etc /etc
localhost / # which apt-get
/usr/bin/apt-get
localhost / # which mfsconsole
localhost / # which msfconsole
/usr/bin/msfconsole
localhost / # msfconsole
IIIIII dTb.dTb _.---._
II 4' v 'B .'"".'/|\`.""'.
II 6. .P : .' / | \ `. :
II 'T;. .;P' '.' / | \ `.'
II 'T; ;P' `. / | \ .'
IIIIII 'YvP' `-.__|__.-'
I love shells --egypt
Easy phishing: Set up email templates, landing pages and listeners
in Metasploit Pro's wizard -- type 'go_pro' to launch it now.
=[ metasploit v4.7.0-2013071701 [core:4.7 api:1.0]
+ -- --=[ 1131 exploits - 638 auxiliary - 180 post
+ -- --=[ 309 payloads - 30 encoders - 8 nops
stty: standard input: Bad file number
msf > exit
localhost / # ls
acct init.trace.rc
bin init.usb.rc
cache initlogo.rle
charger lib
config lpm.rc
d media
data mnt
default.prop opt
dev persist
efs proc
etc res
extSdCard root
firmware run
fstab.qcom sbin
init sdcard
init.cm.rc srv
init.goldfish.rc storage
init.qcom.class_core.sh sys
init.qcom.class_main.sh system
init.qcom.early_boot.sh tmp
init.qcom.lpm_boot.sh tombstones
init.qcom.rc ueventd.goldfish.rc
init.qcom.sh ueventd.qcom.rc
init.qcom.syspart_fixup.sh ueventd.rc
init.qcom.usb.rc usbdisk0
init.qcom.usb.sh usr
init.rc var
init.recovery.qcom.rc vendor
init.target.rc
localhost / # exit
exit
[email protected]:/ #
EDIT: Please note that to get this working I had to "su -c bash" so that some of the mount commands would work properly, this is why is says "localhost / #" and not "[email protected]:/ #", its bash and thats the same interpreter the normal chroot throws you into. This is bash from Androids / directory.
My kind of thinker. I'll have to look into this!
Sent from my SPH-L710 using xda app-developers app
Haven't gotten time to try out your mod yet but thought I'd let you know I did get Kali Linux installed on my GS3 and metasploit runs relatively well ssh'ing through terminal!
Sent from my SPH-L710 using xda app-developers app

[Dev] HD2 multi-script

I have a script and tools hosted on dropbox.
Stick with the beta script unless you're interested in testing.
What the script can do.
1. Essentially replace aroma in the most basic sense. [Can be made to run with]
It will take any ROM.zip convert the initrd.gz to the desired type (DataOnExt, NativeSD, DirectSD) and copy them to /boot and /boot_dir
Will strip the updater-script of the ROM.zip down to the symlink/set_perm lines along with extract data and system folders.
(Essentially turning an aroma ROM.zip to a basic CWM ROM.zip)
2. Mount appropriate folders
Just tell the script the type of install and the name of the ROM (i.e the ROM folder name on ext4).
Then you can flash any zip you want (as long as the zip doesn't change the mounts)
3. Modify the ramdisk
If you just want the ramdisk modified that can be arranged
4. System install.
In consideration.
It's difficult to get things running as they should without a device to reliably test things on, so need user feedback to correct stuff.
I have been unsuccessful thus far in getting a portadroid type up and running, I'm not sure why at this point.
If the interest is there I can try and add in the updating mechanic from portadroid to Native/Direct, i.e where you have a named folder(s) (open to suggestion on folder names) present in /sdcard/NativeSD and these folders are copied over to the ext4 folders on boot.
How to run:
Instruction can be seen on the dropbox page but:
Simpliest way is via adb.
Copy the bins folder to /sdcard/bins
Reboot to recovery
Push the script to /tmp for example: adb push *.sh /tmp/
Run the script:
adb shell
cd tmp
chmod 777 *.sh
./*.sh
Then read the prompts.
Alternatively you can run it directly as ./*.sh {opt} $type $ROM_NAME $data_NAME $systeminstall
Feel free to report any issues, suggestions/improvements.
I'll be posting a recovery with most of the needed stuff bundled in, so running it will be easier for devs.
Writing the script took some doing (especially as it's in dash - not bash), any feedback would be appreciated.
Credits due.
The portadroid guys (if/when it's up and running)
[cedesmit, Takaaki, boonbing]
The Native/DirectSD guys
[securecrt,Xylograph]
RobbieP for testing thus far.
I have noticed that I already have the code for an update feature in the script just need to add a loop, what would be the general consensus for the location of the script to flash /sdcard/NativeSD/*.zip or /sdcard/NativeSD/ROM_NAME/*.zip?? The second would mean that you can't rename the foldername (unless I manage to add in startup.txt features).
Update added to gamma script - using ROM folder (subject to change)
is this any good for determining kernel version? http://stackoverflow.com/questions/9535227/getting-uname-information-from-a-compressed-kernel-image
I added a modified version of @macs18max CM11 ROM using a version of my gamma script (will pull on request) to dropbox last night, if anyone is willing to test...
1. Does it boot
---If it doesn't add a blank file as /sdcard/bins/makemountfs (echo "" > /sdcard/bins/makemountfs will do it)---
---And try it again; unfortunately this will remove the update feature---
2. Are update zips installed properly
Diff from original:
only one initrd - script makes the others as needed
script performs the partition mounting for the ROM
script checks for zips in the ROM folder in NativeSD
Need to add:
my build.prop append code - once I where I posted it... to reduce duplicates.
Edit. Whoops didn't mean to edit my post from yesterday - @Robbie P just for reference "strings zImage | grep 'Linux version'" is similar to what you posted and can be run on the leo but doesn't seem to give reliable/usable results - I haven't ran the hexdump check on the latest kernel yet so not sure if the check is still valid.
i did try 1_92 on macs18max's rom last night, the kernel was not recognised as a 3.0 kernel. i added 6mb but it didn't boot. I had the extended battery in throughout
i did use the f2fs sd recovery though to flash it, that booted ok and has 3.0 kernel
i still think a simple "if kernel >3mb => 3.0 kernel" haven't checked the latest .35 kernel yet for size.
did you add the adb fix?
will try yours later:fingers-crossed:
thanks
Edit; in fact, size of kernel is the over-riding factor, surely. it is size-of-magldr's-boot-partition minus size-of-initrd.gz(any-type) gives the max size of a kernel before we have to add 6mb. i guess it is around 3mb.
it is conceivable that we may have to add 6mb to the .35 kernel's ramdisk if more code is added.
Robbie P said:
i did try 1_92 on macs18max's rom last night, the kernel was not recognised as a 3.0 kernel. i added 6mb but it didn't boot. I had the extended battery in throughout
i did use the f2fs sd recovery though to flash it, that booted ok and has 3.0 kernel
i still think a simple "if kernel >3mb => 3.0 kernel" haven't checked the latest .35 kernel yet for size.
did you add the adb fix?
I added the ADB 'fix' to on boot - with gamma 4_4 (the ROM zip is using 4_3) - the line I added is with the variable, not ABCD..., might work, moight not
will try yours later:fingers-crossed:
thanks
Edit; in fact, size of kernel is the over-riding factor, surely. it is size-of-magldr's-boot-partition minus size-of-initrd.gz(any-type) gives the max size of a kernel before we have to add 6mb. i guess it is around 3mb.
it is conceivable that we may have to add 6mb to the .35 kernel's ramdisk if more code is added.
You could be right about the 3mb size always needing 6MB but I can't be sure. My feeling is it is a 3.0.x issue rather than a size one (I could be wrong though). 3.0.x kernels could probably be cut down (esp. recovery kernels) to be less than 3MB (and vice versa with the 2.6.x) that's why I was keen to stay away from size as being the determining factor - I'll switch to using sizes in the next gamma.
Click to expand...
Click to collapse
ADB fix with 4_4 is:
sed -i "/on boot/ a write /sys/class/android_usb/android0/iSerial \${ro.serialno}" /tmp/work/init.htcleo.rc
I could try variable substitution \${ro.serialno:-ABCDEF123456} but not sure if that works with .rc's
Edit. 4_5 kernel check changed to:
Code:
[strike]zI=` busybox ls -la /tmp/zImage | awk '{print (${NF-4)}' `
if [ ${zI} -gt '3145728' ]; then...[/strike]
zI=` du -m /tmp/zImage | awk '{print $(NF-1)}' `
if [ ${zI} -gt '2' ]; then...
mac rom; i have an error from aroma-config line 147 col 40, pretty sure it is missing comma on line 145 after "1"
rezipping and re-flashing. is the rom-name different from original?
it went through aroma options (chose directsd, softkeys,wipe), then installed immediately, no files actually installed, attached recov logg
i did have original rom.zip on sdcard and nativesd rom installed, might have to delete either, or both?
Edit; deleted original rom.zip and used 4ext recovery (f2fs sd previously), but same, installs successfully immediately, log did not save unfortunately
Robbie P said:
mac rom; i have an error from aroma-config line 147 col 40, pretty sure it is missing comma on line 145 after "1"
rezipping and re-flashing. is the rom-name different from original?
it went through aroma options (chose directsd, softkeys,wipe), then installed immediately, no files actually installed, attached recov logg
i did have original rom.zip on sdcard and nativesd rom installed, might have to delete either, or both?
Edit; deleted original rom.zip and used 4ext recovery (f2fs sd previously), but same, installs successfully immediately, log did not save unfortunately
Click to expand...
Click to collapse
Have reupped with aroma fixed, rom-name was the same as original (folder in NativeSD would be different). Reupped version has _test added to it. recov.logg reports that system was installed??? Based on the other stuff in the log I don't think it's made from the zip.
type=NativeSD rom_name=cm11_ma and command run was m(ntstuff) rather then m(odify)r(amdisk)...
Yea - the log is from a different zip install:
Code:
Installing '/sdcard/cm11_ma_NativeSD.zip'...
Checking for MD5 file...
I:Cannot find file /sdcard/cm11_ma_NativeSD.zip.md5
Skipping MD5 check: no MD5 file found.
I:Zip does not contain SELinux file_contexts file in its root.
about to run program [/tmp/multi.sh] with 5 args
There really shouldn't be any conflicts with other zips here... Is there any text reported on screen after/before the system supposedly installs?
Edit. Anyone know where the HD2 HaRET source is located? Anyone trying to run 3.0.x with haret try adding 1MB of zeros to the initrd.gz (PM if you don't know how).
sorry about that log, was the one from previous night's install.
i just tried GAMMA4_5.sh DirectSD cm11_m
get screen.txt attached
i know @gilbert32 was looking at getting haret to boot with 3.0 kernel
Robbie P said:
sorry about that log, was the one from previous night's install.
i just tried GAMMA4_5.sh DirectSD cm11_m
get screen.txt attached
i know @gilbert32 was looking at getting haret to boot with 3.0 kernel
Click to expand...
Click to collapse
Could you try just using the zip on the dropbox page - the sh and bins are already added to it. No need to run any script. I might need to change the bundled script though. Picking through the errors in the log:
sh: 3.1: bad number
is from the kernel check - I added h (so that it reports 3.1M rather than 3, wasn't sure how it would handle the decimal) - reverted 4_5
cp: can't stat '/tmp/mountfs-DirectSD.sh': No such file or directory
copying fsck for f2fs
cp: can't create '/system/bin/mkfs.f2fs': No such file or directory
cp: can't create '/system/bin/fsck.f2fs': No such file or directory
chmod: /system/bin/mkfs.f2fs: No such file or directory
chmod: /system/bin/fsck.f2fs: No such file or directory
gamma doesn't use mountfs.sh's by default
f2fs added in error?? Can't copy to system/bin as there isn't one
/GAMMA4_5.sh: line 1236: /tmp/7za: not found
Should have been /bin/7za - fixed 4_5
sh: porta: unknown operand
Trying to figure this one out - it's line 1197 - fixed 4_5 - still not sure why it reported as an error (nested if??)
​Current 4_5 bundled in ROM zip
My thinking regarding haRET - the source I saw (different device) seems to have the ramdisk offset by 5MB. Offset for 3.0.x is 16MB (magldr default offset is 10MB plus the 6MB of zeroes = 16MB). If the offset in haret is matched to that of magldr (10MB) then 1 more MB is needed to get to to 16 - if haret is compiled to add a 5MB offset. Source I was referencing is here.
Robbie P said:
sorry about that log, was the one from previous night's install.
i just tried GAMMA4_5.sh DirectSD cm11_m
get screen.txt attached
i know @gilbert32 was looking at getting haret to boot with 3.0 kernel
Click to expand...
Click to collapse
funny thing, i just was looking into it (after a long time since being on xda), and saw this mention
still, i can't find any clue on what to do, or what's the cause for the no-boot with haret...
tried latest mac.zip, have attached logs
i have a work assessment coming up in the next couple of days, so need to get my head down.:fingers-crossed:
Robbie P said:
tried latest mac.zip, have attached logs
i have a work assessment coming up in the next couple of days, so need to get my head down.:fingers-crossed:
Click to expand...
Click to collapse
Get your head down, mate. Just some missing ,'s in the updater-script (used to separate arguments). Should be fine now - at least on the non-script side of things.
Correction - it's fine now (sh was wiping /tmp and thus /tmp/aroma before it was needed by updater-script), managed to botch a working device again - currently installing as DirectSD on cLK.
HypoTurtle said:
Anyone trying to run 3.0.x with haret try adding 1MB of zeros to the initrd.gz (PM if you don't know how).
Click to expand...
Click to collapse
Just tried this and it still doesn't boot, same as before, hangs on jumping to kernel
edit; tried changing initrd offset in startup.txt from 0x00a00000 to 0x00b00000 and 0x00900000 but no joy either
Robbie P said:
Just tried this and it still doesn't boot, same as before, hangs on jumping to kernel
edit; tried changing initrd offset in startup.txt from 0x00a00000 to 0x00b00000 and 0x00900000 but no joy either
Click to expand...
Click to collapse
nah, this isn't the problem. it's somewhere else and i can't figure it out we have to stick with clk or mag for 3.0.x atm
gilbert32 said:
nah, this isn't the problem. it's somewhere else and i can't figure it out we have to stick with clk or mag for 3.0.x atm
Click to expand...
Click to collapse
How about mtype? we know that the .35 kernel was originally from desire. is it possible that it still has mtype set to 2215 somewhere? i tried setting it to this in startup.txt but same.
Edit; might have found haret source code https://code.google.com/p/android-kaiser/downloads/detail?name=haret.tar.gz&can=2&q=
@gilbert32 @Robbie P
Just for reference: haretlog from 2.x
Built virtual to physical page mapping
Allocated 3124 pages (tags=5C000000/16368000 kernel=5C001000/16369000 initrd=5C2BB000/2c161000 index=5CC2D000/2b7ef000)
Built kernel tags area
Built page index
Tags will be at offset 0x00000100 (0xf00)
Kernel will be at offset 0x00008000 (0x2b9800) [2.72MB]
Initrd will be at offset 0x00a00000 (0x971ad6)
Video buffer at 49739000 sx=480 sy=800 mx=120 my=133
Video Phys FB=03839000 Fonts=2b7ea0e4
[email protected]/2b7e9000 sj=5CC33278 stack=5CC31000/2b7eb000 data=5CC32000/2b7ea000 exec=2b7e93a0
Reading 2856960 bytes...
Read complete
Reading 9902806 bytes...
Read complete
Launching to physical address 2b7e9288 [695.91MB]
Trampoline setup ([email protected]/10028f68/1323ff68) [256.16MB][306.25MB]
MMU setup: mmu=A04C0000/11cc0000
Go Go Go...​and from 3.x
Built virtual to physical page mapping
Allocated 3308 pages (tags=5C900000/163e0000 kernel=5C901000/1649a000 initrd=5CC73000/16294000 index=5D5E5000/2b87c000)
Built kernel tags area
Built page index
Tags will be at offset 0x00000100 (0xf00)
Kernel will be at offset 0x00008000 (0x3715b0) [3.44MB]
Initrd will be at offset 0x00a00000 (0x971ad6)
Video buffer at 49739000 sx=480 sy=800 mx=120 my=133
Video Phys FB=03839000 Fonts=2b8770e4
[email protected]/2b876000 sj=5D5EB278 stack=5D5E9000/2b878000 data=5D5EA000/2b877000 exec=2b8763a0
Reading 3610032 bytes...
Read complete
Reading 9902806 bytes...
Read complete
Launching to physical address 2b876288 [696.46MB]
Trampoline setup ([email protected]/1a028f68/12ca6f68) [416.16MB][300.65MB]
MMU setup: mmu=A04C0000/11cc0000
Go Go Go...​There's probably nothing there of any help. Physical address is changed by about 1.5MB?? 160MB in trampoline == graphics??
Double post
how about booting a 2.6.32 kernel from haret and then using kexec to change to 3.0 kernel in running rom?
HypoTurtle said:
@gilbert32 @Robbie P
Just for reference: haretlog from 2.x
Built virtual to physical page mapping
Allocated 3124 pages (tags=5C000000/16368000 kernel=5C001000/16369000 initrd=5C2BB000/2c161000 index=5CC2D000/2b7ef000)
Built kernel tags area
Built page index
Tags will be at offset 0x00000100 (0xf00)
Kernel will be at offset 0x00008000 (0x2b9800) [2.72MB]
Initrd will be at offset 0x00a00000 (0x971ad6)
Video buffer at 49739000 sx=480 sy=800 mx=120 my=133
Video Phys FB=03839000 Fonts=2b7ea0e4
[email protected]/2b7e9000 sj=5CC33278 stack=5CC31000/2b7eb000 data=5CC32000/2b7ea000 exec=2b7e93a0
Reading 2856960 bytes...
Read complete
Reading 9902806 bytes...
Read complete
Launching to physical address 2b7e9288 [695.91MB]
Trampoline setup ([email protected]/10028f68/1323ff68) [256.16MB][306.25MB]
MMU setup: mmu=A04C0000/11cc0000
Go Go Go...​and from 3.x
Built virtual to physical page mapping
Allocated 3308 pages (tags=5C900000/163e0000 kernel=5C901000/1649a000 initrd=5CC73000/16294000 index=5D5E5000/2b87c000)
Built kernel tags area
Built page index
Tags will be at offset 0x00000100 (0xf00)
Kernel will be at offset 0x00008000 (0x3715b0) [3.44MB]
Initrd will be at offset 0x00a00000 (0x971ad6)
Video buffer at 49739000 sx=480 sy=800 mx=120 my=133
Video Phys FB=03839000 Fonts=2b8770e4
[email protected]/2b876000 sj=5D5EB278 stack=5D5E9000/2b878000 data=5D5EA000/2b877000 exec=2b8763a0
Reading 3610032 bytes...
Read complete
Reading 9902806 bytes...
Read complete
Launching to physical address 2b876288 [696.46MB]
Trampoline setup ([email protected]/1a028f68/12ca6f68) [416.16MB][300.65MB]
MMU setup: mmu=A04C0000/11cc0000
Go Go Go...​There's probably nothing there of any help. Physical address is changed by about 1.5MB?? 160MB in trampoline == graphics??
Click to expand...
Click to collapse
@HypoTurtle @gilbert32 @Robbie P
How do I get this logs from haret. I have just install win6.1. Could someone guide me?

Categories

Resources