ece75b4298c9b6199a7d839c60c4652e18d03b26
[iec.git] / src / type3_AndroidCloud / anbox-master / android / init.goldfish.sh
1 #!/system/bin/sh
2
3 # Setup networking when boot starts
4 ifconfig eth0 10.0.2.15 netmask 255.255.255.0 up
5 route add default gw 10.0.2.2 dev eth0
6
7 # ro.kernel.android.qemud is normally set when we
8 # want the RIL (radio interface layer) to talk to
9 # the emulated modem through qemud.
10 #
11 # However, this will be undefined in two cases:
12 #
13 # - When we want the RIL to talk directly to a guest
14 #   serial device that is connected to a host serial
15 #   device by the emulator.
16 #
17 # - We don't want to use the RIL but the VM-based
18 #   modem emulation that runs inside the guest system
19 #   instead.
20 #
21 # The following detects the latter case and sets up the
22 # system for it.
23 #
24 qemud=`getprop ro.kernel.android.qemud`
25 case "$qemud" in
26     "")
27     radio_ril=`getprop ro.kernel.android.ril`
28     case "$radio_ril" in
29         "")
30         # no need for the radio interface daemon
31         # telephony is entirely emulated in Java
32         setprop ro.radio.noril yes
33         stop ril-daemon
34         ;;
35     esac
36     ;;
37 esac
38
39 # Setup additionnal DNS servers if needed
40 num_dns=`getprop ro.kernel.ndns`
41 case "$num_dns" in
42     2) setprop net.eth0.dns2 10.0.2.4
43        ;;
44     3) setprop net.eth0.dns2 10.0.2.4
45        setprop net.eth0.dns3 10.0.2.5
46        ;;
47     4) setprop net.eth0.dns2 10.0.2.4
48        setprop net.eth0.dns3 10.0.2.5
49        setprop net.eth0.dns4 10.0.2.6
50        ;;
51 esac
52
53 # disable boot animation for a faster boot sequence when needed
54 boot_anim=`getprop ro.kernel.android.bootanim`
55 case "$boot_anim" in
56     0)  setprop debug.sf.nobootanimation 1
57     ;;
58 esac
59
60 # set up the second interface (for inter-emulator connections)
61 # if required
62 my_ip=`getprop net.shared_net_ip`
63 case "$my_ip" in
64     "")
65     ;;
66     *) ifconfig eth1 "$my_ip" netmask 255.255.255.0 up
67     ;;
68 esac