[G1 Android Development] Zappza:
Hi!

I have created some .bat files that semi-automate this process, and I was wondering if anyone could take a look at them just to verify that everything is correct. I have used this script myself, and it was working for me, but could someone please take a look just to make sure :)

@echo ---------------------
@echo This batch file will enable you to use a ext2 partition on your SD Card for app storage.
@echo ---------------------
@echo Requirements:
@echo 1. A partitioned SD Card with an ext2 partition no larger than 2GB
@echo (larger partitions have been reported to not work properly)
@echo ---------------------
@echo 2. This script needs to be executed from the root folder of your
@echo Android SDK tools folder, unless you downloaded the full file.
@echo ---------------------
@echo 3. A rooted phone
@echo ---------------------
@echo 4. The phone needs to be connected to your PC via USB, and the
@echo debugging needs to be turned on. (Turned on by default as of JF1.33
@echo ---------------------
@echo 5. It is a good idea to take a nandroid backup before doing this.
@echo Things can go wrong, and having a backup is always a good idea!
@echo ---------------------
@echo 6. Put your phone in Airplane mode in order to avoid any disturbances.
@echo ---------------------
@echo ---------------------
@echo This first step will backup your mountd.conf and init.rc files to
@echo a folder called backup in the root folder on your computer.
@echo ---------------------
pause
@echo ---------------------
adb pull /system/etc/mountd.conf backup
adb pull /system/init.rc backup
adb remount
adb shell mkdir /system/sd
adb shell ls /system
@echo ---------------------
@echo ---------------------
@echo Verify that a folder called sd has been created.
@echo ---------------------
pause
@echo ---------------------
@echo The next step is to replace the existing files with new files that uses a second ext2 partition on your SD Card.
pause
adb shell rm -R /system/etc/mountd.conf
adb shell rm -R /system/init.rc
adb push mountd.conf /system/etc/
adb push init.rc /system/
@echo ---------------------
@echo Your G1 will now reboot.
pause

adb shell reboot
@echo ---------------------
@echo Wait until Android have loaded again.
@echo This can take a while, especially if you already have apps installed
@echo on the partition. Wait at least 5 minutes after the phone have rebooted,
@echo and if there is still no progress, pull the battery and power on again.
pause

adb remount
adb shell busybox df -h
@echo ---------------------
@echo You should see a line that looks something like this:
@echo /dev/mmcblk0p2 1.2G 9.1M 1.1G 1% /system/sd
@echo if not, go back and manually do the steps all over again.
@echo ---------------------
@echo ---------------------
@echo This will copy the app and app-private directory to the
@echo partition on your sd card and link the directories so that
@echo all newly created applications will be installed there.
pause
@echo ---------------------
adb shell busybox cp -a /data/app /system/sd
adb shell rm -r /data/app
adb shell ln -s /system/sd/app /data/app
@echo ---------------------
@echo app folder have been copied and linked
pause
@echo ---------------------
adb shell busybox cp -a /data/app-private /system/sd/app-private
adb shell rm -r /data/app-private
adb shell ln -s /system/sd/app-private /data/app-private
@echo ---------------------
@echo app-private folder have been copied and linked.
@echo ---------------------
@echo The phone will now reboot and all the extra storage is avaliable
@echo for you to enjoy!
@echo ---------------------
pause
adb shell reboot
@echo ---------------------
@echo This script was written based on instructions by dwang found on the magnificent
@echo forums at http://xdaforums.com/forumdisplay.php?f=446
pause