yashsingh1/xdaforums huggingface dataset:
[G1 Android Development] miketaylor00:
The reason you only get 70% compression is that you don't have a linux-swap partition so backing swap can't turn on even though it is enabled. When I get it working with swap file it will work for anyone with an ext partition.

As the other guy alluded to, cyan checks for the existece of the userinit.sh. delete or I would suggest renaming it in case you want to use it later.
[G1 Android Development] miketaylor00:
It sounds like your user.conf is hosed. Either post it and your output for sh /system/sd/userinit.sh -s and we can help you debug it. Or drop in my user.conf and see what that does.

On second thought, it sounds like it can't find your insmod file. Which ROM are you on? The script dynamically finds the right folder for you using grep. So either you are on a ROM that doesn't have Cc installed or for some reason the script can't find the right folder that contians the module.

You can try my user.conf but I think the issue is deeper. Post the output of your userinit.sh -s
[G1 Android Development] worldestroyer:
What do the Virtual Memory settings do exactly? Does that just modify how the swap is utilized, or what? Do you need a swap partition to enable VM, does it conflict with cc? Just trying to figure all this out >_<
[G1 Android Development] miketaylor00:
I think you are right. Here is the link to the issue I opened. http://code.google.com/p/compcache/issues/detail?id=38

Also, here is some info from the kernel log:
[G1 Android Development] coredalae:
awsome script, turning of CC and only running linux_swap 32mb (swappiness 20) made my CM Really responsive.

^^ keep up the good work
[G1 Android Development] miketaylor00:
I'm trying to get an idea about how different settings work for different people. Can you answer the following for me:

How many apps do you have installed?

How many home screens do you have?

How many widgets are running on your home screens?

Do you use a task manager to close apps that you aren't using?

With the settings you are using, you are basically having the OS use the internal RAM and rarely use your Linux-Swap partition. If I had to guess, I would say that your desktop is pretty simple and you don't have a lot of apps running in the background. Am I right?
[G1 Android Development] miketaylor00:
FYI, there is a bug with Compcache. I'm working with a dev to get it fixed. Backing swap with a swap file has some issues right now so don't try to get it working.
[G1 Android Development] prince.siraj:
JACHEROSki

Is it possible to use this with the latest JACHEROSki-v1.7r2?
[G1 Android Development] huanyu:
You should not use this script on JAC's ROM. JAC uses /system/bin/swap script (based on this script) to control linux-swap and CC. The user.conf parameters are similar except JAC has few more addons for the HERO rom.
[G1 Android Development] prince.siraj:
oh ok thanks for clarifying that for me... so basically i would want to tweak the swap and user.conf but not touch the userinit.sh? and how do i tweak it, add it to the ROM, and flash it?
[G1 Android Development] miketaylor00:
The swap and user.conf are there. You only need to edit the user.conf.
[G1 Android Development] prince.siraj:
oh ok how do i add it though? through terminal after i flash JACHERO? and what would the code be anyways?
[G1 Android Development] miketaylor00:
Yes, you can do it through terminal.
[G1 Android Development] prince.siraj:
is it the same thing listed on the first page but system bin instead of sd?
[G1 Android Development] miketaylor00:
Yes. Look at my signature for xROM. The instructions are the same for copying to JACxHeroski
[G1 Android Development] prince.siraj:
k thx so much =D
[G1 Android Development] AsaSpades:
any ideas why my G1 wont accept motion changes after I changed the swappiness in my "user.conf" script?? The accelerometer wont work, no screen changes, Magic 8-Ball App also wont work, so its not just the screen rotation.
[G1 Android Development] miketaylor00:
Follow the directions in my signature. It should fix it for you. If it doesn't let me know.
[G1 Android Development] AsaSpades:
Ahhh, thanks 4 th@, **** was kinda annoying, any idea what causes it?
[G1 Android Development] miketaylor00:
The rild files get corrupt somehow. Certain apps don't auto rotate. If you open the keyboard or do something else that makes the system autorotate it tries to but the app won't let it happen. Somehow that messes it up. I think when it tries to put it back into potrait mode the sensor gets back even though it is already in potrait mode. Say that potrait mode is 0 and landscape is 90, it is already at 0 so it moves back to -90 instead of 0. So the next time you try to go back to landscape it sets it ahead 90 and ends up at 0 which is still potrait mode. I've seen the same thing when you turn on auto rotate in landscape mode. It calibrates it incorrectly.

Whatever it is, it is a pain in the butt. That's why I wrote that script. I got sick of deleting those files manually over and over.
[G1 Android Development] overground:
Getting an error in v0.1.5.1. I do not have any variation of odexing enabled.

C:\Documents and Settings\Dell Tower>adb shell sh /system/sd/userinit.sh -s
/system/sd/userinit.sh: line 649: syntax error near unexpected token `&&'
/system/sd/userinit.sh: line 649: ` if && [
-f $j ] ;then'

EDIT: I got rid of the && and now it runs, but at the end I get:

find: /system/app/*.odex: No such file or directory
find: /data/app/*.odex: No such file or directory
find: /data/app-private/*.odex: No such file or directory

It's not really a big deal for me, because I don't have any of the new settings enabled, so I'll just stick with 0.1.4.1 for now. Just pointing this out. Thanks for all you've done for us.
[G1 Android Development] huanyu:
will fix this in next release

this is normal, the find command is complain about there is no *.odex file found in that directory.
[G1 Android Development] prince.siraj:
so if you can't mount your system in terminal on the hero builds, then what's the adb code for moving my own user.conf to /system/bin? and what's the cp user.conf to userBAK.conf for?
[G1 Android Development] AsaSpades:
Ahhh Ic, thanks tho
[G1 Android Development] overground:
adb remount
adb push [path]\user.conf /system/bin/user.conf
adb shell chmod 755 /system/bin/user.conf

The userBAK.conf is to back up your existing user.conf in case you want to revert.
[G1 Android Development] Ohsaka:
In the latest user.conf...

cc_swappiness= # default 60

produces

/system/sd # ./userinit.sh
./userinit.sh
rzscontrol /dev/block/ramzswap0 --disksize_kb=32768 --init
[B]sysctl: error: malformed setting 'vm.swappiness='[/B]
--- dexopt-wrapper /system/app/Browser.odex
Unable to create '/system/app/Browser.odex': Read-only file system

Easily fixed. Just an fyi for the next version...
[G1 Android Development] Gimpeh:
I'm confused. Is "cc_disksize=32" this command how I designate how much space I want it to use? So it would be 32mb swap?

So say I want to designate 96 for swap which is what everyone appears to be doing for the new hero builds. This is the line in the script that would do it?
[G1 Android Development] ShatBag1105:
You got it all wrong dude. Yor cc disksize is for compcache which uses your fat32 or ext3 partiton. You set that to whatever you want. Your swap goes directly to your linuxswap partition which you have to create on your sd card. You cant limit swap disksize with these scripts. Swap will just use all of whatever your linuxswap partiton size. Thats why most ppl are using 96 for hero or 64 for 1.5. <<thats your swap disksize.

If you want to configure your linuxswap size you need to use gparted live cd (i highly recomend) or something similar to manually create/change your linuxswap partition. So your sd card would be Xmbs fat32/ Xmbs ext3/Xmbs linuxswap. Make sure your linuxswap is the third partition.
[G1 Android Development] Gimpeh:
Ah, I already have a 120mb linux swap. So they partitioned a 96 partition then? Makes sense. And what effect does cc memlimit have? Thanks for clearing this all up.
[G1 Android Development] ShatBag1105:
Yea according to my sig i had like 132 mbs linuxswap but that sucked. 64 is great for 1.5. As far as cc disksize i really dont know. Ive tried the reccomended and the maximum recomended without much difference. Ive heard lately that compcache slows down the g1 and im starting to believe it. My phone has been laggy for a while now, just random laggyness. Im about to disable compcache on this script and try just swap for a while.

My question is what is ODEX? Its search time for me.

http://www.mail-archive.com/android-developers@googlegroups.com/msg16316.html
[G1 Android Development] ShatBag1105:
Ok so creating .odex files for all our apps will delete classes.dex from our apks and create .odex files for them, which are optimized and will make app startup and runtime faster??? And save alot of system space??

Ok i ran the scripts with odex on for all apps without odex. I added /system/sd/app and /system/sd/app-private since i have app2sd. Is there any other directorys i should ass like davlik? And how do i see if it worked or not? Thanks.
[G1 Android Development] huanyu:
to be honest, i felt no differences. Maybe there is but i just can't tell.

I didn't check the space usage.

As the /data/app* are link to /system/sd/app*, don't think you need to add /system/sd/app* to app_dirs

In your /system/sd/app directory, you should see a .odex for each application.
[G1 Android Development] ShatBag1105:
Idk i think we might have to add the /system/sd dirs. I had to add those and run the userinit from the terminal with odex all enabled. I watched all my apps get edited and it did go to the /system/sd apps and edit them too this time. All were successfull. Took a while lol. Now i am all odexed. Lets see what happens now :)
[G1 Android Development] ThR1LL:
Will this work for 4.1.5? Also can we get an update on compatable roms?
[G1 Android Development] traspler:
A little question about the frequency scaling options of the script. Is it advisable to disable them on a CM ROM (will they interfere with what the ROM already does? Or is it even better to enable them?
[G1 Android Development] surfoni101:
help... when i configure my settings with compacache and linux-swap enabled i end up seeing only compcache enabled when i test it via terminal emulator
[G1 Android Development] tee aiy emm:
Make sure you're not using linux-swap file with compcache, that doesn't work. Hmm.. also are you sure you're pushing your edited user.conf file correctly?

It would be easier to help you if there was more information..
[G1 Android Development] huanyu:
It should work on 4.1.5 as i just tested with 4.1.6

this is upto you, i disable them as most of the user may want the default settings..

Which rom are you using? I just tested on latest CM 4.1.6, works fine without adding /system/sd/app*. Can you run "adb shell ls -all /data" and paste the outputs here please.
[G1 Android Development] prince.siraj:
oh ok thanks
[G1 Android Development] ElChouch:
Hi guys, does anybody knows why am I getting this ?!

Why does swap shows 24Mo ? Is a that the normal value ?

My linux swap partition is 64M.

I m using modaco 2.2 enhanced.

I get normal file names when exploring with a root exlorer on the phone, got user.conf but no user.init

Second question, does user.conf and user.init must be pushed in sytem/sd or system/bin ?

Thanx ;)
[G1 Android Development] acidwashg1:
had some questions for the pros in this thread; just wondering what you guys think of my changes to the optimization stuff. here is what I change in my user.conf:

page_cluster=3	# default 3, (0 since CM3.9.6+)

sampling_rate=1000000	# default 2000000 depending on kernel version
powersave_bias=200	# default 0, (200 since CM3.9.6+ )
up_threshold=35	# default 40, percent cpu usage before going up a speed step

I've seen these changes around the forum before, I don't take credit for them myself. credit where its due. but I was wondering if these changes have any benefit? I made the page_cluster change based on this page. according to that page, setting page_cluster to 3 allows 8 pages to be written in a single attempt of writing to the swap. for the other changes, I am not sure if changing the sampling_rate results in any difference other than reduced battery life...should I change it back to 2000000? I like my powersave_bias, my cpu seems to kick up frequency right when I need it to. I guess that is personal preference, and I might even be experiencing a little placebo effect with that change, but I've tried many settings there and 35 seems to work for me. not too far off from the default of 40.

so all in all, what are your opinions/thoughts of my changes? I'm not 100% sure the changes I've made are necessarily for the better, looking for input...
[G1 Android Development] tman7510:
cc backing vs swap file?

Whats the difference between cc_backing and a swap file. I thought cc_backing uses the swap partition setup on my sd card. If it uses the sd partition then what does the swap file use. Is it just a file that resides on the sd card that acts like a swap partition? What's the point in having 2 swap partitions. Why not just have one large swap that is equal to the amount of system ram wich is the standard config in linux.
[G1 Android Development] acidwashg1:
you are right in your assumptions. cc_backingswap_en=1 enables compcache to use your swap partition on your SD card as a backing swap. swap_file_en=1 will create a file on your SD card and use it as a swap. swap_file is for those who do not want to bother with partitioning their SD card. the point of both existing is that you have a CHOICE, only enable one. having both enabled is redundant. depending on your rom, I would recommend enabling compcache with a backing_swap, and even then, the backing_swap may not be completely necessary for you. I run with a backing_swap and I like it, but try it out for yourself and see how it works out for you. you can run linux_swap as well, which is a swap partition managed by the OS itself, whereas the backing_swap is managed by compcache.
[G1 Android Development] sacredsoul:
On xRom v1.5... And idea?
[G1 Android Development] miketaylor00:
I don't think you will be able to fix that. JAC will have an update shortly.
[G1 Android Development] ElChouch:
Same thing here with evilHero 2.3xx
[G1 Android Development] ElChouch:
Sorry my errors are not the same, here's what I get
[G1 Android Development] Parker777:
Is their anyone here that would be so kind as to help me out and tell me ifits possible to configure to the compcache + backingswap with swap file via better terminal ? And if so can you please tell me how to go about it or point me somewhere that might show me how. Iv installed already , i just have no clue as how to go about configuring it . I'm running Modaco 2.2 enhanced. Thanks to anyone who is kind enough to give a brother a hand and has the patience to help out a semi noob. Witch is probably worse than a just flat out noob ;) lol.

Seriously thank you
[G1 Android Development] miketaylor00:
I've had that exact error message. The dev loaded the wrong compcache modules in my case. Check with the dev.
[G1 Android Development] Chahk:
Small bug:

If you enable odex_all or odex_auto, it runs when you do "sh /system/sd/userinit.sh -s" in ADB or terminal.
[G1 Android Development] tman7510:
I'm currently running cyans 4.0.4 using compcache with backing using 96mb swap file and my android has never been so fast. I suggest you edit the user.conf with a simple text editor and then transfer the user.conf and userinit script to your sd card via usb. No need to use adb for somthing as simple as the userinit script. Then just copy it over to the correct directory using terminal app. :D
[G1 Android Development] tman7510:
just open the user.conf with a text editor like kedit or vim and read the instructions with each line. It is real simple..just change to 1 to enable and 0 to disable. There are also some example configs on the 1st page of this thread. After you make the changes just save the user.conf file and reboot your android. Thats all there is to it!:cool:
[G1 Android Development] stellarman:
@ Huanyu:

Can you please explain the useage of the custom user script function at the end of 'user.conf?' I assumed that I could put in that section shell commands that I wanted to have executed, but just putting the commands there didn't seem to work as I expected. I used cp commands to move AudioHack files from the /system/sd to the correct location in the ROM after they got over-written by a new ROM. But, the audio files somehow didn't get moved as I expected. I am guessing that there are some rules to use with your custom_script function that I don't know about, and that is why it is not working as I expected. Can you tell me how to do it right? I am sorry, but I don't read shell script well enough to read that section of userinit.sh and understand what the syntax should be.

I know from experience that I can simply add the commands I want to run at the end of the userinit.sh script, and have done that successfully in the past. But, I would like to be able to use your user.conf method instead. Can you enlighten me? Thanks in advance.
[G1 Android Development] Chahk:
You have to keep in mind that userinit.sh is executed as one of the very first scripts during boot time. Most likely neither /system/sd nor your destination are yet mounted. Also, as of CM v4.1 the SD card gets mounted later than it used to before.
[G1 Android Development] stellarman:
Hmmm..... I am still on 4.0.4. The userinit.sh script itself counts on /system being mounted in MANY different places in the script. And the userinit.sh file itself is being read from /system/sd/userinit.sh. So, I think it is safe to assume that the locations I am referencing are probably mounted. There must be something else going on that I don't quite understand. That's why I asked about syntax and usage.

Also, can anyone tell me whether the fix_permissions function in this script uses the newest, updated fix_permissions script from this thread LINK?, or the older, original version from Cyanogen?
[G1 Android Development] huanyu:
I can't notice any performance improvement, so i am thinking to remove this feature or disable by default. Plus CM does auto dex at startup.

Hum... can you show me your custom commands?

basically you can run any commands/ small scripts, for example, "test=1;if [ $test -eq 1 ]; then echo testing; fi" should output "testing"

It should run most of the commands/scripts as long as written in single line.

Alternative, you can write your own shell script, e.g myscript.sh store at /system/sd. All you have to do is add "sh /system/sd/myscript.sh" in user.conf

The purpose of /system being remounted is to enable read and write on that directory. The /system/sd is actually mounted by a2sd script.

the updated fix_permission should be better. this one is similar to cyanogen's.
[G1 Android Development] mcho19:
I'm using v0.1.5.3 on CM 4.1.9.2 and I'm trying to change my swappiness but it says I cannot set it to user specified at 30 and that it defaults at 60.

link to picture of my adb screenshot
[G1 Android Development] lycoln:
Here's a link THAT WILL fix this process for cm 4.1.9.2: THE FIX
[G1 Android Development] stellarman:
Thanks for your answers. Here is what I currently have in the custom commands area.

# custom shell commands, these commands run last
custom_shells{
busybox ln -s /system/sd/bin/bash /system/bin/bash # Symlink the bash shell so that the system can find it
busybox cp -pf /system/sd/bin/fix_permissions /system/bin/fix_permissions # Insert new fix_permissions script
busybox cp -pf /system/sd/etc/AudioFilter.csv /system/etc/AudioFilter.csv # Reset the AudioHack modifications
busybox cp -pf /system/sd/etc/AudioPara4.csv /system/etc/AudioPara4.csv
}

I haven't checked the above since I made a few changes (took out some comments or moved them to the end of the line). Previously, I had your example lines and a couple of other comment lines in between my commands. The part that I could tell wasn't working was the two lines at the bottom. They didn't cause the volume to be louder as expected, and provided an obvious clue. Now that Cyanogen has started putting Melthus' V7 audio hack into the ROM, I will probably remove those two lines anyway.

Thanks for your help.
[G1 Android Development] IRIE4IPIER:
this is the output i get when i sh /system/sd/userinit.sh -s from terminal emulator, why do i not get the results i see on the 1st post? i am running xROM 1.5r4. i hope i aint posting this in the wrong place. if someone would kinfly respond to me with a solution, PLEASE PM ME:

$ su

# sh /system/sd/userinit.sh -s

=== user.conf ===

*** general ***

apps2sd=1

media2sd=1

*** CompCache ***

compcache_en=1

cc_memlimit=8

cc_disksize=0

cc_backingswap_en=1

cc_backingswap=/dev/block/mmcblk0p3

swappiness=30

*** Swap File ***

swap_file_en=0

linux_swap_file_size=32

linux_swap_file=/system/sd/swap.file

*** Linux Swap ***

linux_swap_en=0

linux_swap_partition=/dev/block/mmcblk0p3

*** VM ***

sys_vm_en=0

page_cluster=0

laptop_mode=0

dirty_expire_centisecs=3000

dirty_writeback_centisecs=500

dirty_background_ratio=5

dirty_ratio=10

*** CPU ***

proc_cpu_en=0

scaling_min_freq=245760

scaling_max_freq=528000

sampling_rate=2000000

powersave_bias=200

up_threshold=40

=== CompCache status ===

CompCache version 0.6+

Compcache enabled

CompCache: MemLimit 16384(system) 8192(user)

CompCache: BackingSwap /dev/block/mmcblk0p3(system) /dev/block/mmcblk0p3(user)

!!! Unable to set compcache cc_swappiness to user specific "30"

Current system value is "28"

=== CompCache status output ===

BackingSwap: /dev/block/mmcblk0p3

DiskSize: 100564 kB

MemLimit: 16384 kB

NumReads: 1

NumWrites: 0

FailedReads: 0

FailedWrites: 0

InvalidIO: 0

NotifyFree: 0

PagesDiscard: 0

ZeroPages: 0

GoodCompress: 0 %

NoCompress: 0 %

PagesStored: 0

PagesUsed: 0

OrigDataSize: 0 kB

ComprDataSize: 0 kB

MemUsedTotal: 0 kB

BDevNumReads: 0

BDevNumWrites: 0

find: /system/app/*.odex: No such file or directory
[G1 Android Development] stellarman:
Looks to me as though you have compcache enabled, but that it didn't actually load. If it didn't, it can't change the swappiness. Also notice that all of your data about Compcache status shows 0%.

Does xRom1.5r4 use the same new kernal and stuff that Cyanogen release in 4.1.9.2? If so, compcache in that setup is not working and requires a patch file. Look back in this thread a post or two for info on that.
[G1 Android Development] grivad:
Works great! Seems to be working peachy on CM 4.0.4 using Linux-Swap only.

I set CPU min freq to 384000 -- should I revert back to 245760? What are the recommended settings for the CPU for a G1?

What is recommended for swappiness for using Linux-Swap only on a Class 6 SDHC?

BTW, typo in the script -- paratermers? ; )
[G1 Android Development] tee aiy emm:
For anyone who's interested in learning more about what those lines you're editing really mean:

http://www.redhat.com/docs/wp/performancetuning/rhel4_vm.pdf
[G1 Android Development] surfoni101:
Please i need help...... for about a week i have been trying to enable linux swap and compcache only but i have not been successful.. when i check by typing userinit -s it goes back to default with linux_swap=0 . Im running 4.0.4 with the prodigal sun theme...This is really frustrating. I will appreciate any help
[G1 Android Development] tee aiy emm:
When you ask for help, you need to provide information so people know what you're doing right and wrong.

How are you editing the script? Also, how are you pushing it to your phone? Do you reboot after pushing it?

You're also supposed to be editing user.conf not userinit.sh if that's what you're doing.