Guest kannasbor0 Posted April 29, 2014 Report Posted April 29, 2014 (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 zipSwap2SysDataCache.zip Edited September 17, 2014 by kannasbor0
Guest anotherjib Posted May 1, 2014 Report Posted May 1, 2014 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? :))
Guest kannasbor0 Posted May 3, 2014 Report Posted May 3, 2014 (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 May 3, 2014 by kannasbor0
Guest anotherjib Posted May 5, 2014 Report Posted May 5, 2014 (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 May 6, 2014 by anotherjib
Guest kannasbor0 Posted May 8, 2014 Report Posted May 8, 2014 Sorry, i was busy too with my job and my exams... Glad to see that it helped! :)
Guest anotherjib Posted May 9, 2014 Report Posted May 9, 2014 Forgot to specify - mine is slimkat 4.9 http://www.modaco.com/topic/368306-rom442all-slimkat-49-unofficial-05052014/ Created no problems so far
Guest kannasbor0 Posted May 10, 2014 Report Posted May 10, 2014 works perfectly thx :) You're welcome! :-)
Guest porozex Posted May 11, 2014 Report Posted May 11, 2014 What to do with the busybox file? you must install it with the pro app in the market
Guest tarinka Posted June 20, 2014 Report Posted June 20, 2014 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
Guest anotherjib Posted June 20, 2014 Report Posted June 20, 2014 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.9You 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 folderNow 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)RebootTo check if the script works - run terminal emulator again and type cat /proc/swapsIt 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.
Guest anotherjib Posted July 26, 2014 Report Posted July 26, 2014 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
Guest anotherjib Posted August 7, 2014 Report Posted August 7, 2014 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 - 7540An 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?
Guest kannasbor0 Posted August 9, 2014 Report Posted August 9, 2014 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.
Guest anotherjib Posted August 10, 2014 Report Posted August 10, 2014 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 have00banner05Swap2SysDataCache09Dis-Zram050selinuxrelabel77fstrim90userinit99SuperSUDaemon
Guest luca020400 Posted August 10, 2014 Report Posted August 10, 2014 Have you busybox pro ?? Or install the synopsis kernel
Guest anotherjib Posted August 10, 2014 Report Posted August 10, 2014 Have you busybox pro ??Or install the synopsis kernelYes 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?
Guest anotherjib Posted August 11, 2014 Report Posted August 11, 2014 Flash the fonzrepackNo avail, /system swap still missing :(
Guest luca020400 Posted August 11, 2014 Report Posted August 11, 2014 #!/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
Guest porozex Posted August 11, 2014 Report Posted August 11, 2014 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
Guest anotherjib Posted August 12, 2014 Report Posted August 12, 2014 This should workIt says syntax error near token 5 :(
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now