|
2 | 2 |
|
3 | 3 | This is a set of device configs that you can use to build and test TWRP in the Android emulator. Note that adb will take about 10 to 15 seconds after TWRP is booted to become available. Just wait and it will come online eventually.
|
4 | 4 |
|
5 |
| -This branch of the device configs is intended to give you a more modern emmc type of device instead of relying on the mtd nand setup that the default emulator configuration uses. In order to make this setup work, you will have to boot the emulator with a custom kernel. We added ext2/3/4 support as well as support for reading a partition map to the kernel configuration. The source for this kernel is located here: |
| 5 | +This branch of the device configs is intended to be used with Android 4.4.2 system image. For some reason there is no cache partition. In order to create a cache partition as well fake boot and recovery partitions, you will have to boot the emulator with a custom kernel. We added simply added support for reading a partition map to the kernel configuration. The source for this kernel is located here: |
6 | 6 |
|
7 |
| -[Kernel Source](https://github.com/Dees-Troy/android_kernel_goldfish "Kernel Source") |
| 7 | +[Kernel Source](https://android.googlesource.com/kernel/goldfish/+/android-goldfish-3.4 "Kernel Source") |
8 | 8 |
|
9 |
| -To boot this in the emulator, build your recoveryimage. With the Android emulator make a new device based on a Galaxy Nexus. Allow it to have a hardware keyboard and a sdcard. Give it a name like TWRP. Then from your android-sdk/tools folder run the following command: |
| 9 | +To boot this in the emulator, build your recoveryimage. With the Android emulator make a new device based on a Galaxy Nexus. Name it TWRP. Allow it to have a hardware keyboard and a sdcard sized to 1500MB. Give it a decent sized data partition like 500MB or more. TWRP will be using the data partition as an emulated storage setup as seen on most modern Android devices, so having some extra room may help. Then from your android-sdk/tools folder run the following command: |
10 | 10 |
|
11 | 11 | ```
|
12 |
| -./emulator -avd TWRP -ramdisk ~/cm_folder/out/target/product/twrp/ramdisk-recovery.img -kernel ~/cm_folder/device/emulator/twrp/goldfish_2.6_kernel |
| 12 | +./emulator -avd TWRP -ramdisk ~/omni_folder/out/target/product/twrp/ramdisk-recovery.img -kernel ~/omni_folder/device/emulator/twrp/goldfish_3.4_kernel |
13 | 13 | ```
|
14 | 14 |
|
15 | 15 | After the first boot, wait for ADB to start up, then: adb shell /sbin/create_partitions.sh
|
16 | 16 |
|
17 |
| -This script will partition the sdcard with a boot, recovery, system, cache, data, and removable sdcard partition. It's designed to work with a 1500MiB sdcard. If you want a different sdcard size then you will need to modify the script in the cm_folder/device/emulator/twrp/recovery/root/sbin/create_partitions.sh location to suit your needs. The script will also mount the old MTD system device to /system so that you can make a backup of the system image to restore to your new mmc-based system. |
| 17 | +This script will partition the sdcard with a boot, recovery, cache, and removable sdcard partition. It's designed to work with a 1500MiB sdcard. If you want a different sdcard size then you will need to modify the script in the omni_folder/device/emulator/twrp/recovery/root/sbin/create_partitions.sh location to suit your needs. |
18 | 18 |
|
19 |
| -If you want to make the emulator boot up using the emmc partitions, you will need to modify the ramdisk.img. Locate the ramdisk.img in your android-sdk/system-images/android##/armeabi-v7a/ folder. To unpack it: |
20 |
| - |
21 |
| -``` |
22 |
| -mkdir ramdisk |
23 |
| -cd ramdisk |
24 |
| -gzip -dc ../ramdisk.img | cpio -i |
25 |
| -``` |
26 |
| - |
27 |
| -Modify the init.rc to mount your mmc based partitions instead of the mtd ones by locating the line in init.rc that says "on fs" and modifying it to look like this: |
28 |
| - |
29 |
| -``` |
30 |
| -on fs |
31 |
| -# mount emmc partitions |
32 |
| - # Mount /system rw first to give the filesystem a chance to save a checkpoint |
33 |
| - # mount yaffs2 mtd@system /system |
34 |
| - # mount yaffs2 mtd@system /system ro remount |
35 |
| - # mount yaffs2 mtd@userdata /data nosuid nodev |
36 |
| - # mount yaffs2 mtd@cache /cache nosuid nodev |
37 |
| - mount ext4 /dev/block/mmcblk0p3 /system wait ro |
38 |
| - mount ext4 /dev/block/mmcblk0p5 /data wait noatime nosuid nodev |
39 |
| - mount ext4 /dev/block/mmcblk0p4 /cache wait noatime nosuid nodev |
40 |
| -``` |
41 |
| - |
42 |
| -Save the changes and repack the ramdisk image as follows: |
43 |
| - |
44 |
| -``` |
45 |
| -find . | cpio -o -H newc > gzip > ../newramdisk.img |
46 |
| -``` |
47 |
| - |
48 |
| -Boot the emulator using -ramdisk path/to/newramdisk.img -kernel path/to/goldfish_2.6_kernel |
49 | 19 |
|
50 | 20 | You can find a compiling guide for TWRP [here](http://forum.xda-developers.com/showthread.php?t=1943625 "Guide").
|
51 | 21 |
|
52 | 22 | [More information about the project.](http://www.teamw.in/project/twrp2 "More Information")
|
53 | 23 |
|
54 |
| -If you have code changes to submit those should be pushed to our gerrit instance. A guide can be found [here](http://teamw.in/twrp2-gerrit "Gerrit Guide"). |
| 24 | +If you have code changes to submit those should be pushed to OmniROM's gerrit instance. A guide can be found [here](http://docs.omnirom.org/Contributing_code "Gerrit Guide"). |
0 commit comments