1#!/vendor/bin/sh 2 3# Check if VirtIO Wi-Fi is enabled. If so, create a mac80211_hwsim radio 4# and run the DHCP client 5wifi_virtio=`getprop ro.boot.qemu.virtiowifi` 6case "$wifi_virtio" in 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 ;; 13esac 14 15# Check if WiFi with mac80211_hwsim is enabled. If so, run the WiFi init script. If not we just 16# have to run the DHCP client in the default namespace and that will set up 17# all the networking. 18wifi_hwsim=`getprop ro.boot.qemu.wifi` 19case "$wifi_hwsim" in 20 1) /vendor/bin/init.wifi.sh 21 ;; 22 *) setprop ctl.start dhcpclient_def 23 ;; 24esac 25 26# set up the second interface (for inter-emulator connections) 27# if required 28my_ip=`getprop vendor.net.shared_net_ip` 29case "$my_ip" in 30 "") 31 ;; 32 *) ifconfig eth1 "$my_ip" netmask 255.255.255.0 up 33 ;; 34esac 35 36