summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xinit.ranchu-core.sh10
-rw-r--r--init.ranchu.rc14
-rw-r--r--qemu-props/qemu-props.c32
3 files changed, 40 insertions, 16 deletions
diff --git a/init.ranchu-core.sh b/init.ranchu-core.sh
index 33583825..0b2e6fd6 100755
--- a/init.ranchu-core.sh
+++ b/init.ranchu-core.sh
@@ -1,4 +1,14 @@
#!/vendor/bin/sh
+#init cannot access ro.kernel.android.bootanim,
+#so do a translation into vendor.qemu space
+bootanim=`getprop ro.kernel.android.bootanim`
+case "$bootanim" in
+ "")
+ ;;
+ *) setprop vendor.qemu.android.bootanim 0
+ ;;
+esac
+
# take the wake lock
echo "emulator_wake_lock" > /sys/power/wake_lock
diff --git a/init.ranchu.rc b/init.ranchu.rc
index d069b342..2193c58a 100644
--- a/init.ranchu.rc
+++ b/init.ranchu.rc
@@ -27,6 +27,8 @@ on boot
setprop wifi.interface wlan0
+ start goldfish-logcat
+
service ranchu-setup /vendor/bin/init.ranchu-core.sh
class core
@@ -34,12 +36,15 @@ service ranchu-setup /vendor/bin/init.ranchu-core.sh
group root
oneshot
-on property:qemu.timezone=*
- setprop persist.sys.timezone ${qemu.timezone}
+on property:vendor.qemu.timezone=*
+ setprop persist.sys.timezone ${vendor.qemu.timezone}
-on property:ro.kernel.android.bootanim=0
+on property:vendor.qemu.android.bootanim=0
setprop debug.sf.nobootanimation 1
+on property:dev.bootcomplete=1
+ setprop vendor.qemu.dev.bootcomplete 1
+
service ranchu-net /vendor/bin/init.ranchu-net.sh
class late_start
user root
@@ -83,9 +88,6 @@ service qemu-props /vendor/bin/qemu-props
group root
oneshot
-on property:qemu.logcat=start
- start goldfish-logcat
-
# -Q is a special logcat option that forces the
# program to check wether it runs on the emulator
# if it does, it redirects its output to the device
diff --git a/qemu-props/qemu-props.c b/qemu-props/qemu-props.c
index e54c2d57..e1b8ae7d 100644
--- a/qemu-props/qemu-props.c
+++ b/qemu-props/qemu-props.c
@@ -27,7 +27,7 @@
#define DEBUG 1
#if DEBUG
-# include <cutils/log.h>
+# include <log/log.h>
# define DD(...) ALOGI(__VA_ARGS__)
#else
# define DD(...) ((void)0)
@@ -88,6 +88,7 @@ int main(void)
DD("receiving..");
char* q;
char temp[BUFF_SIZE];
+ char vendortemp[BUFF_SIZE];
int len = qemud_channel_recv(qemud_fd, temp, sizeof temp - 1);
/* lone NUL-byte signals end of properties */
@@ -106,9 +107,25 @@ int main(void)
}
*q++ = '\0';
+ char* final_prop_name = NULL;
+ if (strcmp(temp, "qemu.sf.lcd.density") == 0 ) {
+ final_prop_name = temp;
+ } else if (strcmp(temp, "qemu.hw.mainkeys") == 0 ) {
+ final_prop_name = temp;
+ } else if (strcmp(temp, "qemu.cmdline") == 0 ) {
+ final_prop_name = temp;
+ } else if (strcmp(temp, "dalvik.vm.heapsize") == 0 ) {
+ continue; /* cannot set it here */
+ } else if (strcmp(temp, "ro.opengles.version") == 0 ) {
+ continue; /* cannot set it here */
+ } else {
+ snprintf(vendortemp, sizeof(vendortemp), "vendor.%s", temp);
+ final_prop_name = vendortemp;
+ }
if (property_set(temp, q) < 0) {
- DD("could not set property '%s' to '%s'", temp, q);
+ ALOGW("could not set property '%s' to '%s'", final_prop_name, q);
} else {
+ ALOGI("successfully set property '%s' to '%s'", final_prop_name, q);
count += 1;
}
}
@@ -116,20 +133,15 @@ int main(void)
char temp[BUFF_SIZE];
for (;;) {
usleep(5000000); /* 5 seconds */
- property_get("sys.boot_completed", temp, "");
+ property_get("vendor.qemu.dev.bootcomplete", temp, "");
int is_boot_completed = (strncmp(temp, "1", 1) == 0) ? 1 : 0;
if (is_boot_completed) {
+ ALOGI("tell the host boot completed");
notifyHostBootComplete();
break;
}
}
- /* HACK start adbd periodically every minute, if adbd is already running, this is a no-op */
- for(;;) {
- usleep(60000000); /* 1 minute */
- property_set("qemu.adbd", "start");
- }
-
/* finally, close the channel and exit */
if (s_QemuMiscPipe >= 0) {
close(s_QemuMiscPipe);
@@ -153,7 +165,7 @@ void notifyHostBootComplete() {
WriteFully(s_QemuMiscPipe, &pipe_command_length, sizeof(pipe_command_length));
WriteFully(s_QemuMiscPipe, set, pipe_command_length);
ReadFully(s_QemuMiscPipe, &pipe_command_length, sizeof(pipe_command_length));
- if (pipe_command_length > sizeof(set) || pipe_command_length <= 0)
+ if (pipe_command_length > (int)(sizeof(set)) || pipe_command_length <= 0)
return;
ReadFully(s_QemuMiscPipe, set, pipe_command_length);
}