• Announcements

    • Reminder - MoDaCo position on illegal content   07/30/15

      ILLEGAL CONTENT I'd like to just reaffirm MoDaCo's position regarding piracy and illegal content in the light of some recent questions / postings. Posts will be censored by myself or my moderation team if the contain or link to: Illegal / pirated / cracked software or sites that host such softwareNintendo emulators / ROMs or sites hosting them (in light of Nintendo's legal stance)CUSTOM ROMS You may discuss and post links to custom device ROMs on MoDaCo, provided the following rules are adhered to: ROMs must not contain any illegal 3rd party software (this includes trial versions included without permission)ROMs must give full credit to the original authorISSUES If you have any issues with this policy, please contact PaulOBrien directly via PM.
    • Reminder: Selling items on the forum directly is not allowed   07/30/15

      Please note that selling items on the forum directly is not allowed by the forum rules. There is a forum for eBay auctions whereby you can list the items on eBay and link to them there. This is the ONLY forum for this type of activity. You may also advertise links to the eBay forum in your signature. Please note that selling directly in contravention of these rules will result in a warning / suspension / ban.

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

33 posts in this topic

Posted (edited)

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. :-)

Luca020400 made a flashable zip, download, and enjoy!

Thanks again luca! :)

Flashable zip

Swap2SysDataCache.zip

Edited by kannasbor0
1

Share this post


Link to post
Share on other sites

Posted

 

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

Share this post


Link to post
Share on other sites

Posted (edited)

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
0

Share this post


Link to post
Share on other sites

Posted (edited)

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.com/topic/370237-all-modother-disableenable-swap-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
0

Share this post


Link to post
Share on other sites

Posted

Sorry, i was busy too with my job and my exams...

Glad to see that it helped! :)

0

Share this post


Link to post
Share on other sites

Posted

works perfectly thx :)

0

Share this post


Link to post
Share on other sites

Posted

works perfectly thx :)

You're welcome! :-)

0

Share this post


Link to post
Share on other sites

Posted

What to do with the busybox file?

0

Share this post


Link to post
Share on other sites

Posted

What to do with the busybox file?

you must install it with the pro app in the market

0

Share this post


Link to post
Share on other sites

Posted

Can you write to me step by step how to install this script, because i have installed this http://www.modaco.com/topic/371894-mod-rom-dragonsphere-team40-442-swapdragonx-boost-your-android-to-the-limitversion-1works-with-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

Share this post


Link to post
Share on other sites

Posted

Can you write to me step by step how to install this script, because i have installed this http://www.modaco.com/topic/371894-mod-rom-dragonsphere-team40-442-swapdragonx-boost-your-android-to-the-limitversion-1works-with-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

Share this post


Link to post
Share on other sites

Posted

I've just noticed that your script ceased to create the first swap file (in /system); the other two are there but this one is missing.

All three were there earlier but now only the second and the third appear. Do you know what to do? I've updated ROM several times (I have slimkat for u8833 (Huawei y300-0100)) but I did not notice after which update did it happen. Right now I'm on 6.6. Antutu is worse than before - 7540

0

Share this post


Link to post
Share on other sites

Posted

I've just noticed that your script ceased to create the first swap file (in /system); the other two are there but this one is missing.

All three were there earlier but now only the second and the third appear. Do you know what to do? I've updated ROM several times (I have slimkat for u8833 (Huawei y300-0100)) but I did not notice after which update did it happen. Right now I'm on 6.6. Antutu is worse than before - 7540

An update to the quoted question: my slimkat is currently 7.0, still the same problem. When I run the script manually then it works well - does create the system swap file. Any suggestions?
0

Share this post


Link to post
Share on other sites

Posted

An update to the quoted question: my slimkat is currently 7.0, still the same problem. When I run the script manually then it works well - does create the system swap file. Any suggestions?

Maybe the script runs too early or too late at boot, so you have to rename to 05-....... to make it work again.

Regards.

1

Share this post


Link to post
Share on other sites

Posted

Maybe the script runs too early or too late at boot, so you have to rename to 05-....... to make it work again.

Tried, does not help :(

Would you suggest to try any other number? In /system/etc/init.d I currently have

00banner

05Swap2SysDataCache

09Dis-Zram0

50selinuxrelabel

77fstrim

90userinit

99SuperSUDaemon

0

Share this post


Link to post
Share on other sites

Posted

Have you busybox pro ??

Or install the synopsis kernel

0

Share this post


Link to post
Share on other sites

Posted

Have you busybox pro ??

Or install the synopsis kernel

Yes I have busybox pro, and in fact the script worked fine before slimkat 6.2 (I believe; maybe later maybe earlier)

Do you still advise to try synopsis? If yes, how do I flash it?

0

Share this post


Link to post
Share on other sites

Posted

Flash the fonzrepack

0

Share this post


Link to post
Share on other sites

Posted

Flash the fonzrepack

No avail, /system swap still missing :(
0

Share this post


Link to post
Share on other sites

Posted

So is a android KK bug

0

Share this post


Link to post
Share on other sites

Posted

#!/system/bin/sh

#Use 1.20.2 Stericson BusyBox

#to make "swapon -p" working!

sleep(5)

mount -o remount,rw /system

mount -o remount,rw /data

mount -o remount,rw /cache

#system

rm /system/swap1.img

dd if=/dev/zero of=/system/swap1.img bs=1024 count=85000

mkswap /system/swap1.img

swapon -p 1 /system/swap1.img

#data

rm /data/swap2.img

dd if=/dev/zero of=/data/swap2.img bs=1024 count=85000

mkswap /data/swap2.img

swapon -p 1 /data/swap2.img

#cache

rm /cache/swap3.img

dd if=/dev/zero of=/cache/swap3.img bs=1024 count=85000

mkswap /cache/swap3.img

swapon -p 1 /cache/swap3.img

echo 90 > /proc/sys/vm/swappiness

0

Share this post


Link to post
Share on other sites

Posted

This should work

0

Share this post


Link to post
Share on other sites

Posted

No avail, /system swap still missing :(

try to remove the script from initd. and the swap.img's from the correspective folders then reboot and wipe cacke/dalvik.

after that copy it again to initd folder and give the correct permissions. i hope it will work like this

0

Share this post


Link to post
Share on other sites

Posted

This should work

It says syntax error near token 5 :(
0

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now

MoDaCo is part of the MoDaCo.network, © Paul O'Brien 2002-2015. MoDaCo uses IntelliTxt technology.