platform_system_core/rootdir/etc/init.goldfish.sh
David 'Digit' Turner a503456526 emulator: Move qemu-props to core service
The qemu-props program is launched at boot to read a series of
system property assignments from the emulator and apply them.

This is necessary to deal with the dynamic nature of the emulated
platform (e.g. the screen density which depends on the skin and
cannot be hard-coded in the platform image).

This patch ensures that qemu-props is started before any other
service that may read one of these properties (e.g. surface flinger).
This is done by encapsulating the program into a 'core' service.
Core services are all stared before regular ones.

Before the patch, qemu-props was started manually inside a script
that is called from a late emulator-specific boot service
(goldfish-setup).

The problem was that sometimes qemu-props was run too late.
This resulted in random flakiness, especially when running
on a low-end host machine.

Fix for bug 2161189 (and probably a few others)

Change-Id: I2933a25dcb5fecbb1fc238f157264e621b8f295b
2011-09-16 00:25:16 +02:00

68 lines
1.7 KiB
Bash
Executable file

#!/system/bin/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