-
-
Save chirayudesai/b9008fd57e7b21abbee1 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
From 95bad83bbe379d867f859e913e5203fd1b510520 Mon Sep 17 00:00:00 2001 | |
From: Chirayu Desai <cdesai@cyanogenmod.org> | |
Date: Mon, 18 Mar 2013 20:45:38 +0530 | |
Subject: [PATCH 1/2] CM on Emulator [ARM] | |
* Add cm.mk | |
* Add cm.dependencies | |
* Add init.recovery.goldfish.rc and init.recovery.goldfish.sh | |
for adb in recovery (thanks to Dees_Troy) | |
Change-Id: I0eeb0353aabe80cf2ecbce454e9f58bffca8f1bc | |
Signed-off-by: Chirayu Desai <cdesai@cyanogenmod.org> | |
--- | |
cm.dependencies | 7 +++++ | |
cm.mk | 17 ++++++++++++ | |
goldfish.mk | 5 ++++ | |
init.recovery.goldfish.rc | 7 +++++ | |
init.recovery.goldfish.sh | 68 +++++++++++++++++++++++++++++++++++++++++++++++ | |
5 files changed, 104 insertions(+) | |
create mode 100644 cm.dependencies | |
create mode 100644 cm.mk | |
create mode 100644 goldfish.mk | |
create mode 100644 init.recovery.goldfish.rc | |
create mode 100755 init.recovery.goldfish.sh | |
diff --git a/cm.dependencies b/cm.dependencies | |
new file mode 100644 | |
index 0000000..6d5ce64 | |
--- /dev/null | |
+++ b/cm.dependencies | |
@@ -0,0 +1,7 @@ | |
+[ | |
+ { | |
+ "repository": "android_kernel_goldfish", | |
+ "target_path": "kernel/goldfish", | |
+ "branch": "cm-10.1_2.6.29" | |
+ } | |
+] | |
diff --git a/cm.mk b/cm.mk | |
new file mode 100644 | |
index 0000000..9d81f4c | |
--- /dev/null | |
+++ b/cm.mk | |
@@ -0,0 +1,17 @@ | |
+TARGET_KERNEL_SOURCE := kernel/goldfish | |
+TARGET_KERNEL_CONFIG := cyanogenmod_goldfish_armv7_defconfig | |
+ | |
+# Inherit CM common GSM stuff. | |
+$(call inherit-product, vendor/cm/config/gsm.mk) | |
+ | |
+# Inherit CM common Phone stuff. | |
+$(call inherit-product, vendor/cm/config/common_full_phone.mk) | |
+ | |
+# Inherit device configuration | |
+$(call inherit-product, device/generic/goldfish/goldfish.mk) | |
+ | |
+## Device identifier. This must come after all inclusions | |
+PRODUCT_NAME := cm_goldfish | |
+PRODUCT_DEVICE := generic | |
+PRODUCT_BRAND := CyanogenMod | |
+PRODUCT_MODEL := Full CyanogenMod on Emulator | |
diff --git a/goldfish.mk b/goldfish.mk | |
new file mode 100644 | |
index 0000000..a55d8d3 | |
--- /dev/null | |
+++ b/goldfish.mk | |
@@ -0,0 +1,5 @@ | |
+$(call inherit-product, $(SRC_TARGET_DIR)/product/full.mk) | |
+ | |
+PRODUCT_COPY_FILES += \ | |
+ device/generic/goldfish/init.recovery.goldfish.rc:recovery/root/init.recovery.goldfish.rc \ | |
+ device/generic/goldfish/init.recovery.goldfish.sh:recovery/root/sbin/init.recovery.goldfish.sh | |
diff --git a/init.recovery.goldfish.rc b/init.recovery.goldfish.rc | |
new file mode 100644 | |
index 0000000..2985cff | |
--- /dev/null | |
+++ b/init.recovery.goldfish.rc | |
@@ -0,0 +1,7 @@ | |
+on boot | |
+ | |
+# This starts the network needed to get adb working in the emulator | |
+service goldfish-setup /sbin/init.recovery.goldfish.sh | |
+ user root | |
+ group root | |
+ oneshot | |
diff --git a/init.recovery.goldfish.sh b/init.recovery.goldfish.sh | |
new file mode 100755 | |
index 0000000..170a6bf | |
--- /dev/null | |
+++ b/init.recovery.goldfish.sh | |
@@ -0,0 +1,68 @@ | |
+#!/sbin/sh | |
+ | |
+# Setup networking when boot starts | |
+ifconfig eth0 10.0.2.15 netmask 255.255.255.0 up | |
+route add default gw 10.0.2.2 dev eth0 | |
+ | |
+# ro.kernel.android.qemud is normally set when we | |
+# want the RIL (radio interface layer) to talk to | |
+# the emulated modem through qemud. | |
+# | |
+# However, this will be undefined in two cases: | |
+# | |
+# - When we want the RIL to talk directly to a guest | |
+# serial device that is connected to a host serial | |
+# device by the emulator. | |
+# | |
+# - We don't want to use the RIL but the VM-based | |
+# modem emulation that runs inside the guest system | |
+# instead. | |
+# | |
+# The following detects the latter case and sets up the | |
+# system for it. | |
+# | |
+qemud=`getprop ro.kernel.android.qemud` | |
+case "$qemud" in | |
+ "") | |
+ radio_ril=`getprop ro.kernel.android.ril` | |
+ case "$radio_ril" in | |
+ "") | |
+ # no need for the radio interface daemon | |
+ # telephony is entirely emulated in Java | |
+ setprop ro.radio.noril yes | |
+ stop ril-daemon | |
+ ;; | |
+ esac | |
+ ;; | |
+esac | |
+ | |
+# Setup additionnal DNS servers if needed | |
+num_dns=`getprop ro.kernel.ndns` | |
+case "$num_dns" in | |
+ 2) setprop net.eth0.dns2 10.0.2.4 | |
+ ;; | |
+ 3) setprop net.eth0.dns2 10.0.2.4 | |
+ setprop net.eth0.dns3 10.0.2.5 | |
+ ;; | |
+ 4) setprop net.eth0.dns2 10.0.2.4 | |
+ setprop net.eth0.dns3 10.0.2.5 | |
+ setprop net.eth0.dns4 10.0.2.6 | |
+ ;; | |
+esac | |
+ | |
+# disable boot animation for a faster boot sequence when needed | |
+boot_anim=`getprop ro.kernel.android.bootanim` | |
+case "$boot_anim" in | |
+ 0) setprop debug.sf.nobootanimation 1 | |
+ ;; | |
+esac | |
+ | |
+# set up the second interface (for inter-emulator connections) | |
+# if required | |
+my_ip=`getprop net.shared_net_ip` | |
+case "$my_ip" in | |
+ "") | |
+ ;; | |
+ *) ifconfig eth1 "$my_ip" netmask 255.255.255.0 up | |
+ ;; | |
+esac | |
-- | |
1.8.3.1 | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
From c447b59a62f95f1791ce07da3e79e077d5e93039 Mon Sep 17 00:00:00 2001 | |
From: Chirayu Desai <cdesai@cyanogenmod.org> | |
Date: Tue, 11 Jun 2013 18:08:57 +0530 | |
Subject: [PATCH 2/2] fix copying of init.recovery.goldfish.rc | |
Change-Id: Ib09dd0a980eb15619c2f2c22ddc35d8f9994b8d0 | |
Signed-off-by: Chirayu Desai <cdesai@cyanogenmod.org> | |
--- | |
goldfish.mk | 1 + | |
1 file changed, 1 insertion(+) | |
diff --git a/goldfish.mk b/goldfish.mk | |
index a55d8d3..cd2048f 100644 | |
--- a/goldfish.mk | |
+++ b/goldfish.mk | |
@@ -1,5 +1,6 @@ | |
$(call inherit-product, $(SRC_TARGET_DIR)/product/full.mk) | |
PRODUCT_COPY_FILES += \ | |
+ device/generic/goldfish/init.recovery.goldfish.rc:root/init.recovery.goldfish.rc \ | |
device/generic/goldfish/init.recovery.goldfish.rc:recovery/root/init.recovery.goldfish.rc \ | |
device/generic/goldfish/init.recovery.goldfish.sh:recovery/root/sbin/init.recovery.goldfish.sh | |
-- | |
1.8.3.1 | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment