• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

device/generic/common


Commit MetaInfo

Revisióndf62a6675920cf8864f7611764bc0c19e9e1f822 (tree)
Tiempo2019-06-13 18:05:50
AutorChih-Wei Huang <cwhuang@linu...>
CommiterChih-Wei Huang

Log Message

init.sh: remove wl driver if it's not used

Sometimes the Broadcom wl driver is loaded unexpectedly. Unload it
if it's not being used.

Cambiar Resumen

Diferencia incremental

--- a/init.sh
+++ b/init.sh
@@ -15,6 +15,13 @@ function set_prop_if_empty()
1515 [ -z "$(getprop $1)" ] && set_property "$1" "$2"
1616 }
1717
18+function rmmod_if_exist()
19+{
20+ for m in $*; do
21+ [ -d /sys/module/$m ] && rmmod $m
22+ done
23+}
24+
1825 function init_misc()
1926 {
2027 # device information
@@ -30,6 +37,13 @@ function init_misc()
3037 # enable sdcardfs if /data is not mounted on tmpfs or 9p
3138 mount | grep /data\ | grep -qE 'tmpfs|9p'
3239 [ $? -ne 0 ] && modprobe sdcardfs
40+
41+ # remove wl if it's not used
42+ local wifi
43+ if [ -d /sys/class/net/wlan0 ]; then
44+ wifi=$(basename `readlink /sys/class/net/wlan0/device/driver`)
45+ [ "$wifi" != "wl" ] && rmmod_if_exist wl
46+ fi
3347 }
3448
3549 function init_hal_audio()