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 | a56cfaa | 2021-04-15 22:03:21 -0700 | [diff] [blame] | 3 | # Check if VirtIO Wi-Fi is enabled. If so, create a mac80211_hwsim radio |
| 4 | # and run the DHCP client |
Roman Kiryanov | d6a8d3c | 2021-04-12 13:35:35 -0700 | [diff] [blame] | 5 | wifi_virtio=`getprop ro.boot.qemu.virtiowifi` |
Weilun Du | 697c799 | 2020-04-13 15:57:38 -0700 | [diff] [blame] | 6 | case "$wifi_virtio" in |
Weilun Du | a56cfaa | 2021-04-15 22:03:21 -0700 | [diff] [blame] | 7 | 1) wifi_mac_prefix=`getprop vendor.net.wifi_mac_prefix` |
| 8 | if [ -n "$wifi_mac_prefix" ]; then |
| 9 | /vendor/bin/mac80211_create_radios 1 $wifi_mac_prefix || exit 1 |
| 10 | fi |
| 11 | setprop ctl.start dhcpclient_wifi |
| 12 | ;; |
Weilun Du | 697c799 | 2020-04-13 15:57:38 -0700 | [diff] [blame] | 13 | esac |
| 14 | |
bohu | 0660075 | 2016-12-27 11:03:41 -0800 | [diff] [blame] | 15 | # set up the second interface (for inter-emulator connections) |
| 16 | # if required |
Weilun Du | aa1fed6 | 2021-02-18 17:18:34 -0800 | [diff] [blame] | 17 | my_ip=`getprop vendor.net.shared_net_ip` |
bohu | 0660075 | 2016-12-27 11:03:41 -0800 | [diff] [blame] | 18 | case "$my_ip" in |
| 19 | "") |
| 20 | ;; |
| 21 | *) ifconfig eth1 "$my_ip" netmask 255.255.255.0 up |
| 22 | ;; |
| 23 | esac |
| 24 | |