init 796 B

123456789101112131415161718192021
  1. #!/bin/sh
  2. if [ "$ACTION" == "add" ];then
  3. if [ "$DEVPATH" == "/bus/usb" ];then
  4. mount -t usbfs usbfs /proc/bus/usb
  5. fi
  6. fi
  7. if [ "$SUBSYSTEM" == "firmware" ];then
  8. logger "Firmware load for $FIRMWARE requested"
  9. if [ "$ACTION" == "add" ];then
  10. if [ -e "/lib/firmware/$FIRMWARE" ];then
  11. logger "Firmware loading ..."
  12. echo 1 > /sys$DEVPATH/loading
  13. cat "/lib/firmware/$FIRMWARE" > /sys$DEVPATH/data
  14. echo 0 > /sys$DEVPATH/loading
  15. logger "finished."
  16. else
  17. logger "Firmware file $FIRMWARE not found"
  18. echo -1 > /sys$DEVPATH/loading
  19. fi
  20. fi
  21. fi