yashsingh1/xdaforums huggingface dataset:
[G1 Android Development] norrback:
I took a new sd card (class 4) put into my G1 with newest radio and spl. made new partitions (fat32 0-3400 ext2 3400-3900 linux-swap 3900 - 3964 ). upgraded to ext3. Installed Modaco 2.2, http://android.modaco.com/content/h...-09-2-2-modaco-custom-rom-hero-to-dream-port/

Unzipped the newest "userinit_V0.1.5.3.zip " files to sdcard. Followed the guid on first page. cp to /system/sd and chmod, no erros. when I print reboot I get "not permitted". Does that mean something? I quited terminal emulator, powered off, restart and back to terminal emulator. And this is my output on sh /system/sd/userinit.sh -s:

Any more info needed to give me a solution?

/Andre'
[G1 Android Development] surfoni101:
took a while but finally got ti right...
[G1 Android Development] norrback:
Exactly same error output as for me...

/Andre'
[G1 Android Development] yeticomes:
I get also this error wit Modaco 2.2:

!!!ERROR Compcache disabled

=== CompCache status output ===

Failed to open /dev/block/ramzswap0: No such file or directory

Here is my user.conf with 64MB linux-Swap partition (worked as swap with JAC Hero):

# General parameters
general{
apps2sd=1	# this is useless here, require a modified a2sd script
CONF_FILE="/system/sd/user.conf"	#location of user.conf
media2sd=1	# moves the medias to sd if /system/sd/media exists
permission_fix=0 # perform permission fix at start up (this parameter sets to 0 after script is executed)
odex_auto=1	# perform auto create or del odex for applications installed or removed within 3 days
odex_apk=0	# creates odex for apk that does not have odex yet (this parameter sets to 0 after script is executed)
odex_all=0	# creates odexes for all apks (this parameter sets to 0 after script is executed)
}

#compcache related parameters
compcache{
compcache_en=1	# enable(1) or disable(0) compcache
cc_disksize=0	# Ram swap disksize - any number between 1 to 95 should work; default is 1/4 of the RAM (24)
cc_memlimit=8	# Limit the memory usage for backing swap (cc .5x known issue-defaults to 15% of total RAM)
cc_backingswap_en=1	# enable(1) or disable(0) backing swap
cc_backingswap=/dev/block/mmcblk0p3 # pointing to the backingswap partition device, swap
cc_swappiness=60 # default 60
}

#create swap file for compcache or linux swap
swap_file{
swap_file_en=0	# set to 1 to create swap file
# set to 0 to del the swap file
linux_swap_file_size=32	# swap file size in MB
linux_swap_file=/system/sd/swap.file	# pointing to the swap file location ( must be /system/sd/)
}

#Linux swap parameters
#
# linux swap can only be enabled if cc_backingswap_en is set to "0"
#
linux_swap{
linux_swap_en=0	# enable(1) or disable(0) linux swap
linux_swap_partition=/dev/block/mmcblk0p3 # swap partition device
swappiness=60 # default 60
}

#virtual memory
sys_vm{
sys_vm_en=0	# enable(1) or disable(0) virtual memory configurations
page_cluster=0	# default 3, (0 since CM3.9.6+)
laptop_mode=0	# default 0
dirty_expire_centisecs=3000	# default 3000
dirty_writeback_centisecs=500	# default 500
dirty_background_ratio=5	# default 5
dirty_ratio=10	# default 10
}

#cpu clock
proc_cpu{
proc_cpu_en=0	# enable(1) or disable(0) user cpu configurations
# freqency options
# 19200
# 122880
# 128000
# 245760
# 384000
# 528000
scaling_min_freq=384000	# default 245760
scaling_max_freq=528000	# default 528000
sampling_rate=2000000	# default 2000000 depending on kernel version
powersave_bias=200	# default 0, (200 since CM3.9.6+ )
up_threshold=40	# default 40, percent cpu usage before going up a speed step
}

# custom shell commands, these commands run last
custom_shells{
#echo "Hello!!!" # example
#echo "You can create your own cmmands here" # example
}
[G1 Android Development] gohaneri:
Anyone use a modded user.conf into cm 4.1.11 ?

With 4gb class 6 what is the best solution for best performance?

32mb swap, ext4 500mb, 2,5 gb fat32
[G1 Android Development] caleoss:
my exact set up also, what is best swap set up? i have no idea how to do all this stuff
[G1 Android Development] prince.siraj:
it would probably be something like 30 swappiness. i would also recommend possibly trying with a 64mb swap partition and see if it makes a difference. i tried with 64mb and 80 swappiness (my hero settings) and DEFINITELY doesn't work well... so at least lower swappiness. you should be fine with a 32mb partition though
[G1 Android Development] gohaneri:
And a solution for a non hero rom?
[G1 Android Development] charlus:
Hello,

I've tried the latest version on my 4.1.11.1 cyanogen ROM on a French HTC Magic.

However it appears that userinit.sh is not being run at startup.

I'm seeing the following error as the first line of adb logcat during boot :

I//system/bin/sh( 54): +++ Welcome to Android 1.6 / CyanogenMod-4.1.11.1

I//system/bin/sh( 54): vm.page-cluster = 0

I//system/bin/sh( 54): --- Loading kernel modules

I//system/bin/sh( 54): [: 1: unknown operand

I/logwrapper( 54): /system/bin/sh terminated by exit(0)

For me it might very well the cause of my problem. Has anyone else seen this problem ?
[G1 Android Development] AndroidFiend:
i setup linux swap with compache does this mean i have 60 swappiness for linux swap?

Linux swap: swappiness - 30(system) 30(user)
[G1 Android Development] prince.siraj:
no it just means your system and user settings match and shows them to you side by side
[G1 Android Development] AndroidFiend:
I'm being serious unless your not being sarcastic because I'm trying to have 60 swappiness
[G1 Android Development] kaotikking:
he is serious !!!
[G1 Android Development] AndroidFiend:
Lol ok....I'm just trying to figure this out I have 64 mb linux swap partition but set up the user.conf & userinit.sh to have compache& linux swap with 60 swappiness and I just want to know if I have 60 swappiness since 30(system) 30 (user) equals 60 just want to be sure. Yes iam a noob just started messing around with this yesterday
[G1 Android Development] tee aiy emm:
You don't want to use both compcache AND linux swap, that slows down your phone, so pick one depending on what's recommended for the rom you're using.

30(system) means that that's the current swappiness. 30(user) means that's the swappiness defined in your user.conf. If they match up, which they do, then that's a good thing.

If you're trying to set the swappiness to 60, you need to edit the user.conf and then push it back to your phone. You'll see 30(system) 60(user) UNTIL you reboot your phone. After you reboot, you should see 60(system) 60(user) if everything went smoothly

Hope that made sense for you :)
[G1 Android Development] Vlad83:
The swappiness setting is not a number represented in MB, it has nothing to do with storage. Its values range from 0 to 100 and it represents how aggressively applications or whatever else gets swapped out from physical ram amd into to your backing swap or linux swap (which is not recommended with CC) Don't go past 60 on cupcake ROMs in my experience.

Check out this thread: http://xdaforums.com/showthread.php?t=547752

The beginning is not that important but they go into details of CC, linux swap, VM, etc. You can learn a lot. Plus you can use Miketaylor's user.conf, it has good settings...
[G1 Android Development] jabbawalkee:
Getting some errors. I want compcache enabled and these settings:

LS - enabled (by default)

CC - enabled (by default)

back_swap - disabled (by default)

LS swap - 60 or 80

CC swap - 60

Swap partition size - 128MB

CPU sampling - disabled (by default - use Overclock Widget or SetCPU instead)

ODEX - set to ALL (offers a "speed boost" from matching the files)

But I'm getting errors and not exactly sure how to change the settings (on my mac). I do know how to do adb though. Can someone help please? By the way I am on MoDaCo custom hero 1.5.1. This is what I get when I check the settings:

mack-kaswells-macbook-air:tools Mack$ adb shell sh /system/sd/userinit.sh -s

=== user.conf ===

*** general ***

apps2sd=1

media2sd=1

*** CompCache ***

compcache_en=1

cc_memlimit=16

cc_disksize=32

cc_backingswap_en=0

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+

rzscontrol: 1: Syntax error: "(" unexpected

!!!ERROR Compcache disabled

<4>[ 170.367584] ramzswap: Unknown symbol xv_destroy_pool

<4>[ 170.377288] ramzswap: Unknown symbol xv_get_total_size_bytes

<4>[ 170.385833] ramzswap: Unknown symbol xv_create_pool

<4>[ 170.392669] ramzswap: Unknown symbol xv_malloc

<4>[ 170.398742] ramzswap: Unknown symbol xv_free

<4>[ 170.404418] ramzswap: Unknown symbol xv_get_object_size

<6>[ 170.521697] ramzswap: NUM_DEVICES not specified. Using default: 1

<6>[ 170.528015] ramzswap: Creating 1 devices ...

rzscontrol: 1: Syntax error: "(" unexpected

CompCache: DiskSize (system) 32768(user)

CompCache: cc_swappiness - 30(system) 30(user)

=== CompCache status output ===

rzscontrol: 1: Syntax error: "(" unexpected
[G1 Android Development] crypticc:
Hi all. Sorry to bump an old post. Did this ever get answerd as i too am intetested in what this does and if it helps.

Thanks

Chris
[G1 Android Development] lwick74:
I'm running mac also

I'm running mac also but I keep getting linux swap error. I edit the user.conf with text wrangler, adb push to the sdcard, then run this in adb shell:

dos2unix /sdcard/user.conf

su

mount -o remount,rw -t yaffs2 /dev/block/mtdblock3 /system

cp /sdcard/user.conf /system/bin

chmod 755 /system/bin/user.conf

mount -o remount,ro -t yaffs2 /dev/block/mtdblock3 /system

I'm trying to run:

CC 1

LS 1

CC swappiness 60

LS swappiness 80

my sh system/bin/userinit.sh -s :

My user.conf
[G1 Android Development] skrki:
@jabbawalkee

I had similar issues, but with Modaco 2.2. and was unable to turn on compcache through userinit..

So, you have to figure out first, how to execute userinit on device startup.

It is my experience that /system/sd is not the right place to put these files, and I have read in different posts that Hero ROMs use /system/bin for them.. However, I never succeeded in executing userinit.sh automatically, even after placing them (user.conf also) into /system/bin.

What I did is to run it manually, after the system starts, either through shell, or you may try to use an application called Autostart. What it does is it allows you to create a script which is executed after boot, so you could place the following into it to run userinit.sh manually:

sh /system/bin/userinit.sh -s

BUT.... It is also my experience that Hero ROM wouldn't "remember" the swap partition (that you should normally create only once), so I ended up having to create and turn on swapping each time I rebooted my phone. I thought it would be neat to place it in the userinit.sh, so I don't have to type it each time. Here is how my userinit.sh looked after I modified it:

[I].... only execution portion, definitions are untouched[/I]

#main program
#Custom, added for Modaco 2.2
modprobe ramzswap
rzscontrol /dev/block/ramzswap0 --init
swapon /dev/block/ramzswap0
# End Modaco 2.2
parse_args $*
GET_USER_CONF;
USER_CONF_CHECK;
SYS_INFO;

MEDIA2SD;
SWAPFILE_CHK;
COMPCACHE;
LINUXSWAP;
SET_VM;
SET_CPU;
FIX_PERMISSIONS;
ODEX_GEN;
AUTO_ODEX;
USER_CMD;
symbolic_link;
mount -o remount,ro /dev/block/mtdblock3 /system
exit 0;

These commands do the compcache initialization and switch on swap:

modprobe ramzswap
rzscontrol /dev/block/ramzswap0 --init
swapon /dev/block/ramzswap0

Check the status of the swap, and level of compression with:

rzscontrol /dev/block/ramzswap0 -s

If this gives you any output, then your compcahe is on, if you get an error about /dev/block/ramzswap0, then there is a problem.

Also, attention to you and lwick74: Compcache and Linux swap do not mix well! Use CC with backing swap, or use Linux swap on it's own. Search XDA for more details, it has been mentioned and elaborated many times. I have performed benchmark tests on my device, and I can confirm what's been said about it.

Good luck!
[G1 Android Development] fl3xo:
i need some information on compcache and how to set the memlimit:

no way to increase the memlimit over 14720 kb?

i do not understand the two different values for (system) and (user), anyone can explain?

PS: if /system is mounted as rw, userinit.sh -s fails to complete.

this is a simple issue that can be corrected easily...
[G1 Android Development] miketaylor00:
If you try to set your memlimit higher than your swap size it will set it to the default setting. Also, I wouldn't use swap file. The last time I tested it, it corrupted my ext partition. There is a patch for it but I haven't been able to test it yet.
[G1 Android Development] fl3xo:
I set the memlimit exactly the swap size (50) . Do u think that a memlimit of 49 will be ok? I'm usimg last cyan 4.1.999 and compcache works great. Some difficulties encountered enabling backing swap at 1st boot, i resolved disabling it and erasing swap.file, rebooting and enabling another time.

UPGRADE 8-10

No chance to set the memlimit over 14mb, only lower values. Any ideas?

UPGRADE 8-10

these steps resolved the problem for me:

- set in user.conf:

- execute in windows terminal adb shell sh /system/sd/userinit.sh -s and ignore all errors

- reboot

- set in user.conf:

- execute in windows terminal adb shell sh /system/sd/userinit.sh -s and ignore all errors

- reboot

- finally set in user.conf:

- execute in windows terminal adb shell sh /system/sd/userinit.sh -s

For now (7:28PM) cellphone is quite fast (benUchmarkPI 13989 msec) and i can load 5 pages of xda-developers without reloading.

I will post something tomorrow about slowness after the 12hours...

UPGRADE 9-10

Its 2:40 PM, no relevant changes in slowness (benchmark PI 15209), the browser visualize always 5 pages without reloading. I reboot and do a filesysytem check and an e2fsck: no problem of corruption. I woul remember that ive a chubby class 2 microSD!

Ive noted reading the entire thread that people do not reboot after an userinit.sh -s: usually rebootong will solve all the common problem ive read.
[G1 Android Development] rikupw:
cyanogenmod 4.1.9999 fix!

managed to get it working on the latest cyanogenmod, here it is, i removed the odex strings because well... they cause problems now.

http://grenslivia.mine.nu/~riku/o-riku/bin-script/userinit_V0.1.5.4.zip

the modules were incorrect on the 1.5.3 version, cyanogen had changed them I believe to ramzswap, xvmallok doesn't exist anymore. and also I updated the fix_permissions program to reflect the latest 1.31 version.

perhaps an update is in order?

PS THIS WORKS FOR CYANOGENMOD 4.1.9999! NOT TESTED AN ANY BUILDS OLDER!

:) i'm sure it probably won't anyway
[G1 Android Development] :
anyone got this working on cyanogen 4.1.9999 yet? no compcache for me when i use compcache in userinit
[G1 Android Development] :
Found it

Thanks for posting it in the wrong thread kbrighton :)
[G1 Android Development] matthian:
Downloaded the http://grenslivia.mine.nu/~riku/o-ri...t_V0.1.5.4.zip but still got:

=== CompCache status ===

CompCache version 0.6+

!!!ERROR Compcache disabled

Now modified the userinit.sh:

Now Compcache activated. So far I do not feel a difference to my past config with compcache disabled running only with linux_swap. Will see how it goes over the day.

Matthias
[G1 Android Development] nyijedi:
Thanks so much for your settings. I tried these on my G1 and everything is running great - much better than CC + BS. Thanks a lot!
[G1 Android Development] ShatBag1105:
A great way to easily edit and push these files.>>>http://www.cyrket.com/package/com.protocol.x.su.fbs

Keep a copy of these files on your sd. Easily edit them and copy paste them over to system/sd. It has a built in terminal emulator for chmodding. I love this app, especially now. Changing these settings is a breeze :)
[G1 Android Development] Xidroid:
Here's what I'm trying to do if you can help. I think I'm trying to do the same thing as motivecc. I have a MyTouch 3G (32B) and I am on CM 4.1.9999. My SD card has a Fat32 and a linux swap partition. I don't want apps2sd because I have plenty of memory on the phone for what I do. I'd like to disable compcache and enable linux swap but I can't use the userinit.sh because I have no ext partition.

Is there another way to set it up without the ext partition?

Thanks for any help.
[G1 Android Development] Archont:
Maybe the following trick could help:

1. create the folder /system/sd in the phone's memory

2. put the two files there and set the correct permissions

3. reboot and see that happens

If that does not work try putting the files anywhere on the phone and run them manually after a reboot.

Please report back what happened!
[G1 Android Development] Xidroid:
I've done that. I can push the files into /system/sd and they will be sitting there. I can usually chmod them too. But if I run them they return errors. "File can't be found" or something similar. When I reboot, the files aren't there.

I ran the files manually once and it rebooted the phone and they weren't there afterward.

If there was a way of disabling CM's apps2sd I would create a small ext partition for this kind of thing.
[G1 Android Development] bkmo:
The easiest way to disable aps2sd is to remove the script from /system/etc/init.d . You can also modify the compcache script to be a linux swap script.
[G1 Android Development] Xidroid:
I'm a noob but I can manage to delete a file. What are the unintended ramifications for removing that script? I'm not at a level where I can modify scripts.
[G1 Android Development] acidwashg1:
so what kind of changes do you guys think are in order for user.conf on cyanogen 4.2? I just installed it, I have a 64mb linux-swap running right now and its running pretty snappy. I've heard rumors about compcache causing some funkyiness, I suspect thats why cyanogen disabled it by default. However, I'm still really interested in compcache with a backingswap because I've had the best performance with that config in previous cyan builds. Using v0.1.5.3 right now but gonna move to v0.1.5.4 a few posts back so I can get compcache up and running.
[G1 Android Development] traspler:
two little questions:

When I set the the cpu scaling parameter to 0, will this also disable the cpu scaling which cyanogen enabled in his rom? So I don't have any scaling?

When I have a linux-swap partition on my microSDHC, and want to use linux swap, do I have to/should I set the swap_file_en parameter to 1?

Thank you
[G1 Android Development] simms22:
cm 4.2.1 compcache

this is what i did to get it working . but after a reboot , it has to be done again..

http://androidcommunity.com/forums/261660-post342.html

i am noy going to provide a userinit.sh , im sure we can all find one if you dont already have one . anyways , this is how i did it . in terminal....

su

modprobe ramzswap

rzscontrol /dev/block/ramzswap0 --init

swapon /dev/block/ramzswap0

to check , in terminal ....

su

rzscontrol /dev/block/ramzswap0 -s

enjoy
[G1 Android Development] :
can someone smarter than me fix and post a script for 4.2.1
[G1 Android Development] terence_oh:
3 partitions: FAT32+App2ST Ext4 + Linux Swap?

Hi,

Through the use of other ROMS on my ADP, I have ended up with the following partitions on my 8 GB SD Card:

a) a 7+ Gb FAT32 partition (partition 1)

b) a 500mb ext4 partition (partition 2)

c) a 128mb Linux-swap partition (partition 3)

I have Cyan 4.2.1 installed and running smoothly (upgraded from HTC OTA+cyan4.1.9999), but am curious about whether I need to apply a custom userinit.sh file to ensure that

a) app2sd is using the ext4 partition

b) the full 128mb on my 3rd partition is being utilized for the linux swap

I have no issues with leaving compcache disabled as per cyanogen's release, simply in the interest of stability.

Any pointers would be deeply appreciated.
[G1 Android Development] sagementor:
This was what Cyan said about his 4.2.1

Cyan uses an ION. I just wonder if my Dream will be faster with userinit.sh.
[G1 Android Development] wesgarner:
CompCache Swapfile in data parition

Has anyone thought to use CC Swapfile in the data partition (on Magic/MT3G because of their extra space)? This would be much faster than swapping to the SD, would it not?
[G1 Android Development] terence_oh:
Thanks to tjhart85 , I have put in a working user.conf, and 'free' in terminal emulator shows that 128mb of Linux Swap is enabled. I do still have a couple more questions:

A) I'm pretty sure the Linux swap is being taken out of my app2sd partition, as 'SD card & phone storage' under 'Settings' show this:

SD card secondary

Total space: 447MB

Available space: 203MB

Before the change, the Available space was exactly 128MB more....

B) I tried checking the status of the script through the following:

sh /system/sd/userinit.sh -s

All looks ok, till the section on the Linux swap, as follows:

=== Linux Swap status ===
Linux SWAP enabled on /dev/block/mmcblk0p3
Linux Swap: swappiness - 60 (system) 60(user)
--- dexopt-wrapper /system/app/BugReport.odex
Unable to create '/system/app/BugReport.odex': Read-only file system
--- dexopt-wrapper /system/app/EnhancedGoogleSearchProvider.odex
Unable to create '/system/app/EnhancedGoogleSearchProvider.odex': Read-only file system
.
.

The 'dexopt-wrapper' error message goes on and on through my list of standard Google apps. Should I be worried, and should I be taking corrective action?

C) These are my user.cof settings, specific to the Linux swap. I had assumed '/dev/block/mmcblk0p3 ' was the correct location for my third partition. However, the code to create the swap file points to '/system/sd/', which app2sd uses, and probably explains what I am seeing. Is there another location to do this with, or should I just merge my last 2 partitions?

#create swap file for compcache or linux swap
swap_file{
swap_file_en=1 # set to 1 to create swap file
# set to 0 to del the swap file
linux_swap_file_size=128 # swap file size in MB
linux_swap_file=/system/sd/swap.file # pointing to the swap file location ( must be /system/sd/)
}

#Linux swap parameters
#
# linux swap can only be enabled if cc_backingswap_en is set to "0"
#
linux_swap{
linux_swap_en=1 # enable(1) or disable(0) linux swap
linux_swap_partition=/dev/block/mmcblk0p3 # swap partition device
swappiness=60 # default 60
}
[G1 Android Development] terence_oh:
Hi,

tjs3783's user.conf posted in the cyanogen 4.2.1 thread solved my problems.

Essentially, the only difference is that

swap_file_en=0

So the swap file on my ext4 partition was deleted, freeing up all space in the app2sd partition, yet the 128MB linux-swap partition was fully activated, which I verified via 'free' in terminal emulator.