Skip to content

Commit b086095

Browse files
committed
Update for 4.4 and Omni
1 parent fd01365 commit b086095

12 files changed

+1822
-78
lines changed

AndroidProducts.mk

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
PRODUCT_MAKEFILES := \
2-
$(LOCAL_DIR)/device.mk
2+
$(LOCAL_DIR)/device.mk \
3+
$(LOCAL_DIR)/omni_twrp.mk

BoardConfig.mk

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ TARGET_CPU_ABI2 := armeabi
1717
TARGET_CPU_SMP := true
1818
TARGET_ARCH_VARIANT := armv7-a-neon
1919
ARCH_ARM_HAVE_TLS_REGISTER := true
20+
TARGET_CPU_VARIANT := cortex-a9
2021

2122
BOARD_KERNEL_BASE := 0x80000000
2223
# BOARD_KERNEL_CMDLINE :=
@@ -34,16 +35,11 @@ TARGET_PREBUILT_KERNEL := device/emulator/twrp/kernAl
3435
# Use this flag if the board has a ext4 partition larger than 2gb
3536
BOARD_HAS_LARGE_FILESYSTEM := true
3637

37-
TARGET_RECOVERY_INITRC := device/emulator/twrp/recovery/init-twrp.rc
38+
TARGET_RECOVERY_INITRC := device/emulator/twrp/recovery/init.rc
3839
TARGET_USERIMAGES_USE_EXT4 := true
3940

4041
# TWRP specific build flags
4142
DEVICE_RESOLUTION := 720x1280
4243
RECOVERY_GRAPHICS_USE_LINELENGTH := true
4344
TWRP_CUSTOM_KEYBOARD := ../../../device/emulator/twrp/recovery/hardwarekeyboard.cpp
4445
RECOVERY_SDCARD_ON_DATA := true
45-
TW_INTERNAL_STORAGE_PATH := "/data/media"
46-
TW_INTERNAL_STORAGE_MOUNT_POINT := "data"
47-
TW_EXTERNAL_STORAGE_PATH := "/external_sd"
48-
TW_EXTERNAL_STORAGE_MOUNT_POINT := "external_sd"
49-
#BOARD_USE_CUSTOM_RECOVERY_FONT := \"font_7x16.h\"

README.md

Lines changed: 6 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -2,53 +2,23 @@
22

33
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.
44

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:
66

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")
88

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:
1010

1111
```
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
1313
```
1414

1515
After the first boot, wait for ADB to start up, then: adb shell /sbin/create_partitions.sh
1616

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.
1818

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
4919

5020
You can find a compiling guide for TWRP [here](http://forum.xda-developers.com/showthread.php?t=1943625 "Guide").
5121

5222
[More information about the project.](http://www.teamw.in/project/twrp2 "More Information")
5323

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").

device.mk

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ PRODUCT_COPY_FILES += \
1818
$(LOCAL_KERNEL):kernel
1919

2020
PRODUCT_COPY_FILES += \
21-
device/emulator/twrp/recovery/root/sbin/network_start.sh:recovery/root/sbin/network_start.sh
21+
device/emulator/twrp/recovery/root/sbin/network_start.sh:recovery/root/sbin/network_start.sh \
22+
device/emulator/twrp/recovery/root/sbin/create_partitions.sh:recovery/root/sbin/create_partitions.sh
2223

2324
$(call inherit-product, build/target/product/full.mk)
2425

goldfish_2.6_kernel

-1.8 MB
Binary file not shown.

goldfish_3.4_kernel

2.29 MB
Binary file not shown.

0 commit comments

Comments
 (0)