[Android Software/Hacking General [Developers Only]] hisname:
==============================================

Hi. Thanks for using...

//----------------------------------------//

// Defiant07's SwapItOn //

//----------------------------------------//

Hope you like it!

==============================================

Okay, first gunna check if busybox has the

required applets, if you are running as root,

if /etc/init.d exists, and if your kernel

supports swap.

Boss, busybox is complete.

Gnarly, running as root.

Good, init.d detected.

Nice, swap is supported.

==============================================

Now I need some input from you so as to

customize the setup according to your

needs and preferences.

You can make up to three prioritized swap

files. Where should I make the primary swap

file?

Pick (e)xternal sd card, (d)ata partition,

(c)ache partition, (s)ystem partition,

or (k)ustom location: s

The primary swap file will be made here:

/system

If this location is copasetic with you

input (p)roceed or (e)xit: p

Do you want to make a secondary swap file?

Input (y)es or (n)o: y

Where should I make the secondary swap file?

Pick (e)xternal sd card, (d)ata partition,

(c)ache partition, (s)ystem partition,

or (k)ustom location: c

The secondary swap file will be made here:

/cache

Is this location copasetic with you?

Input (p)roceed or (e)xit: p

Do you want to make a tertiary swap file?

Input (y)es or (n)o: y

Where should I make the tertiary swap file?

Pick (e)xternal sd card, (d)ata partition,

(c)ache partition, (s)ystem partition,

or (k)ustom location: d

The tertiary swap file will be made here:

/data

If this location is copasetic with you

input (p)roceed or (e)xit: p

==============================================

Next, I need your desired swappiness.

Note: The higher the value the higher the

probability things will get transferred to

the swap file.

Please input your desired swappiness value

- any integer from 0 to 100 - and then

press enter: 20

==============================================

If you want, these vm/swap related settings

can be applied to your current session and

future boots:

dirty_background_ratio =

(5) [30] {60}

dirty_ratio =

(10) [60] {95}

vfs_cache_pressure =

(50) [10] {10}

dirty_writeback_centisecs =

(3000) [3000] {2000}

dirty_expire_centisecs =

(500) [1500] {1000}

The values in () are from ThunderBolt.

The values in [] are a middle ground by me.

The values in {} are from KickAssKernelizer.

Wanna try one of them? Input (t)hunderbolt,

(m)iddle, (k)ickasskernelizer, or (n)one: k

==============================================

If any of your swap file locations are slow to

become accessible an additional delay in the

init.d script maybe necessary so as to avoid

potential problems.

Should I add an additional delay to Z99SwapOn?

Input (y)es or (n)o: n

==============================================

Based upon accessible ram, I recommend the sum

of your swap files equalling around: 903 mb.

It is unlikely you will use more than this.

Input your desired size in mb as an integer

for the primary swap file: 903

/storage/emulated/0/SpeedSoftware/Extracted/swapit[565]: 0

2193 - 20: unexpected '2193'

Please wait while I create the swap file(s),

init.d script, and switch swap scripts

according to your specifications.

It could take a while (avg.: 5-10 minutes).

==============================================

Making the swap file(s)...

903+0 records in

903+0 records out

946864128 bytes (903.0MB) copied, 54.075927 seconds, 16.7MB/s

dd: invalid number ''

dd: invalid number ''

...done.

Formatting the swap file(s)...

mkswap: can't open '/system/swapfile': Read-only file system

mkswap: can't open '/cache/swapfile2': No such file or directory

mkswap: can't open '/data/swapfile3': No such file or directory

...done.

Turning swap on, setting priorities, and

applying swappiness value...

unknown option -- p

BusyBox v1.21.1-jb bionic (2013-07-25 21:23 +0100) multi-call binary.

Usage: swapon [-a] [DEVICE]

Start swapping on DEVICE

-aStart swapping on all swap devices

unknown option -- p

BusyBox v1.21.1-jb bionic (2013-07-25 21:23 +0100) multi-call binary.

Usage: swapon [-a] [DEVICE]

Start swapping on DEVICE

-aStart swapping on all swap devices

unknown option -- p

BusyBox v1.21.1-jb bionic (2013-07-25 21:23 +0100) multi-call binary.

Usage: swapon [-a] [DEVICE]

Start swapping on DEVICE

-aStart swapping on all swap devices

...done.

Making init.d script and power shift style...

Super Stupendous Switch Swap Scripts...

/storage/emulated/0/SpeedSoftware/Extracted/swapit[998]: can't create /system/etc/init.d/Z99SwapOn: Read-only file system

vm.dirty_background_ratio = 60

vm.dirty_ratio = 95

vm.vfs_cache_pressure = 10

vm.dirty_writeback_centisecs = 2000

vm.dirty_expire_centisecs = 1000

...applied your optional settings too...

/storage/emulated/0/SpeedSoftware/Extracted/swapit[1021]: can't create /system/xbin/swapiton: Read-only file system

/storage/emulated/0/SpeedSoftware/Extracted/swapit[1045]: can't create /system/xbin/swapitoff: Read-only file system

/storage/emulated/0/SpeedSoftware/Extracted/swapit[1081]: can't create /system/xbin/swap0: Read-only file system

/storage/emulated/0/SpeedSoftware/Extracted/swapit[1117]: can't create /system/xbin/swap10: Read-only file system

/storage/emulated/0/SpeedSoftware/Extracted/swapit[1153]: can't create /system/xbin/swap20: Read-only file system

/storage/emulated/0/SpeedSoftware/Extracted/swapit[1189]: can't create /system/xbin/swap30: Read-only file system

/storage/emulated/0/SpeedSoftware/Extracted/swapit[1225]: can't create /system/xbin/swap40: Read-only file system

/storage/emulated/0/SpeedSoftware/Extracted/swapit[1261]: can't create /system/xbin/swap50: Read-only file system

/storage/emulated/0/SpeedSoftware/Extracted/swapit[1297]: can't create /system/xbin/swap60: Read-only file system

/storage/emulated/0/SpeedSoftware/Extracted/swapit[1333]: can't create /system/xbin/swap70: Read-only file system

/storage/emulated/0/SpeedSoftware/Extracted/swapit[1369]: can't create /system/xbin/swap80: Read-only file system

/storage/emulated/0/SpeedSoftware/Extracted/swapit[1405]: can't create /system/xbin/swap90: Read-only file system

/storage/emulated/0/SpeedSoftware/Extracted/swapit[1441]: can't create /system/xbin/swap100: Read-only file system

/storage/emulated/0/SpeedSoftware/Extracted/swapit[1522]: can't create /system/xbin/unswapit: Read-only file system

/storage/emulated/0/SpeedSoftware/Extracted/swapit[1593]: can't create /system/xbin/tweakstb: Read-only file system

/storage/emulated/0/SpeedSoftware/Extracted/swapit[1662]: can't create /system/xbin/tweaksmid: Read-only file system

/storage/emulated/0/SpeedSoftware/Extracted/swapit[1715]: can't create /system/xbin/tweakskak: Read-only file system

/storage/emulated/0/SpeedSoftware/Extracted/swapit[1751]: can't create /system/xbin/tweaksno: Read-only file system

sed: /system/xbin/tweakstb: No such file or directory

sed: /system/xbin/tweakstb: No such file or directory

sed: /system/xbin/tweakstb: No such file or directory

sed: /system/xbin/tweakstb: No such file or directory

sed: /system/xbin/tweaksmid: No such file or directory

sed: /system/xbin/tweaksmid: No such file or directory

sed: /system/xbin/tweaksmid: No such file or directory

sed: /system/xbin/tweaksmid: No such file or directory

sed: /system/xbin/tweakskak: No such file or directory

sed: /system/xbin/tweaksno: No such file or directory

chmod: /system/etc/init.d/Z99SwapOn: No such file or directory

chmod: /system/xbin/swapiton: No such file or directory

chmod: /system/xbin/swapitoff: No such file or directory

chmod: /system/xbin/swap0: No such file or directory

chmod: /system/xbin/swap10: No such file or directory

chmod: /system/xbin/swap20: No such file or directory

chmod: /system/xbin/swap30: No such file or directory

chmod: /system/xbin/swap40: No such file or directory

chmod: /system/xbin/swap50: No such file or directory

chmod: /system/xbin/swap60: No such file or directory

chmod: /system/xbin/swap70: No such file or directory

chmod: /system/xbin/swap80: No such file or directory

chmod: /system/xbin/swap90: No such file or directory

chmod: /system/xbin/swap100: No such file or directory

chmod: /system/xbin/unswapit: No such file or directory

chmod: /system/xbin/tweakstb: No such file or directory

chmod: /system/xbin/tweaksmid: No such file or directory

chmod: /system/xbin/tweakskak: No such file or directory

chmod: /system/xbin/tweaksno: No such file or directory

...done.

==============================================

Okay finally ALL DONE...that was easy...

I got some critical closing notes I advise

you read if you are updating or running this

script for the first time.

Ya wanna read them? Input (y)es or (n)o:

look at those messages