Compcache userinit.sh tutorial for Cyanogen 367

Search This thread

dixxa

Senior Member
Jul 30, 2007
353
12
Neuilly-Plaisance
why is the parameter incorrect ??


  1. Usage:
    • Loading: run 'use_ramzswap.sh [disksize(KB)|memlimit(KB)] [backing swap device]' to load all required modules and setup swap device.
you can have multiple parameters and those are good. I think...
 

overpower

Senior Member
Sep 15, 2008
60
0
[*]Loading: run 'use_ramzswap.sh [disksize(KB)|memlimit(KB)] [backing swap device]' to load all required modules and setup swap device.

Notice there is a '|' between the two parameters. That means 'or'. They are exclusive parameters. Either use disksize or memlimit. Of course, its not clear without reading the examples or source code which one to use when enabling the backing_swap. If you play around with them you will notice only memlimit seems to work with backing_swap.

Also, you're not using the script (use_ramzswap.sh) to load but manually loading the module (insmod).
 

h.nocturna

Senior Member
Oct 8, 2008
1,116
110
Hi guys, I'm trying to get this working on jacHEROski, so I was wondering if someone can post the modules required to get this working.

Btw, can I just push the modules to the directory and get it to work?

Thanks guys.
 
Last edited:

Noslice2002

Senior Member
May 22, 2007
130
3
Surprise
i have tried this everyway I can, but each time i get the cannot stat userinit.sh, no such file or directory message. it's driving me nuts. I can usually figure this stuff out by reading, but can't this time. Any suggestions?
 

h.nocturna

Senior Member
Oct 8, 2008
1,116
110
i have tried this everyway I can, but each time i get the cannot stat userinit.sh, no such file or directory message. it's driving me nuts. I can usually figure this stuff out by reading, but can't this time. Any suggestions?
Just means you're not typing in the location correctly and they can't find the file there. try re-typing/checking your location and making sure the file is there. Also, caps do matter.
 

yomamaster

Member
Jun 9, 2009
26
0
Audio Files

Can someone re-post the old userinit.sh or directions for moving the audio files so that the music application doesn't see them all?

I know there's a post elsewhere to describe how to do this, but I can't find it for the life of me.
 

h.nocturna

Senior Member
Oct 8, 2008
1,116
110
Where do lzo_decompress/compress.ko go?

Tried pushing xvmalloc.ko and ramzswap.ko to /system/modules/lib/2.6.29-cm/compcache/
now when I run the script it get:
insmod: init_module '/blah/xvmalloc.ko ' failed (Exec format error)

I get this error for ramzswap.ko as well. Any Ideas? thanks
 

stellarman

Senior Member
Feb 9, 2009
284
1
Clearwater, FL
My "goodcompress" reading has shown as 100% every time I have checked it in the past couple of days. Could that be right?? Everyone else is reporting 65 - 75%. All the other numbers seem to make sense. Any ideas?

<edit> BTW, I am using the userinit.sh script that sets up default size and backing_swap on my linux-swap partition, and swappiness = 20.</edit>
 
Last edited:

Ohsaka

Senior Member
Jun 8, 2009
754
70
I decided to nuke my phone tonight.
Repartitioned card, formatted, wiped, etc etc.

Lol, now check out what the internal memory widget reports for me in the screenshot below....
Only 3mb used up out of 74mb!

I used this line in my userinit.sh and 20 swappiness:
insmod /system/modules/lib/modules/2.6.29-cm/compcache/ramzswap.ko memlimit_kb=15360 backing_swap=/dev/block/mmcblk0p3


Here is what 'free' and 'cat /proc/ramzswap' report:
Code:
# free
free
              total         used         free       shared      buffers
  Mem:        97876        95468         2408            0         3348
 Swap:        24464         1656        22808
Total:       122340        97124        25216
# cat /proc/ramzswap
cat /proc/ramzswap
DiskSize:          24468 kB
NumReads:            248
NumWrites:           417
FailedReads:           0
FailedWrites:          0
InvalidIO:             0
PagesDiscard:          0
ZeroPages:            39
GoodCompress:         80 %
NoCompress:            3 %
PagesStored:         378
PagesUsed:           105
OrigDataSize:       1512 kB
ComprDataSize:       410 kB
MemUsedTotal:        420 kB
 

Attachments

  • memory.JPG
    memory.JPG
    32 KB · Views: 66

overpower

Senior Member
Sep 15, 2008
60
0
@innerspace
How do we test to see whether the backing swap partition is indeed active and doing its job? And how do we see how much/often it is being utilized?

Found the answer here.

In short, cat/proc/ramzswap will reference the backing_swap if it's there:

With backing 'cat /proc/ramzswap'
Code:
BackingSwap:    /home/ngupta/temp/swap.dd
DiskSize:        1048576 kB
MemLimit:         586524 kB
NumReads:              2
NumWrites:             0
FailedReads:           0
FailedWrites:          0
InvalidIO:             0
PagesDiscard:          0
ZeroPages:             0
GoodCompress:          0 %
NoCompress:            0 %
PagesStored:           0
PagesUsed:             0
OrigDataSize:          0 kB
ComprDataSize:         0 kB
MemUsedTotal:          0 kB
BDevNumReads:         18
BDevNumWrites:         0

Without backing 'cat /proc/ramzswap':
Code:
DiskSize:         977540 kB
NumReads:            112
NumWrites:             0
FailedReads:           0
FailedWrites:          0
InvalidIO:             0
PagesDiscard:          0
ZeroPages:             0
GoodCompress:          0 %
NoCompress:            0 %
PagesStored:           0
PagesUsed:             0
OrigDataSize:          0 kB
ComprDataSize:         0 kB
MemUsedTotal:          0 kB
 

jasherai

Member
Mar 4, 2009
26
0
diff between swapper and userinit.sh scripts

What is the different between userinit.sh and Swapper?

Hi Booker-T,

Swapper is an application that creates a swap file on your sd card (location configurable), and notifies the system that there is more memory space available. Swapper is also able to use a swap partition if there is one available.

The userinit.sh script is a script that can be used by users to make and changes they want at boot time. In this instance, you are talking about using this script to run the commands that will enable a swap partition.

The advantage of userinit.sh over the swapper app is that the userinit /should/ run earlier in the boot up sequence. And also you do not have to have an app installed to enable it. The downside, is the lack of easy UI for you to make changes. You should know what you are doing before editing one.

There are obviously a number of these out there... make sure you read the comments in the file so you know what the script is doing.

G'luck!

jasherai :cool:
 

innerspace

Senior Member
Jun 23, 2009
395
7
@overpower
well sh*t... then my backing swap isn't working. any chance you'd be willing to up your userinit file so I can compare it with mine and figure out what I'm doing wrong?

And thanks for the reply, that question has been bugging me for days.
 

jasherai

Member
Mar 4, 2009
26
0
@overpower
well sh*t... then my backing swap isn't working. any chance you'd be willing to up your userinit file so I can compare it with mine and figure out what I'm doing wrong?

And thanks for the reply, that question has been bugging me for days.

@innerspace
I don't think this is a problem with your config. Cynanogen is using a slightly older version which doesn't report this information. I have seen a request for newer versions of the module be included in the newer versions of his rom, but not heard any confirmation of this happening as yet. (perhaps another polite prod to him? ;) )

hth
jasherai
 

minus21

Member
May 24, 2009
8
2
Disk Size

Is changing the disk size in userinit.sh.txt to something like, say, 50mb, or higher dangerous? My phone has started to lag, presumably from the cache filling up. If not change the disk size, is there anything else I can do?
 
Our Apps
Get our official app!
The best way to access XDA on your phone
Nav Gestures
Add swipe gestures to any Android
One Handed Mode
Eases uses one hand with your phone