wl1251-modules: restore phy0 LEDs on start
authorGrazvydas Ignotas <notasas@gmail.com>
Sat, 15 May 2010 19:07:10 +0000 (22:07 +0300)
committerGrazvydas Ignotas <notasas@gmail.com>
Sat, 15 May 2010 19:38:53 +0000 (22:38 +0300)
recipes/pandora-system/wl1251-modules/rc.wl1251

index 7018f49..58f51c2 100755 (executable)
@@ -26,6 +26,16 @@ d_start() {
        insmod $(busybox find /lib/modules/$(uname -r)/updates -name "wl1251.ko")
        insmod $(busybox find /lib/modules/$(uname -r)/updates -name "wl1251_sdio.ko")
        insmod $(busybox find /lib/modules/$(uname -r) -name "board-omap3pandora-wifi.ko")
+
+       # restore phy0 related LED triggers (they come from mac80211.ko)
+       if [ -e /sys/class/leds/ ] ; then
+               for led in /sys/class/leds/* ; do
+                       trigger=$(grep "$(basename $led)" /etc/default/leds | grep "phy0" | awk '{print $2}')
+                       if [ "x$trigger" != "x" ] ; then
+                               echo "$trigger" > "$led/trigger"
+                       fi
+               done
+       fi
 }
 
 case "$1" in