blob: ece75b4298c9b6199a7d839c60c4652e18d03b26 [file] [log] [blame]
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -08001#!/system/bin/sh
2
David 'Digit' Turnereeeca4d2011-01-18 20:13:12 +01003# Setup networking when boot starts
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -08004ifconfig eth0 10.0.2.15 netmask 255.255.255.0 up
5route add default gw 10.0.2.2 dev eth0
6
David 'Digit' Turnereeeca4d2011-01-18 20:13:12 +01007# 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#
Simon Braunschmidt15681df2008-11-28 01:24:13 +010024qemud=`getprop ro.kernel.android.qemud`
25case "$qemud" in
26 "")
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080027 radio_ril=`getprop ro.kernel.android.ril`
Simon Braunschmidt15681df2008-11-28 01:24:13 +010028 case "$radio_ril" in
29 "")
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080030 # no need for the radio interface daemon
31 # telephony is entirely emulated in Java
32 setprop ro.radio.noril yes
33 stop ril-daemon
Simon Braunschmidt15681df2008-11-28 01:24:13 +010034 ;;
35 esac
36 ;;
37esac
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080038
David 'Digit' Turnereeeca4d2011-01-18 20:13:12 +010039# Setup additionnal DNS servers if needed
David 'Digit' Turner95df8872011-01-06 11:01:35 +010040num_dns=`getprop ro.kernel.ndns`
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080041case "$num_dns" in
42 2) setprop net.eth0.dns2 10.0.2.4
David 'Digit' Turnereeeca4d2011-01-18 20:13:12 +010043 ;;
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080044 3) setprop net.eth0.dns2 10.0.2.4
David 'Digit' Turnereeeca4d2011-01-18 20:13:12 +010045 setprop net.eth0.dns3 10.0.2.5
46 ;;
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080047 4) setprop net.eth0.dns2 10.0.2.4
David 'Digit' Turnereeeca4d2011-01-18 20:13:12 +010048 setprop net.eth0.dns3 10.0.2.5
49 setprop net.eth0.dns4 10.0.2.6
50 ;;
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080051esac
52
53# disable boot animation for a faster boot sequence when needed
54boot_anim=`getprop ro.kernel.android.bootanim`
55case "$boot_anim" in
56 0) setprop debug.sf.nobootanimation 1
57 ;;
58esac
59
Dries Harnie2a743732010-01-18 17:44:33 +010060# set up the second interface (for inter-emulator connections)
61# if required
62my_ip=`getprop net.shared_net_ip`
63case "$my_ip" in
64 "")
65 ;;
66 *) ifconfig eth1 "$my_ip" netmask 255.255.255.0 up
67 ;;
68esac