[G1 Android Development] narcopolypse:
Apps 2 Virtual Disk 0.53b

For those of you that are wondering "What is this guy smoking?" (which I assume is all of you), this is an automatically re-sizing virtual apps 2 SD ext3 partition. It is stored as an image file on your existing Fat32 partition.

I have done my best to make this as idiot proof and bug free as possible but I always appreciate constructive criticism. Please be kind, I haven't had access to a computer while writing this so it was written entirely on my G1. Therefore I expect that it will have a few bugs.

This barrows very heavily from Cyanogen's work so please thank him for making this possible.

Installing

To install the utility just download the file on your phone, open your terminal emulator and run:

su
sh /sdcard/download/a2vd-0.53b.zip

It does the rest.

Please note, this is NOT a zip file! It is a shell script. XDA won't let you post any file this big unless it's a zip file. (Can we get an Admin on this?) Good thing linux doesn't give a crap about file extensions.

Once you reboot your phone the utility will create the virtual partition, move over your apps, then re-size the partition to have 15 MB of free space. Please note, it will reboot 3 - 4 times during the first boot.

This should run on any rom that executes /system/bin/a2sd during boot.

It has been confirmed to work on Cyanogen 3.5.2 and higher.

Automatic Resizing

The partition will automatically re-size so you don't have to guess how big you need to make it. Now you can take a bite out of crime, in stead of your Fat32 partition. ;-)

If you run low on space just reboot your phone. If the free space on your virtual partition is less than 10 MB or more than 20 MB it will be re-sized to have 15 MB of free space. Please ignore the fact that free space may be listed as 13 or 14 MB, as far as I can tell this is an issue with the OS, the readout becomes more accurate as the partition gets bigger.

Disabling the Partition

If you wish to boot up with the Apps 2 Virtual Disk partition disabled simply open up your terminal emulator and run:

su
a2sdoff

You can also remove the SD card while the phone is off.

This is useful if you need to transfer files over USB cable.

Automatic backup

If you boot with the partition disabled the utility will backup some system settings so your apps and widgets will all still work when you re-enable the partition. It will also maintain a separate launcher profile for when you boot with the partition disabled. Now you don't have to stare at a desktop full of broken icons every time you need to transfer files to your computer.

Upgrading to a New Rom

Transitioning to a new rom can break some of your apps and widgets. To prevent this follow this procedure:

1. Place your new update.zip file on the root of your SD card.

2. Open terminal emulator and run:

su
a2sdoff -u

This will reboot your phone, prepare the backups, and take you to recovery.

3. Flash your new rom. (If you exit recovery without flashing you must re-run "a2sdoff -u" before attempting another flash)

4. Boot up your new rom, open terminal emulator and re-install Apps2VD.

Okay, you can start downloading now.

Thank you for your support and enjoy!

As a side note, If you install this on a phone that already has a traditional Apps2SD partition it will NOT copy over your apps. I'm working on it but until then you'll have to either just deal with it or copy them you self.

Edit: Download has been removed due to security concerns. Will re-upload when solved.