[script] 98swapon by -FuFu-

Search This thread

-FuFu-

Senior Member
Hi there,
here now the official thread for my 98swapon script...

Latest Version: V11
Download: http://droid-world.bplaced.net/index.php?cat=Downloads&page=Scripte
there you will always find the latest version

Infos about the Script you can find here: http://droid-world.bplaced.net/index.php?cat=Milestone&page=Swap Aktivieren
but its German ;)

here a translation using google translate (so please excuse the bad english, but i think my english is not much better then google translate)
Simply download the latest zip and copy to /sdcard/Open Recovery/updates and then run in the Open Recovery by apply update.

Best done previously a Nandroid backup of your current system, which you can import in case of problems again.

UPDATE
As of Version 9, there is on the SD card, the file swapon.conf with which you can adjust the different variables of the script, so it's no longer necessary to directly edit the script.

SWAPSIZE is the amount of swap in MB
If you put SWAPINT to 1, the internal memory is used for swap.
Swapdev determines which internal partition to use, possible / are cache and / data, all other partitions were too small to use it for swap.
RESETSWAP at 1 and at every reboot the swapfile is created, what is nützlch when changing SWAPSIZE.
SWAPIONLY set to 1 and it will only set the value for swappiness with boats, the rest are ignored.

For the rest of the values ​​consulted with Google, I can not say at all what may.

To edit the swapon.conf please use Notepad + + or it may cause problems.
i only test the script on cm7 and there it works fine...
if you have problems or find some issues, please let me know...

please post your swapon.log from /cache if you have a problem, and also your swapon.conf from sdcard.



changelog
V11
- add dos2unix to script, so that is now also possible to edit the swapon.conf with windows editor

V10
- add disable funktion to the script
- script now work on cm7 and cm10
 
Last edited:

-FuFu-

Senior Member
main problem is, that the swapon.conf will not be found on boot...
so i need the mount points on bootup to see if the sdcard will be mount and for that i have line 19 in the script only thing to do is to delete the "##" to activate the line...

you also can edit the line directly in the zip befor apply it via OR apply update...

but if there still "/sdcard/swapon.conf not found..." in /cache/swapon.log there is something wrong...
may sdcard will not be mount on boot
or
there is no swapon.conf an sdcard
 

Erovia

Senior Member
Sep 16, 2012
818
262
I think you misunderstood me.

I have concerns about the idea of swapping on the internal memory, not problems with the script itself.
 
  • Like
Reactions: -FuFu-

Erovia

Senior Member
Sep 16, 2012
818
262
Oh, in that case I misunderstood you. :D

You are right. It seems the config file is not found on CM10.

(Maybe if you use /mnt/sdcard/swapon.conf ? I know it is basically the same, I just dont have any other idea. Or maybe CM10 mounts the sdcard after the script runs? )
 
  • Like
Reactions: -FuFu-

-FuFu-

Senior Member
i add a mount command to the script, for cm7 it works fine but i think on cm10 it wont work...
but i dont kwno why...

for me it will be a help if you also delete the "##" on line 19 in the 98swapon script, the in the swapon.log all mountpoints will be shown....
on line 18 the script will try to mount the sdcard, but maybe on cm10 the mountpoint is different to cm7

i think i must flash cm10 this weekend to test it ;)
 

Erovia

Senior Member
Sep 16, 2012
818
262
I guess I found the source of problem.

It seems that sdcard is not being mounted. (although sd-ext is mounted)
 
  • Like
Reactions: -FuFu-

-FuFu-

Senior Member
on cm7 also the sdcard is not mountet on boot, first i try to mount with "mount /sdcard" but it wont work so i try "mount -t vfat -o rw,dirsync,nosuid,nodev,noexec,uid=1000,gid=1015,fmask=0702,dmask=0702,allow_utime=0020,shortname=mixed,utf8 /dev/block/vold/179:1 /sdcard" and that works on cm7, after that the sdcard is mount on /mnt/sdcard and /sdcard

but i think that not work for cm10, but dont know way, maybe the sdcard will be mount but not on /sdcard.
for that i have add line 19 to the script to check that (for debugging its helpfull, but for release i comment out that line) so i have all mountpoint in the swapon.log to see what is mountet and where...

so i think i must flash cm10 to test it here to see where is the problem and its the fastes way for me ;)

as i know the sdcard will not be mount on boot on no rom, cause there is no need to, the sdcard will be mount from android when the system is load
 

Erovia

Senior Member
Sep 16, 2012
818
262
Wish I could help more, but I'm not really an expert in this kind of stuff. :D

An easy "workaround" would be if the config file was placed on the sd-ext as it is mounted properly. I know then it would be not as easy to edit it (for windows users) but it should work. :)
 
  • Like
Reactions: -FuFu-

Erovia

Senior Member
Sep 16, 2012
818
262
I think I found a solution.

I edited row #17 to this:

mount -t vfat /dev/block/vold/179:1 /sdcard >>$SWAPLOG

Basically I just deleted the parameters.

The log shows no error and /mnt/sdcard is mounted properly.


I ran some test and it doesn't work. :(
 
Last edited:

-FuFu-

Senior Member
  • Like
Reactions: koodiifin

koodiifin

Senior Member
Oct 19, 2011
462
133
BC
Hey fufu I'm trying to enable internal memory swap with your new script. But now I'm getting a new error in the log.

Here's my config:

## 98swapon config file
##
## set to 1 to disable swap on boot
DISABLE=0
## set swapfile size in MB
## default setting is 32 for 32mb
SWAPSIZE=32
## set to 1 to use intern memory for swap
SWAPINT=1
## settings for use swap on intern memory
## use /cache or /data for swap
SWAPDEV=/cache
## recreate swapfile on every boot
## set to 1 to recreate swapfile on every boot, may be helpfull if you change SWAPSIZE
RESETSWAP=0

## set to 1 to set only swappiness value all other values will be ignored
SWAPIONLY=0
## vm settings
## swappiness
SWAPPINESS=15
## dirty radio
DRADIO=80
## dirty backgriound radio
DBRADIO=30
## vfs cache pressure
VFSCP=10
## dirty expire centisecs
DEC=1000
## dirty writeback centisecs
DWC=1000
## laptop mode value 0 or 1
LAPTOPM=0
## oom kill allocating task value 0 or 1
OOMKAT=1
## panic on oom value 0 or 1
POOOM=0

Here's the log:


please set DISABLE in swapon.conf to 0 or 1
swap disabled in case of wrong DISABLE value



Sent from my Milestone using xda app-developers app
 

Top Liked Posts

  • There are no posts matching your filters.
  • 3
    Hi there,
    here now the official thread for my 98swapon script...

    Latest Version: V11
    Download: http://droid-world.bplaced.net/index.php?cat=Downloads&page=Scripte
    there you will always find the latest version

    Infos about the Script you can find here: http://droid-world.bplaced.net/index.php?cat=Milestone&page=Swap Aktivieren
    but its German ;)

    here a translation using google translate (so please excuse the bad english, but i think my english is not much better then google translate)
    Simply download the latest zip and copy to /sdcard/Open Recovery/updates and then run in the Open Recovery by apply update.

    Best done previously a Nandroid backup of your current system, which you can import in case of problems again.

    UPDATE
    As of Version 9, there is on the SD card, the file swapon.conf with which you can adjust the different variables of the script, so it's no longer necessary to directly edit the script.

    SWAPSIZE is the amount of swap in MB
    If you put SWAPINT to 1, the internal memory is used for swap.
    Swapdev determines which internal partition to use, possible / are cache and / data, all other partitions were too small to use it for swap.
    RESETSWAP at 1 and at every reboot the swapfile is created, what is nützlch when changing SWAPSIZE.
    SWAPIONLY set to 1 and it will only set the value for swappiness with boats, the rest are ignored.

    For the rest of the values ​​consulted with Google, I can not say at all what may.

    To edit the swapon.conf please use Notepad + + or it may cause problems.
    i only test the script on cm7 and there it works fine...
    if you have problems or find some issues, please let me know...

    please post your swapon.log from /cache if you have a problem, and also your swapon.conf from sdcard.



    changelog
    V11
    - add dos2unix to script, so that is now also possible to edit the swapon.conf with windows editor

    V10
    - add disable funktion to the script
    - script now work on cm7 and cm10
    3
    yes, but the browser cache is also on internal memory and write much data if you use the browser... but no one realy knows how long it takes to degrading the life of internal memory...
    and if died some sectors on internal memory not to complety memory will be die and cache is only use for OTA updates and downloads from play store, so for me there is no big problem

    but that each must decide for themselves


    and V11 is only ;) with dos2unix ;)
    3
    i think i found the right command ;)
    maybe you can test it and confirme?
    use
    Code:
    mount -t vfat /dev/block/mmcblk0p1 /sdcard
    here it works, i reboot now 10 times and on every boot it mounts sdcard

    if you confirm, i will update the script ;) so that all can be test it ^^

    now i just must test if it also works for cm7 :D
    1
    Works perfectly on CM10.
    1
    to disable swap you must use
    swapoff /dev/block/mmcblk0p3

    cause we have no swap entry in fstab, also if use a swapfile you must use
    swapoff /sdcard/swapfile (or where else is the file)