[Tutorial]Sysctl and you, A guide to better preformance and battery life.

lopedog

Member
Joined
Oct 6, 2010
Messages
121
Reaction score
0
Location
Va.
Every time I try the zip it doesn't take. Do I have a bad copy? I downloded it a few times and I get the samething. When I check to see if worked it can't find anything.

Sent from my DROID2 R2D2

I ran into that problem. Then a copy was emailed to me and it worked fine.

Screaming fast DROID X running the amazing rooted gingerbread

Is there any way I can get a copy?

Sent from my DROID2 R2D2
 

Tillyswilly

Active Member
Joined
Aug 23, 2010
Messages
1,060
Reaction score
0
Location
Bham
Every time I try the zip it doesn't take. Do I have a bad copy? I downloded it a few times and I get the samething. When I check to see if worked it can't find anything.

Sent from my DROID2 R2D2

Did u install the zip in recovery? Sounds like you just downloaded it and that's it you have to install it in recovery just like the old way of installing roms b4 this gr8 Liberation :icon_ banana:
 

lopedog

Member
Joined
Oct 6, 2010
Messages
121
Reaction score
0
Location
Va.
Every time I try the zip it doesn't take. Do I have a bad copy? I downloded it a few times and I get the samething. When I check to see if worked it can't find anything.

Sent from my DROID2 R2D2

Did u install the zip in recovery? Sounds like you just downloaded it and that's it you have to install it in recovery just like the old way of installing roms b4 this gr8 Liberation :icon_ banana:

Yes I installed thru recovery like always. I always install thru recovery haven't used the toolbox. When in recovery it installs and it say complete. But when I check to see if worked it can't be found. Also the install doesn't seem like it loads all the way, it only installs for couple seconds and then it says it is complete.

Sent from my DROID2 R2D2
 
Last edited:

lopedog

Member
Joined
Oct 6, 2010
Messages
121
Reaction score
0
Location
Va.
After flashing the zip and rebooting twice I go into terminal emulator and type bash/data/imoseyon/checkimosey.sh and enter and it tells me file not found.

Sent from my DROID2 R2D2
 

Cstryon

Member
Joined
Jan 25, 2011
Messages
398
Reaction score
2
With the zip flashed, will it account for settings in droid 2 overclock?

Sent from my DROID2 using DroidForums
 

lopedog

Member
Joined
Oct 6, 2010
Messages
121
Reaction score
0
Location
Va.
I got it. Finally figure out what I was doing wrong.

Sent from my DROID2 R2D2
 

imoseyon

Member
Joined
Jan 20, 2011
Messages
64
Reaction score
0
With the zip flashed, will it account for settings in droid 2 overclock?

Sent from my DROID2 using DroidForums

I think d2 overclock will probably override a few of my tweaks but you will be fine for the most part.

leanKernel + Tesla coil
 

tb110895

Member
Joined
Oct 11, 2010
Messages
965
Reaction score
0
Location
Philadelphia, PA
Okay, I found it but which one do I want? Interactive or on demand? Do they both save battery life?

Sent from my DROID2
 

distvox

New Member
Joined
Dec 9, 2010
Messages
21
Reaction score
0
Wasn't that zip built into 2.0.1. ?

Sent from my DROID2 using DroidForums App
 

jjj751

Member
Joined
Dec 31, 2010
Messages
173
Reaction score
0
Location
Connecticut
Hi,

So I am running Liberty 2.0.1 and although some of Imoseyon's scripts are already incorporated into the ROM I decided to install his newest zip (6.2.1.) onto my phone anyways to get the scripts that arent in Liberty. Plus he told me it's totally safe to do so. Anyways, I installed it then I ran the bash /data/imoseyon/checkimosey.sh script to check if the zip worked and it turned out only part of it worked. It said that sysctl tweaks wasnt enabled. Then it gave me script that would manually enable the sysctl tweaks so I punched it in and rebooted. Then went back to terminal and checked to see if it's enabled and it still isn't. What should I do? It says it's not enabled even after I enable sysctl in Liberty Settings.
 
OP
Jboxen

Jboxen

Premium Member
Premium Member
Developer
Joined
Jun 15, 2010
Messages
902
Reaction score
0
Location
Rochester, NY
Pretty sure its all incorperated into the new liberty. Imoseyon and Jrummy collaberated for 2.0.
 

jjj751

Member
Joined
Dec 31, 2010
Messages
173
Reaction score
0
Location
Connecticut
Pretty sure its all incorperated into the new liberty. Imoseyon and Jrummy collaberated for 2.0.

Is it true? Because I was on Imoseyon's website and he said that about half of his scripts got incorporated into Liberty. Anyways, I can't change the sysctl values in liberty toolbox. It works after a reboot but after like 5 mins the values revert back to the ones before.
 

sparkyman

Premium Member
Premium Member
Developer
Joined
Jan 12, 2011
Messages
317
Reaction score
3
Location
columbia,md
[UPDATED FINAL]
First off I would like to say I have gotten all of my information for this mod here: imoseyon I would also like to thank the developer for posting all of his findings and for all of his hard work.

Changing all kernel tweaked values and an auto flush via flashing a .zip file:

Imoseyon was nice enough to make us all a flashable .zip file which makes all tweaks for us :). Thank you Imoseyon!!!

Due to the amount of times Imoseyon updates his zip I will from now on just be directing you to his site. Check back now and then to see if there is an update available.

http://www.imoseyon.com


Enabling Sysctl and changing (most) values via LIberty Settings (Update Liberty Toolbox in market and it will work)

Sysctl Support: Check
Min Free KBytes: 4096
Dirty Ratio: 90
Dirty Background Ratio: 70
VFS Cache Pressure: 1
Oom Allocating Task: Check

Reboot your phone, go to the terminal emulator and type in:

sysctl -a | grep vm


Note: This will not give you all of the mods that are available, if you want the remaining mods, continue down to the next methods.

If your settings have been saved using the App and you don't want the additional mods, then you are all done! Thanks Jrummy! Make sure you scroll down to the bottom of the post and read the IMPORTANT section as it applies to every version of this mod.

Edit: The NEWEST version of Liberty Toolbox fixes the bugs but if you're also running Droid Overclock then read below.



Enabling Sysctl and changing (most) values via Jrummy's Droid Overclock App
Note: If you have this and are running Liberty, you will have to change the settings in Droid Overclock too as the Liberty settings will be over-written.

Jrummy has released an update to Droid Overclock, v.2.0.2. So go to the market and update it if you haven't already. Open up his Droid Overclock app and press Menu>Settings>Advanced Settings. Scroll down until you see Sysctl and do the following.

Sysctl Support: Check
Min Free KBytes: 4096
Dirty Ratio: 90
Dirty Background Ratio: 70
VFS Cache Pressure: 1
Oom Allocating Task: Check

Reboot your phone, go to the terminal emulator and type in:

sysctl -a | grep vm

This version of Jrummy's Sysctl enabler and editor has worked for me so he must have squashed the bugs. Thanks Jrummy!

Note: This will not give you all of the mods that are available, if you want the remaining mods, continue down to the next methods.

Enabling Sysctl and changing values via Root Explorer

So now onto the next step, enabling and changing the values manually. First off we should start by enabling sysctl. This can be done with root explorer...
Open up root explorer and go to /data/liberty and mount the system RW. Long press on init.d.config and open it in the text editor. Now scroll down until you find SYSCTL and set that from 0 to 1.
Sysctl is now enabled.

Note: If for whatever reason you would like to disable this later on just use the backup file it created to do so.

Now to set the values that Sysctl will be changing, also done with root explorer. This will be done in the /etc folder. Navigate yourself to the /etc folder and see if you already have a sysctl.conf. If not, click the menu softkey and then click more>new file. Name this new file sysctl.conf . Mount the system RW now and open the file in the text editor again. Now type exaclty these lines into the file. (It's ok to delete what's there if anything and replace it with this.)


vm.swappiness = 0
vm.min_free_kbytes = 4096
vm.dirty_ratio = 90
vm.dirty_background_ratio = 70
vm.vfs_cache_pressure = 1
vm.panic_on_oom = 2
vm.oom_kill_allocating_task = 1
kernel.panic = 5
kernel.shmmax = 2268435456
kernel.shmall = 16777216


Save it and you can erase the backup that it creates as there is no original file.

Now reboot your phone and open your terminal up. Type in this command again:

sysctl -a | grep vm

You should see your settings have been applied and are working as intended. If you see any errors, go back to the file and make sure you typed everything into sysctl.conf correctly. (There will be 2 permission denied errors at the very bottom when typing in this command but they aren't important.)



Enabling Sysctl and changing values via VI commands

After mounting the system RW, going in to terminal emulation, at the prompt:

vi /data/liberty/init.d.conf

Now, vi is an old school text editor so you have to maneuver around using the following keys because we have no cursor keys in droid:

j = move cursor down one line
k = move cursor up one line
h = move cursor right one character
l = mover cursor left one character

Right now you are in vi's command mode. This allows you to move around and issue commands like save, undo, quit, etc.

Find the line that says:

SYSCTL=0

Move the cursor so it is sitting right on top of 0 and press r which means to replace the character underneath the cursor and type 1.

Save the file and quit back to the prompt by typing :wq (you will actually see this command typed at the bottom of the editor)

Once back at the prompt, to edit the other config file:

vi /etc/sysctl.conf

If was easier for me to delete all the lines in there and type everything in so typing dd deletes one line at a time.

Once all the lines are deleted, press i which means start inserting at the cursor. This puts you into edit mode in vi. Type in the following lines as detailed by Jboxen in his post:

vm.swappiness = 0
vm.min_free_kbytes = 4096
vm.dirty_ratio = 90
vm.dirty_background_ratio = 70
vm.vfs_cache_pressure = 1
vm.panic_on_oom = 2
vm.oom_kill_allocating_task = 1
kernel.panic = 5
kernel.shmmax = 2268435456
kernel.shmall = 16777216

Once you are done, we need to get back into command mode by press ESC. Since the keyboard doesn't support the ESC key, we need to change a setting in terminal emulation. Hit the menu button | Preferences | Control key. I changed mine to be Vol Down. Pressing Vol Down and then 1, gets me back to command mode. Type in :wq to save and quit.

After that reboot, go back into terminal emulation, check your work by typing:

sysctl -a | grep vm

If you screw up editing your files at any point and want to abandon your changes in vi, press ESC (in my settings it's Vol Down and then "1"), and type in ":q!" (minus quotes obviously)

Anyways, you can find more info on vi commands here.

Thank you to freezyfreaky for these instructions. :)


IMPORTANT: "after a day or two your device may start getting sluggish because the amount of RAM available to the applications continue to shrink to the point where they are starved for memory."

Note: If you chose the flashable .zip method then this is done for you automatically at 1AM PST and you don't need to read this.

There's two solutions to this really, and they are very easy.

1. Reboot your phone when you wake up and take it off the charger in the morning.(easy)
2. Run this script in terminal emulator when you wake up in the morning:

sync; echo 3 > /proc/sys/vm/drop_caches

"Tells the system to drop all file system caches"

**REVERTING BACK TO STOCK**

1) revert build.prop file
2) delete /etc/init.d/99imoseyon.



Now if you want to know why this works and what it does I would suggest following the link at the top of the page because he can explain it much better than I can. He also has so many more cool things that he has experimented with. I recomend reading it all.

Well, there you go! Enjoy guys this is a great mod and should make the Communitty very happy! :)

Disclaimer: I am not responisble for anything that happens to your phone as a result of this mod, anything you do to your device is your responsibility.



Sent from my DROID2 using DroidForums
 
Last edited:
Top