yashsingh1/xdaforums huggingface dataset:
[G2 and Desire Z Android Development] kbeezie:
v1.3 Changes from 1.2

Updated dataswap script to use busybox prefix for swapon/mkswap

Updated SD-Swap to use busybox prefix

Some roms I've tested do not have commands like free, swapon, mkswap and so forth, but were available if you used the busybox command (ie: busybox swapon ...), so the dataswap and SD-Swap init scripts were updated to prefix with busybox thus making it work on roms with those kinds of issues.
[G2 and Desire Z Android Development] rirozizo:
like Gen.Y?

———————————————————

i didn't mean to mock you or to offend you in any kind of way
[G2 and Desire Z Android Development] kbeezie:
Note the OP, it's the specific rom that had this issue.

Sent from my T-Mobile G2
[G2 and Desire Z Android Development] rirozizo:
sd-swap on ILWT is working.

and Gen.Y is fixed without the busybox prefix btw. he fixed that in the latest version

———————————————————

i didn't mean to mock you or to offend you in any kind of way
[G2 and Desire Z Android Development] MaxWiz:
Not sure what I am doing wrong here. Have used your script for several roms without a problem. Cannot get it working on Gen Y. Although I am using v1.3 it refers to itself as v1.2 during set up. Is it possible that the file is v1.2 by mistake?

Superwipe and clean install of Gen Y.

Stay in 4ext and run your script - selecting data swap and sd ext, no sd swap.

Boot and set up rom.

Su, free in terminal shows zeros for swap.
[G2 and Desire Z Android Development] rirozizo:
he may have forgotten to edit his updater-script file, and edit the print_ui("")

———————————————————

i didn't mean to mock you or to offend you in any kind of way
[G2 and Desire Z Android Development] MaxWiz:
Thats what I thought, unless I'm doing something daft. Odd behaviour now. Having rebooted GenY all my installed apps have disappeared. Icons still in home page and apps still exist on sd-ext but touching icon give an 'app not installed' error. Guess the script part worked.
[G2 and Desire Z Android Development] kbeezie:
Yea I forgot to update the version number in aroma-config.

PS: on that one , don't you have to type busybox free (or did he fix that).

Some questions though.

1) What size is your sd-ext partition

2) did you partition the SD card with an SD-Swap partition at all

3) Did you accidently also create a secondary /sd-ext2 partition?

4) how much free space did you have on /data

5) Did you verify the two init scripts were installed to /system/etc/init.d/ ?

6) Does busybox df -hm , show the /sd-ext partition mounted and if so what sizes
[G2 and Desire Z Android Development] kbeezie:
This usually happens if you created an sd-ext way too small to hold all of your apps from /data/app and /data/app-private (or if you had a pre-existing /sd-ext with an /app folder inside of it, in which case it should have been formated clean before installing the script).
[G2 and Desire Z Android Development] MaxWiz:
Hi, thanks for the reply. My sd-ext is 2Gb, all partitions created with 4ext and no ex-sd2. Lots of space on data. Both scripts are in init.d and have permissions rwxr-w---. I've attached my df command output.

This is on another clean install of GenY having formatted everything except sdcard in 4ext. Looks as though sd-ext is working. I will see if rebooting makes the apps vanish and will report back. Swap is not working.

Have rebooted a couple of times and have installed some apps. No vanishing apps and sd-ext appears to work w

ll.

app_139@android:/ $ export PATH=/data/local/bin:$PATH
app_139@android:/ $ su
app_139@android:/ # free
total used free shared buffers
Mem: 370440 349084 21356 0 9416
-/+ buffers: 339668 30772
Swap: 0 0 0
app_139@android:/ # busybox df -hm
Filesystem Size Used Available Use% Mounted on
tmpfs 180.9M 64.0K 180.8M 0% /dev
/dev/block/mmcblk0p25
549.2M 453.0M 96.2M 82% /system
/dev/block/mmcblk0p26
1.0G 246.5M 827.4M 23% /data
/dev/block/mmcblk0p27
295.3M 4.7M 290.6M 2% /cache
/dev/block/mmcblk0p28
20.6M 15.8M 4.8M 77% /devlog
tmpfs 180.9M 0 180.9M 0% /mnt/asec
tmpfs 180.9M 0 180.9M 0% /mnt/obb
tmpfs 8.0M 0 8.0M 0% /app-cache
tmpfs 180.9M 0 180.9M 0% /data/secure/data
/dev/block/mmcblk1p2 2.0G 129.3M 1.8G 6% /sd-ext
/dev/block/mmcblk1p2 2.0G 129.3M 1.8G 6% /data/app
/dev/block/mmcblk1p2 2.0G 129.3M 1.8G 6% /data/app-private
/dev/block/vold/179:65
27.7G 22.0G 5.7G 79% /mnt/sdcard
/dev/block/vold/179:65
27.7G 22.0G 5.7G 79% /mnt/secure/asec
[G2 and Desire Z Android Development] kbeezie:
According that looks like SD-EXT is setup and is of sufficient size, not entirely sure why apps went missing, but seeing as dataswap didn't work, I'm assuming that something in sd-ext used commands that GenY did not correctly have linked to busybox (more a fault of the rom I'd say, though 'free' by itself wouldn't work if that were the case).

in adb : cat /system/init.d/80dataswap

See if both swapon and mkswap command have busybox in front of them or not (if they don't have busybox in front of them then you don't have the latest version of the dataswap/sd-ext enabler).

However if they do have it in there, try typing out each command one by one yourself, and see if any errors show up, and if not see if free then shows the swap.
[G2 and Desire Z Android Development] MaxWiz:
Really appreciate your help with this. I think this rom will be excellent with swap running.

Update on last attempt. Sd-ext IS still playing up. All downloaded apps eventually vanished! Most odd.

Have been looking at dataswap. It does have the busybox prefix to those commands. However, the file appears never to have been created. So I tried running the commands one at a time. This is what happened.

a/local/bin:$PATH
app_146@android:/ $ su
app_146@android:/ #dd if=/dev/zero of=/data/local/swap bs=1M count=128
128+0 records in
128+0 records out
128 bytes transferred in 0.013 secs (9846 bytes/sec)
app_146@android:/ # chmod 0600 /data/local/swap
app_146@android:/ # mkswap /data/local/swap
mkswap: image is too small
app_146@android:/ #

So for some reason the install script doesn't produce a swap file. Running the commands separately seems to make a swap file thats too small.

Edit:

Added busybox prefix to dd command and it works. just need to figure out why it isn't running on boot.
[G2 and Desire Z Android Development] kbeezie:
If the script doesn't have busybox in front of all three already then the script enabler isn't the latest version provided. (I'm wondering if the command linkage doesn't happen until well after the init scripts run on that rom).
[G2 and Desire Z Android Development] Steven How:
Kbeezie,if my sd ext is only 128mb,can I move like 100+mb of app to ad ext without losing them?? Now on gen.y b5 Rom...
[G2 and Desire Z Android Development] MaxWiz:
Tried a different approach that so far has worked for swap.

Super clean and install GenY from scratch in 4ext.

Boot it up and do all my setup etc PLUS updated busybox to the latest version.

Let it sit and sync etc until fully installed.

Boot back in to 4ext and fix permissions and back up.

Ran you script but chose only dataswap.

Rebooted and swap is working fine :)

No idea really but guessing that the updated busybox helped.

Backed up and tried the sd-ext script. Works fine but after reboot all downloaded apps are gone. Not sure what to try now.
[G2 and Desire Z Android Development] kbeezie:
I'll advised, your sdext partition MUST be 1gb or larger, too small and you risk losing apps.

Sent from my T-Mobile G2
[G2 and Desire Z Android Development] kbeezie:
At any time of wiping did you also make sure to wipe/format the sdext partition, also seems the problems all occur with gen.y which I don't use.

Sent from my T-Mobile G2
[G2 and Desire Z Android Development] nicholaslimck:
I've been trying this on Gen.Y B5, both dataswap and ext4 don't seem to work.

Dataswap doesn't seem to run properly; checking with the free command results in all 0 values for swap. (Tried with both 64 and 96MB options)

Enabling the ext4 partition results in the "disappearing app" problem, but reverting through the enabler returns the apps to normal. 2.0GB SD-EXT partition, so it's nothing related to a lack of storage space.

Maybe these problems are due to the switching of the ROM base?
[G2 and Desire Z Android Development] kbeezie:
At this point I'm going to say it has more to do with how that rom is built than the scripts. I've no plans of making it work with gen.y or any sense 4.0 rom for that matter as I do not use sense. In my brief time using GenY b4 there was a lot that seems missing from the command line and until he fixes up the cli to be as functional as a typical aosp rom on the command line I wouldn't use this script with it for the time being.

Sent from my T-Mobile G2
[G2 and Desire Z Android Development] Steven How:
Add this to the first line in the system/etc/init.d/80dataswap

#!/system/bin/sh

So it should be like this

#!/system/bin/sh

# Moves the old swap for creation of a new one

mv /data/local/swap /data/local/swap.old

# creates a new swap file (which will be on a new part of the emmc)

busybox dd if=/dev/zero of=/data/local/swap bs=1M count=64

chmod 0600 /data/local/swap

mkswap /data/local/swap

swapon /data/local/swap

# remove the old swap file

rm -f /data/local/swap.old

And set permission to rwx rwx rwx and ur done :rolleyes:
[G2 and Desire Z Android Development] kbeezie:
Normally with the init scripts on android shouldn't need to have the shebang (#!) line referencing the shell binary, since the init scripts are not typically 'self executed'. But if you know for certain that such a thing works (and won't break other roms) I could incorporate the change. I'm not certain that 777 is exactly a fix, maybe 775 but generally speaking 755 should work.
[G2 and Desire Z Android Development] Steven How:
I add that to ur script..so.it will load on boot..but if I don't put that # it won't start at all ._. No offence..I'm to use to that # thingy lol
[G2 and Desire Z Android Development] kbeezie:
Hrm... just double checked to see if $SHELL was /system/bin/sh was the right path on my phone as well.

Guess I'll edit in the shebang line on each of the scripts and give it a run on mimicry, if all goes well will just zip up a 1.4 (with the correct version this time around too).
[G2 and Desire Z Android Development] Steven How:
Haha,will see abt it anyway. If u take a good look at all the custom Rom out there,u will notice that all the init.d script start with the #!/system/bin/sh thingy..even u are adding a file let say u wanna set ur vfs cache pressure,u can't just put echo 20 vfs alone,u have to add the #!/system/bin/sh before that,so the init.d will load them up :rolleyes:

Friendly reminder..Becareful playing with init.d anyway,u can accidentaly broke it which mean the Rom won't run all the script in the init.d..
[G2 and Desire Z Android Development] kbeezie:
._. I administer linux and freebsd servers, I think I know that much and the nice thing about 'testing' is I would make sure it's not going to 'bork' that badly before releasing it. (unlike some rom cookers I know).
[G2 and Desire Z Android Development] kbeezie:
Version 1.4

Change from 1.3:

Added the shebang (#!) string to the dataswap scripts

Modified permissions set for init scripts from 750 to 755

Change primarily targeted at the likes of the Gen.Y rom.
[G2 and Desire Z Android Development] rirozizo:
ehem... hey i... ummm... you're right
[G2 and Desire Z Android Development] kbeezie:
lol not talking bout you (or anyone specifically for that matter).
[G2 and Desire Z Android Development] Steven How:
Lol,happy to give some contribution haha >.<
[G2 and Desire Z Android Development] MaxWiz:
Thanks for the update. Data swap working fine on GenY but sd-ext is still broken. Guess we will just have to wait and see if a future update of GenY will allow the script to work properly.
[G2 and Desire Z Android Development] nicholaslimck:
Thanks for the dataswap fix, guess I'll just wait till ext4 can be fixed too.
[G2 and Desire Z Android Development] BootloopedMillennials:
So I decided to try this on CM7 Nightly for the hell of it. Dataswap doesn't work (Im assuming you need a kernel that enables it, like Elitemod). Unfortunately Im not gonna install the Elitemod kernel as it hasn't been updated in awhile. SD-EXT seems to have worked, with EXT4 format. My Internal storage went from just under 200MB free to 653MB free.
[G2 and Desire Z Android Development] kbeezie:
Need details on how you're set up, If you're using mimicry sd-ext should be working just fine as it's the same rom I'm using.
[G2 and Desire Z Android Development] Sefy:
I have a weird issue, not sure if to post it here or in the other thread.

I'm trying out Blackout3, cause well, i love HTC Sense UI and 3.6 is the last one i actually like (v4.0 is yuck).

Anyway, i flashed the ROM, booted back into Recovery, Flash v1.4 of this, everything looks great, i install all my stuff.

BUT, if i reboot, it's all gone!

If i flash again, it has no affect!

Help? :(
[G2 and Desire Z Android Development] Steven How:
Wat u mean all gone?
[G2 and Desire Z Android Development] Sefy:
I mean, everything that was on the Ext4 partition, only has nifty Android Icons which says linked to a missing app.

The Ext4 is there and has all the apps, it just doesn't seem to have any connection anymore.

This happens no matter what i format and how install over and over.

Once i reboot, the connection is broken and no app is accessible (which also leaves me with a non rooted rom, as SU and the rest are on the Ext4 partition).
[G2 and Desire Z Android Development] BootloopedMillennials:
kbeezie,

Is the ILWT and Elitemod kernels the only ones that enable DataSwap in CM7?
[G2 and Desire Z Android Development] kbeezie:
I don't know, I've only tested ILWT briefly, and I know that EliteMod CM7 (and ICS) support it because the original dataswap mod was written by nik3r. I don't plan on testing any other gingerbread roms as I'm on ICS on a permanent basis.

So far as Gingerbread and Sense goes, you can pretty much assume that testing/fixes will probably be provided mostly by people other than myself, as I use neither.
[G2 and Desire Z Android Development] kbeezie:
Why would su/etc be on the sd-ext partition? the enabler doesn't move system apps only the /data/app and /data/app-private items. And the su binary isn't even in the /system/app folder but rather the xbin path. Did you verify the mapping via busybox df output?
[G2 and Desire Z Android Development] Steven How:
U enable the sd ext?? Try revert it back see does the app come back?
[G2 and Desire Z Android Development] Sefy:
I have no idea why, i just know that after a reboot, seems like all App links got broken off..

Well, i had no choice and restored the JB backup instead, cause even backing/restoring the Blackout rom didn't fix anything..

It's weird, i've never had anything like that happen before :(

---------- Post added at 07:48 PM ---------- Previous post was at 07:47 PM ----------

I tried it, even confirmed the ROM sees the Ext partition again, but to no avail, non of the links got restored :eek:
[G2 and Desire Z Android Development] Steven How:
Strange...for me it come back when I disable the sd ext..:what:
[G2 and Desire Z Android Development] Sefy:
I'm now trying the new SenseWich 1.0, would this work on it? :eek:
[G2 and Desire Z Android Development] kbeezie:
Try it and find out, though not sure what the whole fascination is with all things "sense".
[G2 and Desire Z Android Development] Sefy:
Cause Sense gives a much more beautiful design,imo, it's a matter of opinion and how you use your phone.

With Sense, i don't need to install loads of widgets for what is already included in the Sense itself.

Why do people like iPhone? cause it's better, hardly, it's just has a more fluent UI design.
[G2 and Desire Z Android Development] kbeezie:
:P I found sense for the most part in the interface to be too much white space, too um... playskool for lack of a better word. To me something like mimicry is much cleaner and simpler, and any 'fancy-ness' I can easily add to my launcher. And nice widgets are easy with FancyWidgets, and I don't get the huge slowdown that most post-3.5 Sense has.

I own an iPad I know about iOS and yes it's more fluid (and it's own UI isn't nearly as excess-rounded as I found Sense to be), but I find Sense to require too many extra steps compared to a simple AOSP rom. But the fact remains, most of the problems, confusion, and lack of detailed user-input comes from Sense Users.
[G2 and Desire Z Android Development] Sefy:
It's each user to his own :)

I really like the whole design of the HTC Sense, even though i do dislike a few things about it that i've gotten used to on the JB rom.

But for example, i like the fluidity of the appearance (not exactly the fluidity of movement), that most of my widgets have same design and they don't look like a mess with each looking different.
[G2 and Desire Z Android Development] BengtL:
This works with Sensewitch 1. I have only tried dataswap ...
[G2 and Desire Z Android Development] Sefy:
Great! i'll give it a try! after a backup :D
[G2 and Desire Z Android Development] Steven How:
Always remember to backup ..:D
[G2 and Desire Z Android Development] Sefy:
Yup, backed up! and everything is working great, it can now see my Ext partition and moved my stuff there!

Yay!!
[G2 and Desire Z Android Development] kbeezie:
what do you mean by "moved my stuff there". The init script is supposed to do that for you. Also to clarify none of your apps should show as being on the SD Card they should all show as being "Internal", since SD-EXT = internal , the old App2SD = FAT32 partition. The latter is obviously slower and causes more problems with certain apps. As long as all your apps are shown as being on "internal" storage, they'll be on the /sd-ext partition instead of the /sdcard.
[G2 and Desire Z Android Development] Sefy:
That's what i meant, my apologies, i meant all the stuff is now on the Ext, so "internal" is free ;)
[G2 and Desire Z Android Development] kbeezie:
Just making sure, I know some people were quite confused when they thought they had to manually "move to SD" in apps only to realize they were skipping the use of sd-ext completely doing that. :P
[G2 and Desire Z Android Development] BengtL:
Did you try dataswap also? It's much faster...I tried with 96 MB swapfile. Half used already!
[G2 and Desire Z Android Development] Sefy:
Yes, i enabled it, and the ROM pretty much flies compared to almost everything else.

Even though in Quadrant i'm at nearly a 1/3 less in performance.
[G2 and Desire Z Android Development] Steven How:
Nice to hear that,Thanks to kbeezie for his mod! :) if u didn't post this mod I didn't know u can actually use data as swap space >.<
[G2 and Desire Z Android Development] Deathmehr:
OK, I'm doing this for the first time so I encountered a probably noobish problem. Here it is:

1) I created 1.6 GB EXT4 partition via GPARTED

2) then in 4EXT recovery chose

It said that both FAT32 and EXT4 are aligned perfectly

3) furthermore I clicked

just to be sure

4) next, I chose

just to be sure

5) finally I ran your zip with

Everything went by "done" but once it booted up and I ran terminal emulator the

command showed that it didn't work. Not to mention that the second command

does not execute.

Log file:

Thanks in advance for help!

P.S. Look at the date! I went back in time for this while. Why use DeLorean when recovery can take you there :)
[G2 and Desire Z Android Development] rirozizo:
Lol, your battery must be damaged, I have the same problem if ii take the battery off for too long (like 5 minutes)

———————————————————

i didn't mean to mock you or to offend you in any kind of way
[G2 and Desire Z Android Development] kbeezie:
Use recovery to partition the card not gparted, the recovery will put the partitions on the correct order and in correct sector size etc.

Sent from my T-Mobile G2
[G2 and Desire Z Android Development] Sefy:
Guys, same issue i had with the previous Sense Rom last time, after the phone shut down, and loaded again, the SenseWich1 ROM doesn't "see" the SD-Ext or the applications on it :crying:
[G2 and Desire Z Android Development] dragon-son:
So I did a nandorid backup and tried to restore it last night after a round of uninstalls left me at the boot animation, that was clearly my fault, but when restored all the apps were gone. I didn't mind just reflashed the ROM and I was trying to install anyways. This mod also works with build 77 of JB, both dataswap and sd-ext. Thanks again guys.
[G2 and Desire Z Android Development] Deathmehr:
I did as you told, but I think it still doesn't work. Take a look at terminal emulator output:
[G2 and Desire Z Android Development] dragon-son:
That appears to show you have the data swap enabled at 96Mb.
[G2 and Desire Z Android Development] Deathmehr:
But shouldn't it be a lot more occupied with the apps?

Oh, and this:

is fullfilled on my phone.

So, I've got it up and running or not? :eek:

Thanks!
[G2 and Desire Z Android Development] dragon-son:
busybox df -hm

Use that command to check the sd-ext part of it in terminal emulator. Make sure you su to get root first as well. It should show lots.

/sd-ext

/data/app

/data/app-private

should all be the same size if it's working. The other free command only shows the swap space at 96Mb and used only a small portion.
[G2 and Desire Z Android Development] SteveRiley:
A datapoint... This installed flawlessly on Andromadus JellyBean 73.

4EXT was unable to repartition my 8 GB microSD to create a 2 GB sd-ext partition. So I copied everything in the single 8 GB fat32 partition to my PC and then allowed 4EXT to wipe the card and create a 2 GB sd-ext (with an ext4 file system) and a fat32 partition for the remainder. I then copied the saved files back to the fat32 partition.

The script installation performed correctly. /data/app and /data/app-private are now mapped to /dev/mmcblk1p2 and their applications moved nearly instantaneously.

To anyone contemplating a similar move, I'd say the time is ripe.
[G2 and Desire Z Android Development] natabbotts:
I can confirm data swap 128 and SD ext work perfectly on Andromadus Test Build cm10 85 (latest at time of writing).
[G2 and Desire Z Android Development] nik3r:
Hey I just tested the sd-ext on HD2 phone running ICS, it works with a small adjustment to the partition names. With this change it should work like charm and you could post a version for that device as well ;)
[G2 and Desire Z Android Development] rirozizo:
So, I tested this on my BlackICE ROM, and sd-ext works fine, dataswap (64MB) is working too.

I haven't tested sdswap mainly because I already have dataswap. The ROM is pretty fast now.

One thing to note is that you should not run the script if you already installed your apps. I'm not doing that mistake again.

———————————————————

i didn't mean to mock you or to offend you in any kind of way
[G2 and Desire Z Android Development] BootloopedMillennials:
Everything works with CM7 Nightly and latest ILWT kernel.

Have a question though. Say Im going from an earlier CM7 Nightly to a new version (just wiping cache and dalvik cache), do I have to reflash this tool? Don't think CM7 has addon.d support, couldnt locate folder.
[G2 and Desire Z Android Development] Steven How:
Kbeezie,is there anyway to clear the swap file other than rebooting it?? :confused:
[G2 and Desire Z Android Development] natabbotts:
What need do you have for this? Swap file is cleared and moved every reboot, it doesn't need to happen more often - android kernel manages it.

If you want to remove it completely, reflash the kbeezie aroma zip and select remove.

---------- Post added at 04:05 PM ---------- Previous post was at 04:04 PM ----------

Without addon.d you will need to reflash, as flashing a new zip even without super wipe will wipe entire system partition.
[G2 and Desire Z Android Development] Steven How:
Well I mean is clear the swap file to like 5000 ..coz mine always build up to 100000+ ..not removing the swap file =\ just like using atk killing task..ya..