add firmware loading support to hotplug
authorFelix Fietkau <nbd@openwrt.org>
Thu, 5 Jan 2006 01:20:44 +0000 (01:20 +0000)
committerFelix Fietkau <nbd@openwrt.org>
Thu, 5 Jan 2006 01:20:44 +0000 (01:20 +0000)
SVN-Revision: 2834

openwrt/package/base-files/default/sbin/hotplug

index e53b2afcc57f31e28a403b0d03017ba4e24f48a1..3500f75201947e2f049008fb94089832aec968f5 100755 (executable)
@@ -1,4 +1,13 @@
 #!/bin/sh
+[ "$1" = "firmware" -a "$ACTION" = "add" ] && {
+       [ -f "/lib/firmware/$FIRMWARE" ] && {
+               echo 1 > "/sys$DEVPATH/loading"
+               cp "/lib/firmware/$FIRMWARE" "/sys$DEVPATH/data"
+               echo 0 > "/sys$DEVPATH/loading"
+       }
+       exit 0
+}
+
 [ -e /tmp/.failsafe ] && {
        export FAILSAFE=true
 } || {