To move some of system folders (/system or /data), to external emulated SD card, you need to do following:
- Firstly, /data contents (for example) should be placed on sdcard. Initially they are loaded by emulator from userdata.img file.
So you need to copy userdata.img
($EMUPATH/system-images/android-19/armeabi-v7a/userdata.img)
contents to sdcard.iso.$> dd if=userdata.img of=sdcard.iso
- I assume, that android virtual device is created. To change boot configuration, you will need to change fstab.goldfish file on ramdisk.img. If it is Android 4.4 AVD, then ramdisk.img could also be find at
$EMUPATH/system-images/android-19/armeabi-v7a/
- Create a temporary folder, say ramdisk-ext
$ mkdir ramdisk-ext
- Change directory to ramdisk-ext
$ cd ramdisk-ext
- Extract the ramdisk.cpio in the ramdisk-ext folder
$ gunzip -dcv ../ramdisk.img | cpio -idm
- Modify fstab.goldfish
$ gedit fstab.goldfish
in such way:- String #6 from
"/dev/block/mtdblock1 /data ..."
to"/dev/block/mmcblk0 /data ..."
- String #6 from
- Create new ramdisk
$ find . | cpio -H newc -o | gzip -9 >../ramdisk_new.img
- Create a temporary folder, say ramdisk-ext
- Everything is done, now you need to start the emulator, with your new ramdisk and custom sdcard:
$ ./emulator -avd $AVDNAME -sdcard sdcard.iso -ramdisk $EMUPATH/system-images/android-19/armeabi-v7a/ramdisk_new.img
P.S. Notice that in this example you can move only one of such folders (/system or /data). Maybe it could be changed, by creating sdcard image with several partitions.