Jump to content


Photo

[MOD] Swap to /system & /data & /cache


  • Please log in to reply
11 replies to this topic

#1
kannasbor0

kannasbor0

    Regular

  • Members
  • PipPip
  • 69 posts

Hi everyone!

 

I made an init.d script, which creates 3 swap files (85 MB each), first in the /system, second in the /data, third in the /cache, and they significantly boost multitasking performance, becuse they're working in parallel mode.

 

I am using CM 10.1, but I think it it works with all roms.

 

You have to install busybox 1.20.2 from stericson with the pro app (I can't post it, because it's a paid app), because the other versions can't use swap files in parallel mode (the swapon applet does't have "-p" parameter, to set priorities, so the script exits, and doesn't create swap files), which is the main advantage of this script.

 

The script set swappiness to 90 ,removes and recreates the swap files at boot, so the boot time increased to 3 mins.

If you delete the "rm .../swap*.img" from the script, it will not deletes the files, so the boot time will be normal.

The matter why I remove, then recreate the files is that they dont't stress the specific part of the eMMC in this way.

 

Usage:

Backup your current rom.

Install busybox 1.20.2.

Copy 02Swap2SysDataCache file to /system/etc/init.d folder, and set permissions to 755 (rwxr-xr-x).

Reboot (2,5-3 mins each boot).

Enjoy!

 

You can check swaps with "cat /proc/swaps" command, if they have the same priority, you're done. :-)

Attached Files


  • 1

#2
anotherjib

anotherjib

    Newbie

  • Members
  • Pip
  • 48 posts
  • Gender:Male
  • Devices:huawei ascend y300-0100

 

You can check swaps with "cat /proc/swaps" command, if they have the same priority, you're done. :-)

 

It shows /dev/block/zram0 which is a partition with priority -1 and three files /system/swap1.img, /data/swap2.img and /cache/swap3.img all with priority 1

 

Does this mean all is well? :))


  • 0

#3
kannasbor0

kannasbor0

    Regular

  • Members
  • PipPip
  • 69 posts

It shows /dev/block/zram0 which is a partition with priority -1 and three files /system/swap1.img, /data/swap2.img and /cache/swap3.img all with priority 1

Does this mean all is well? :))

Yep, it's working! :)
I suggest you to disable zram (add a ".txt" extension to the name of the zram the script in the init.d folder), it stresses the cpu, so eats your battery.

Edit: Please give me feedback, does it boost your multitasking performance?

Edited by kannasbor0, 03 May 2014 - 08:14 AM.

  • 0

#4
anotherjib

anotherjib

    Newbie

  • Members
  • Pip
  • 48 posts
  • Gender:Male
  • Devices:huawei ascend y300-0100

Yep, it's working! :)
I suggest you to disable zram (add a ".txt" extension to the name of the zram the script in the init.d folder), it stresses the cpu, so eats your battery.

Edit: Please give me feedback, does it boost your multitasking performance?

Sorry for belated answer, was busy these days.

 

Could you please explain in more detail? In /system/etc/init.d I have files 00banner, 50selinuxrelabel, 90userinit, and your script. Which one do you mean?

 

And yes it helps a lot! Antutu went from 5731 to 7749!

 

P. S. In the thread http://www.modaco.co...ap-zram-fstrim/ Victod proposes to use the command

swapoff /dev/block/zram0

May I just add this line to your script?

 

P. P. S. Question obsolete, already managed to disable zram and installed fstrim, antutu now says 7777


Edited by anotherjib, 06 May 2014 - 10:25 AM.

  • 0

#5
kannasbor0

kannasbor0

    Regular

  • Members
  • PipPip
  • 69 posts
Sorry, i was busy too with my job and my exams...
Glad to see that it helped! :)

  • 0

#6
anotherjib

anotherjib

    Newbie

  • Members
  • Pip
  • 48 posts
  • Gender:Male
  • Devices:huawei ascend y300-0100

Forgot to specify - mine is slimkat 4.9 http://www.modaco.co...icial-05052014/

Created no problems so far


  • 0

#7
porozex

porozex

    Regular

  • Members
  • PipPip
  • 74 posts
  • Devices:Huawei Y300-0100

works perfectly thx :)


  • 0

#8
kannasbor0

kannasbor0

    Regular

  • Members
  • PipPip
  • 69 posts

works perfectly thx :)


You're welcome! :-)

  • 0

#9
SH3H1

SH3H1

    Addict

  • Members
  • PipPipPipPipPip
  • 954 posts
  • Gender:Male
  • Devices:Huawei Ascend Y300-0100
What to do with the busybox file?

  • 0

#10
porozex

porozex

    Regular

  • Members
  • PipPip
  • 74 posts
  • Devices:Huawei Y300-0100

What to do with the busybox file?

you must install it with the pro app in the market


  • 0

#11
tarinka

tarinka

    Newbie

  • Members
  • Pip
  • 30 posts
  • Devices:huawei y300
  • Twitter:@zoka

Can you write to me step by step how to install this script, because i have installed this http://www.modaco.co...ith-all-phones/. How to remove and install yours. I don't understand where to type this command   "cat /proc/swaps" command. Thnx in advanced, i use slimkat 5.9


  • 0

#12
anotherjib

anotherjib

    Newbie

  • Members
  • Pip
  • 48 posts
  • Gender:Male
  • Devices:huawei ascend y300-0100

Can you write to me step by step how to install this script, because i have installed this http://www.modaco.co...ith-all-phones/. How to remove and install yours. I don't understand where to type this command   "cat /proc/swaps" command. Thnx in advanced, i use slimkat 5.9

You can enter "cat /proc/swaps" in (for example) Android Terminal Emulator. You can also use it to set permissions for the script.

First you must have busybox installed (and of course you must have root access).
Unzip the script anywhere on your phone;
Find it with simple explorer and copy it to the /system/etc/init.d folder
Now run terminal emulator; you will get a black window with "something@someotherthing:/ $"
Type su root (enter)
You must get "yetanotherthing #"
Type cd /system/etc/init.d (enter)
Type chmod 755 02Swap2SysDataCache (enter)
Reboot
To check if the script works - run terminal emulator again and type cat /proc/swaps
It must list three swap files (in /system, /data and /cache folders)

As for uninstalling the swapdragon script - I think the right way is to ask them for a flashable uninstall zip. Their script writes several things to build.prop and somewhere else and it is impractical to change them back by hand.

  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users