[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
1284 - 20: unexpected '1284'
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, 58.416260 seconds, 15.5MB/s
dd: invalid number ''
dd: invalid number ''

...done.

Formatting the swap file(s)...

Setting up swapspace version 1, size = 946860032 bytes
UUID=584347bf-c981-4ec1-af7e-f24cae3462d3
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...

swapon: can't stat '/cache/swapfile2': No such file or directory
swapon: can't stat '/data/swapfile3': No such file or directory
...done.

Making init.d script and power shift style...
Super Stupendous Switch Swap Scripts...

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

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

this looks bad