[Droid X General] SysAdmin-X:
Short Little MetaMorph Guide for Changing Icons

Had someone in a post ask about changing some battery icons... So this is a little blip about using it...

I recommend checking out DroidPirate.com if you are looking for images. If anyone else has a place they use for icons, please let me know, and I will add it to this post! Thanks

How-To

MetaMorph ONLY installs the current theme files to the app that exist in the /system/app/ if there is no file you must find the .apk on your phone and place it into the /system/app/ directory.

1) pick the icons you want and download the .zip

2) The file should be a “.ZIP” extension, make sure you do not unzip the file.

3) Connect your device via USB and mount

4) On the root of your SD-Card you need to create a folder called “AndroidThemes” IT MUST LOOK EXACTLY LIKE THAT OR IT WILL NOT WORK

5) Copy the .ZIP file you downloaded and place it in the “AndroidThemes” folder.

6) Assuming you already have the MetaMorph application installed on your phone. Open the MetaMorph app.

7) Click on “Unzip/Extract New Theme”

8) You should the .zip file you have added to the AndroidThemes folder like in the image shown below.

9) Click on the file inside of MetaMorph a MetaMorph install screen should come up telling you about the theme you are installing like shown below (just click Close)

10) Now you should see a button located on the bottom click on “Apply All” this will begin the process of the application skinning.

11) You should see a message box that pops up that says “All Themes Applied” like shown below

12) Reboot your phone and make sure whatever app you where skinning is now skinned.

Recovering Contacts If You Lose Backup Assistant When Using a Custom ROM:

For those of you who relied on Backup Assistant in the default Moto ROM for your contacts, you are in luck =)

Go to backupassistant.com and log in. From here, you can see all of the contacts as of your last sync, and then you can back them up as an Outlook CSV. Next, login to your gmail account, click on "Contacts" and then click "Import". Import the .csv file that you generated from backupassistant.com and....VOILA, all of your contacts are now synced to your gmail account, and you can kiss backup assistant goodbye!

SysCtl.conf Tweaks

Credit for this section goes to macpro88 at DroidXforums and Marius from whom macpro mentions below

Liberty 1.0 and Syssctl Config

Listen up everyone! Since the release of Liberty 1.0, JRummy16 also released a new app in the market called Sysctl Config, which gave users an interface to manually edit and tweak the sysctl.conf file. Alongside this, Liberty made it easier to configure the sysctl.conf file using the integrated menu option under Liberty Settings without the use of the app.

Please take special note! That any ROM can utilize these sysctl.conf tweaks, not just Liberty, and rooted stock as well.

(You must be rooted and have busybox installed for this to work on stock)

So what is the purpose of this thread? And what is Sysctl.conf all about?

First of all, we are going to explore what sysctl.conf is.

Second of all, we are going to explore what sysctl.conf does, and what it can do for your phone.

Lastly, we are going to explore how sysctl.conf works and what kind of benefit is has on the Android OS.

Now, before we get started, we need to clear something up! The tweaks and modifications we will discuss in this thread, WILL NOT IN ANYWAY INFLUENCE BENCHMARK SCORES SUCH AS QUADRANT! Benchmark apps are meant to measure hardware performance only and are in no way affected by these tweaks and modifications, but make no mistake! You will notice at least a slight increase in Android's performance and a possible increase in battery life as well.

Another thing that everyone needs to know is that the Android OS is a Linux based operating system, so there will be a lot of references to Linux, just so you are not confused.

So lets get started shall we?!?!

Ok, so first of all, let’s explore what sysctl.conf is.

The sysctl.conf is a configuration file for "sysctl" which is an interface for dynamically changing kernel parameters in the Linux OS. The configuration file contains the following elements, vm.min_free_kbytes, vm.dirty_ratio, vm.dirty_backgroud_ratio, vm.vfs_cache_pressure, vm.oom_kill_allocating_task. There are many other elements within the file, but we will be primarily focusing on these specifically (the vm prefix stands for virtual memory). The sysctl.conf file should be located in /etc (/system/etc) by default. To enable it you need your ROM to execute "sysctl -p" somewhere during the boot process (or shortly afterward). We will also be discussing how to enable it if it is not already done so. You can also run sysctl -p manually to enable it any time after the OS is started.

Now, let’s get down to what sysctl.conf does and how it works.

Min Free KBytes (vm.min_free_kbytes) - This is used to force the Linux VM to keep a minimum number of kilobytes free. The VM uses this number to compute a pages_min value for each lowmem zone in the system. Each lowmem zone gets a number of reserved free pages based proportionally on its size. Default is 2048kb.

Dirty Ratio (vm.dirty_ratio) and Dirty Background Ratio (vm.dirty_background_ratio) control how often the kernel writes data to "disk" (in our case the internal microSD system card, not the removable microSD card). When your apps write data to disk, Linux actually doesn't write the data out to the disk right away, it actually writes the stuff to system memory and the kernel handles when and how the data is actually going to be flushed to the disk. These values represent a percentage, the higher the percentage, the longer it waits to flush, the lower the percentage, the more often flushes will occur. Now remember, we are dealing with solid state storage, not the traditional disk platter and spindle. So we are actually able to delay flushes a little longer with solid state versus a traditional hard drive disk.

VFS Cache Pressure (vm.vfs_cache_pressure) -Now here is where it gets interesting! File system cache (dentry/inode) is really more important than the block cache above in dirty ratio and dirty background ratio, so we really want the kernel to use up much more of the RAM for file system cache, this will increas the performance of the system without sacrificing performance at the application level. The default value is 100, as a percentage, and what you want to do is lower the value to tell the kernel to favor the file system cache and not drop them aggressively.

Oom Allocating Task (vm.oom_kill_allocating_task) (enable or disable, generally in Linux this value is either a "1" or a "0," representing as on or off.) -This enables or disables killing the OOM-triggering task in out-of-memory (oom) situations. If this is set to zero, or disabled, the OOM killer will scan through the entire task list and select a task based on heuristics to kill. This normally selects a rogue memory-hogging task that frees up a large amount of memory when killed. If this is set to non-zero, or enabled, the OOM killer simply kills the task that triggered the out-of-memory condition. This avoids the expensive task list scan, which can take mass amounts of time and "hang" or freeze the system.

This information has been pulled from the following sites:

imoseyon: Sysctl tweaking for faster, longer lasting Android

imoseyon: sysctl (and minfree) tweaks revisited

http://www.linuxinsight.com/proc_sys_vm_hierarchy.html

How to edit the values manually, follow these steps:

1) First enable sysctl from Liberty settings, if you are on Liberty

2) Run Root Explorer

3) Modify /data/liberty/init.d.conf to make sure that sysctl is enabled ("sysctl = 1")

4) Go to /system/etc/, and mount it r/w

5) Modify sysctl.conf by long pressing the sysctl.conf file and selecting "Open in Text Editor." When finished, save the file and exit

6) Run Terminal Emulator

7) Type "sysctl -p" (output should confirm whether you've done step 4&5 correctly)

(Soon to come, how to enable if your ROM does not support sysctl, which will require much more tweaking.)

If you want to check to see if your changes take hold after reboots, run this in Terminal Emulator:

sysctl -a| grep vm

or

sysctl -p

This command will give you all the sysctl values, scroll down to find the ones you edited and verify that they are the same values you changed them too.

Now, if you want the easy way out, our good friend Marius has been great, and created a flash-able .zip that does all of the work for you!

The .zip can be found here, at Marius' blog titled "imoseyon."

When you flash the .zip file, in Bootstrap Recovery, the following will take effect, and please note, any settings you may have altered, will be overwritten!

Applying the .zip will do the following:

1. Install BusyBox 1.18.0 (in an alternate location)

2. Enables cron, which is a Linux time-base job scheduler

3. Tweaks certain kernel elements (vm, minfree, etc.)

4. Tweaks build.prop (on some ROMs)

5. Flushes system caches once a day (1AM PT)

This .zip should be all you need to get your phone running in tip-top shape. The zip is fairly ROM agnostic, meaning that almost any rooted ROM is going to work (rubiX, Liberty, ApeX, Darkslide, etc. and maybe even stock ROM, as long as you are rooted). It should also work for both Droid X and Droid 2.

Please make sure you create a backup before flashing anything!

After you flash the .zip, you can run the following command in Terminal to make sure it was applied successfully:

pgrep -f crond

If you get a value on the following line, the .zip has been applied successfully, don't worry about what number you, everyone may end up with a different number.

If you are really feeling adventurous and are down for a good read, and really want to get to know the Android OS even better, please follow Marius' blog, as it is a great read!

--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

There really is NO right answer when you research sysctl. The best thing to do would be to search VM Linux tweaks. Most of the time, you'll see sysctl values that people optimizing their Linux systems use. Take a look at those, and then look into the actual name of what you're tweaking, to find out what it does.

VFS Cache Pressure, go ahead and disable that. I think the stock value is 100, so enter that. At the value of "12" which is the default in Liberty (from one of my old sysctl's) causes a slowdown after a while, even though makes everything much more responsive at the get go. The slowdown is why I removed it from rubiX roms. OOM Kill Allocating Task kills off the app that caused you to run out of memory, which runs better than the stock android configuration.

The default values in Liberty sysctl tweaks are what I suggested to JRummy after extensive research and testing with Drod on RubiX. The settings Marius used up above are actually the stock settings, so you would have those values by disabling sysctl all-together, which is definitely an option. By raising the dirty ratio and dirty background ratio to 95 and 60 respectively, you are allowing for fewer memory flushes which results in much improved battery life. I found, as Drod mentioned, that with vfs_cache_pressure too low, you will see some slowdowns in performance at around 50 hours without a reboot. Through additional testing, I determined that a setting of 50 here, half that of stock will provide a good blend of benefits without risk. You would need to be running for something like 150 hours without a reboot in order to ever see a slowdown with this setting. It may be even more than that.

From what I have gathered it seems the general consensus in this thread is that there are two main approaches to this:

vm.min_free_kbytes = a

vm.dirty_ratio = b

vm.dirty_background_ratio = c

vm.vfs_cache_pressure = d

One is the self-maintained, improved overall performance approach:

3072 => a => 2048

95 => b => 70

60 => c => 40

50 => d => 25*

*at 25 you’re probably going to have to reboot after about two days

Recommend values in bold

The other is the automated purge cache controlled, extreme performance approach:

3072 => a => 2048

95 => b => 70

60 => c => 40

10** => d => 1***

**Need to run a script to purge cache every 22-30

*** Need to run a script to purge cache every 10-16

Personal recommendation for most people (no manual flushing required):

dirty_ratio = 90

dirty_background_ratio = 55

vfs_cache_pressure = 20

If you are willing to play around with manual or timed flushing I think you can squeeze a little more performance and battery life with:

dirty_ratio = 90

dirty_background_ratio = 70

vfs_cache_pressure = 1

A lot of this stuff is subjective and very dependent on your usage pattern. I've gone about 3 days with the latter without having to flush and probably could have gone a lot longer except i was running some other experiments that caused my phone to reboot.

-------------------------------------------------------------------------------------------------------------------------------------