From d5a121f3add87d2640253381d63cd65a868110d3 Mon Sep 17 00:00:00 2001 From: Howard Chu Date: Thu, 21 Apr 2011 17:46:07 -0700 Subject: [PATCH] Always use wlan0 as interface name --- init | 49 ++++++++------------------------------------ init.cfg/init.froyo.rc | 4 ++-- init.cfg/init.gingerbread.rc | 4 ++-- 3 files changed, 13 insertions(+), 44 deletions(-) diff --git a/init b/init index 87e0158..736097f 100755 --- a/init +++ b/init @@ -262,20 +262,6 @@ case "$HW" in ;; esac -NEW_BPROP=0 -HWS="" -if [ -f /data/build.prop ]; then - HWS=`grep ^#Hardware /data/build.prop | sed -e 's/^.* //'` -fi -if [ $NEW_SYSTEM -eq 1 -o $HW != "$HWS" ]; then - cp /system/build.prop /data/build.prop - NEW_BPROP=1 - if [ $HW = VOGUE ]; then - sed -i s/^wifi/#wifi/ /data/build.prop - fi - echo "#Hardware $HW" >> /data/build.prop -fi - ### Fix su on some builds... mount --bind /bin/su /system/bin/su 2> /dev/null mount --bind /bin/su /system/xbin/su 2> /dev/null @@ -424,18 +410,16 @@ if [ "$WIFI_TI" = "1" ] || [ "$WIFI_BCM" = "1" ];then depmod fi - if [ $NEW_BPROP -eq 1 ]; then - sed -i s/^#wifi/wifi/ /data/build.prop + if [ "`grep -c ^wifi /etc/default.prop`" != "2" ]; then + echo "wifi.interface = wlan0" >> /etc/default.prop + echo "wifi.supplicant_scan_interval = 45" >> /etc/default.prop fi fi -#if [ -f /system/eclair.build ] -#then -# mount --bind /lib/eclair/libhardware_legacy.so /system/lib/libhardware_legacy.so -#elif [ -f /system/froyo.build ] -#then -# mount --bind /lib/froyo/libhardware_legacy.so /system/lib/libhardware_legacy.so -#fi +if [ -f /system/eclair.build ] +then + mount --bind /lib/eclair/libhardware_legacy.so /system/lib/libhardware_legacy.so +fi # fix PPP data device name if [ $NEW_ROOT -eq 1 ]; then @@ -448,31 +432,18 @@ if [ $NEW_ROOT -eq 1 ]; then fi if [ "$WIFI_TI" = "1" ];then - if [ "`grep -c ^wifi /data/build.prop`" != "2" ]; then - echo "wifi.interface = tiwlan0" >> /data/build.prop - echo "wifi.supplicant_scan_interval = 45" >> /data/build.prop - fi + ip link set dev tiwlan0 name wlan0 fi if [ "$WIFI_BCM" = "1" ] ;then - if [ "`grep -c ^wifi /data/build.prop`" != "2" ]; then - echo "wifi.interface = eth0" >> /data/build.prop - echo "wifi.supplicant_scan_interval = 45" >> /data/build.prop - fi + ip link set dev eth0 name wlan0 # fyi: firmware is loaded from /etc/wifi/bcm432x/bcm4325-rtecdc.bin, nvram from /data/wifi-nvram.txt - mount --bind /etc/wifi/bcm432x/dhcpcd.conf /system/etc/dhcpcd/dhcpcd.conf - mount --bind /etc/wifi/bcm432x/wpa_supplicant.conf /system/etc/wifi/wpa_supplicant.conf - if [ $NEW_ROOT -eq 1 ]; then # init.rc: fix wpa_supplicant service - sed -i s/-itiwlan0/-ieth0/ /etc/init.rc sed -i s/-Dtiwlan0/-Dwext/ /etc/init.rc - # init.rc: fix dhcpcd service, wifi.interface, and wpa_supplicant service socket - sed -i s/tiwlan0/eth0/ /etc/init.rc - # init.rc: sed -i s/user\ wifi/#user\ wifi/ /etc/init.rc sed -i s/group\ wifi/#group\ wifi/ /etc/init.rc @@ -506,8 +477,6 @@ if [ "$WIFI_BCM" = "1" ] ;then fi fi -mount --bind /data/build.prop /system/build.prop - if [ -f "$card/conf/$RCCONFIG.user.conf" ]; then /bin/userinit.sh -c "$card/conf/$RCCONFIG.user.conf" else diff --git a/init.cfg/init.froyo.rc b/init.cfg/init.froyo.rc index 98b7aa0..5bf14ec 100644 --- a/init.cfg/init.froyo.rc +++ b/init.cfg/init.froyo.rc @@ -452,12 +452,12 @@ service wlan_loader /etc/wifi/loadit oneshot service wpa_supplicant /system/bin/wpa_supplicant \ - -Dtiwlan0 -itiwlan0 -c/data/misc/wifi/wpa_supplicant.conf -q + -Dtiwlan0 -iwlan0 -c/data/misc/wifi/wpa_supplicant.conf -q # we will start as root and wpa_supplicant will switch to user wifi # after setting up the capabilities required for WEXT # user wifi # group wifi inet keystore - socket wpa_tiwlan0 dgram 660 wifi wifi + socket wpa_wlan0 dgram 660 wifi wifi disabled oneshot diff --git a/init.cfg/init.gingerbread.rc b/init.cfg/init.gingerbread.rc index cf04185..020fce2 100644 --- a/init.cfg/init.gingerbread.rc +++ b/init.cfg/init.gingerbread.rc @@ -453,12 +453,12 @@ service wlan_loader /etc/wifi/loadit oneshot service wpa_supplicant /system/bin/wpa_supplicant \ - -Dtiwlan0 -itiwlan0 -c/data/misc/wifi/wpa_supplicant.conf -q + -Dtiwlan0 -iwlan0 -c/data/misc/wifi/wpa_supplicant.conf -q # we will start as root and wpa_supplicant will switch to user wifi # after setting up the capabilities required for WEXT # user wifi # group wifi inet keystore - socket wpa_tiwlan0 dgram 660 wifi wifi + socket wpa_wlan0 dgram 660 wifi wifi disabled oneshot -- 2.1.4