bohu | b173355 | 2017-05-26 10:27:34 -0700 | [diff] [blame] | 1 | #!/vendor/bin/sh |
bohu | 0660075 | 2016-12-27 11:03:41 -0800 | [diff] [blame] | 2 | |
Weilun Du | 697c799 | 2020-04-13 15:57:38 -0700 | [diff] [blame] | 3 | # Check if VirtIO Wi-Fi is enabled. If so, run the DHCP client |
| 4 | |
| 5 | wifi_virtio=`getprop ro.kernel.qemu.virtiowifi` |
| 6 | case "$wifi_virtio" in |
| 7 | 1) setprop ctl.start dhcpclient_wifi |
| 8 | ;; |
| 9 | esac |
| 10 | |
| 11 | # Check if WiFi with mac80211_hwsim is enabled. If so, run the WiFi init script. If not we just |
Bjoern Johansson | bf93db3 | 2017-07-14 15:47:19 -0700 | [diff] [blame] | 12 | # have to run the DHCP client in the default namespace and that will set up |
| 13 | # all the networking. |
Weilun Du | 697c799 | 2020-04-13 15:57:38 -0700 | [diff] [blame] | 14 | wifi_hwsim=`getprop ro.kernel.qemu.wifi` |
| 15 | case "$wifi_hwsim" in |
Bjoern Johansson | d154a21 | 2017-08-31 13:48:45 -0700 | [diff] [blame] | 16 | 1) /vendor/bin/init.wifi.sh |
Bjoern Johansson | 00455fa | 2017-02-09 22:37:51 -0800 | [diff] [blame] | 17 | ;; |
Bjoern Johansson | bf93db3 | 2017-07-14 15:47:19 -0700 | [diff] [blame] | 18 | *) setprop ctl.start dhcpclient_def |
bohu | 0660075 | 2016-12-27 11:03:41 -0800 | [diff] [blame] | 19 | ;; |
| 20 | esac |
| 21 | |
bohu | 0660075 | 2016-12-27 11:03:41 -0800 | [diff] [blame] | 22 | # set up the second interface (for inter-emulator connections) |
| 23 | # if required |
| 24 | my_ip=`getprop net.shared_net_ip` |
| 25 | case "$my_ip" in |
| 26 | "") |
| 27 | ;; |
| 28 | *) ifconfig eth1 "$my_ip" netmask 255.255.255.0 up |
| 29 | ;; |
| 30 | esac |
| 31 | |