init.ranchu.rc: Add goldfish-logcat and goldfish-setup services
Both services were written for the classic emulator, but are still
applicable to qemu-android:
1. goldfish-logcat allows the user to start logcat at boot time and
redirect its output to a QEMU device. This feature was actually not
usable in the classic x86/x86_64 emulator, which limits the number of
serial ports to 2, and thus cannot spare a third one for logcat. It
can now be re-enabled in qemu-android for x86/x86_64, which supports
up to 4 serial ports.
2. goldfish-setup sets up networking and adds support for WiFi-only mode
and turning off boot animation. On qemu-android, it automatically
disables the RIL daemon, which is apt because telephony emulation has
not been implemented yet. Moreover, this helps eliminate the annoying
ril-daemon-keeps-getting-killed-and-restarted issue, reproducible by
running a recent system image built from AOSP master on qemu-android.
This CL depends on the following modifications to the emulator's SELinux
policy:
https://android-review.googlesource.com/151023
https://android-review.googlesource.com/151022
Change-Id: I2bce35279247d4f4a2e637e939c6afe9390fa033
Signed-off-by: Yu Ning <yu.ning@intel.com>
diff --git a/init.ranchu.rc b/init.ranchu.rc
index 876272e..0359245 100644
--- a/init.ranchu.rc
+++ b/init.ranchu.rc
@@ -43,7 +43,25 @@
stop dund
stop akmd
+# start essential services
+# These were written for the classic emulator, but are applicable to ranchu
+ start goldfish-logcat
+ start goldfish-setup
+
# enable Google-specific location features,
# like NetworkLocationProvider and LocationCollector
setprop ro.com.google.locationfeatures 1
+service goldfish-setup /system/etc/init.goldfish.sh
+ user root
+ group root
+ oneshot
+
+# -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
+# named by the androidboot.console kernel option
+# if not, is simply exits immediately
+
+service goldfish-logcat /system/bin/logcat -Q
+ oneshot