Jump to content

[ROMs with init.d support] Using swap in the /cache partition (modified version of kedazo's topic)


Guest shadowprince94
 Share

Recommended Posts

So, kedazo put the swapfile in /data, but I read other topics and forums, and decided to put swap into /cache, because it's unused. Here's the way:

 

Connect your phone to PC (debug on), open a cmd window and navigate to the folder, where the adb.exe file is. Then type:

 

adb shell [enter]

su [enter]

 

You have to see a '#', type:

 

# dd if=/dev/zero of=/cache/swapfile bs=1048576 count=200 [enter] (I use 200 mb of swap, it can be modified)

# mkswap /cache/swapfile [enter]

 

Then you have to extract and push the script I attached to /system/etc/init.d with adb push.

Finally, you have to set permissions and start the script. It can be done manually with a root explorer eg. ES File Manager, or from adb shell typing this:

 

adb shell [enter]

 

su [enter]

# chmod 0777 /system/etc/init.d/userinit.sh [enter]

# /system/etc/init.d/userinit.sh [enter]

 

And then you can check what you did:

 

adb shell [enter]

su [enter]

#free [enter]

 

In swap, you have to see the size of swap you created. It has to work on every rom supporting init.d

userinit.zip

Edited by shadowprince94
Link to comment
Share on other sites

  • 9 months later...

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.