Jump to content


Photo

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

- - - - -

  • Please log in to reply
2 replies to this topic

#1
shadowprince94

shadowprince94

    Newbie

  • Members
  • Pip
  • 7 posts
  • Gender:Male
  • Location:Budapest
  • Devices:ZTE Blade III

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

Attached Files


Edited by shadowprince94, 03 November 2013 - 10:46 AM.

  • 0

#2
rushikeshshelke

rushikeshshelke

    Newbie

  • Members
  • Pip
  • 1 posts
its not working....

  • 0

#3
rickywyatt

rickywyatt

    Hardcore

  • Moderator Team
  • PipPipPipPipPipPip
  • 1,491 posts
  • Gender:Male
  • Location:London UK
  • Interests:Android
    Rom Modding &
    MoDaCo moderator
  • Devices:OneX Samsung S3 LTE Nexus 7
  • Twitter:@rickywyatt1982
Extract this to system/init then reboot everything is done automatically

Attached Files

  • Attached File  swap.zip   535bytes   30 downloads

  • 0
Remember to read the fourm rules<br /><br />Maker of the AIO tool for Orange San Diego here<br />and the maker of the Motorola Razr I AIO tools here




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users