Compcache userinit.sh tutorial for Cyanogen 367

Search This thread

bkmo

Senior Member
Jun 25, 2008
1,890
226
10° 5' 59" North, 84° 16' 84" West
Here is a simple tutorial to get compcache ramswap running on the new Cyanogen 3.6.7 rom. Thanks to Cyanogen we now have a functioning swap that is fast and will not cause SSD wear.

Please make sure you have adb installed and functioning before you continue, as this tutorial will utilize adb to push the required files to the phone. Also your sd card should have a 500megish ext(2,3,4) partition as the second partition for this to work.

Download the userinit.sh.txt file attached here then:

Rename it to userinit.sh
create a directory c:\userinit
copy userinit.sh to c:\userinit
open CMD prompt
adb push c:\userinit\userinit.sh /system/sd
adb shell chmod 755 /system/sd/userinit.sh (not sure if needed being safe)
adb shell reboot

( This completes the compcache setup )

++++++++++++++++++++++++++++++++++++++++++++

To see if it is working enter: cat /proc/ramzswap in the terminal console app on the phone. You should have a XX% GoodCompress listed if it is working properly.


Hope this helps a bit. Please correct me if I made mistakes.

edit: re-uploaded the script with swappiness set to 60. You can re-push the new one the same way.

edit: removed media info from post and userinit.sh to simplify things.

edit: the following may help for those unable to get adb working. Make sure you place userinit.sh on the root of your sd (fat32 partition)
in terminal emulator:
su
mount -o remount,rw /dev/block/mtdblock3 /system
cp /sdcard/userinit.sh /system/sd
chmod 755 /system/sd/userinit.sh
 

Attachments

  • userinit.sh.txt
    267 bytes · Views: 3,408
Last edited:

endolin

Senior Member
Jan 21, 2009
85
13
thanks for the tutorial

thanks for the tutorial. one questions remains. how do we disable the sd-swap?
 

DOHCtor

Senior Member
Apr 10, 2009
1,109
121
Southern California
I just looked into your userinit.sh file. There's a line in there that seems to remove the media files from the phone memory. Why would you do that?
 

bkmo

Senior Member
Jun 25, 2008
1,890
226
10° 5' 59" North, 84° 16' 84" West
I just looked into your userinit.sh file. There's a line in there that seems to remove the media files from the phone memory. Why would you do that?
I didn't write the initial script so I can only speculate that it is clearing the directory that the os is looking in before linking it to the sd. I really have not pondered on it. It has been working fine on my phone ever since I implemented it though.
 

dwang

Senior Member
Nov 23, 2008
2,453
318
Yes but all those music files show up in the music app which is annoying.

This method gets rid of that problem.

Its not strictly neccessary but I wrote it for that reason

I know, but doesn't the phone auto search for it in those folders? I use ringdroid and it creates a fold hierarchy just like that already. Is it really neccessary to add the symlinks?
 

DOHCtor

Senior Member
Apr 10, 2009
1,109
121
Southern California
Yes but all those music files show up in the music app which is annoying.

This method gets rid of that problem.

Its not strictly neccessary but I wrote it for that reason

Actually, it doesn't if you put it in the media folder and within the media fold you have other sub folders (ringtone, notification etc.), which ringdroid already creates for you. Like I said, I don't understand the reason to do a symlink for them.
 

bkmo

Senior Member
Jun 25, 2008
1,890
226
10° 5' 59" North, 84° 16' 84" West
Yes but all those music files show up in the music app which is annoying.

This method gets rid of that problem.

Its not strictly neccessary but I wrote it for that reason

Hey, I almost forgot that you wrote it initially. I shared it here because I think it is a much cleaner way of putting the audio on sd. I now dont have to see all this junk in my music library. Great job on the script BTW