pup_event_backend_firmware 937 B

1234567891011121314151617181920212223242526
  1. #!/bin/ash
  2. #(c) Copyright 2008 Barry Kauler puppylinux.com
  3. #2008 Lesser GPL licence v2 (http://www.fsf.org/licensing/licenses/lgpl.html)
  4. #called via udev rule /etc/udev/rules.d/50-udev-puppy-basic.rules
  5. #i pulled this code out of /sbin/pup_event_backend_d, see 4.1alpha3.
  6. #all of the uevent variables (exs: MODALIAS, SUBSYSTEM) are available here.
  7. #NOTICE: If the full 'udev' package, with utility 'udevd' is installed, rc.sysinit
  8. # will run 'udevd' instead of 'pup_event_backend_d' and this script will be used.
  9. #v409 bugfix, FIRMWARE may have form 'subdir/firmware-file'.
  10. #w004 LANG=C, faster. /bin/ash, even faster.
  11. export LANG=C #w004
  12. baseFIRMWARE="`basename $FIRMWARE`" #v409
  13. fndFIRMWARE="`find /lib/firmware -type f -name ${baseFIRMWARE}`"
  14. if [ "$fndFIRMWARE" != "" ];then
  15. echo 1 > /sys$DEVPATH/loading
  16. cat "$fndFIRMWARE" > /sys$DEVPATH/data
  17. echo 0 > /sys$DEVPATH/loading
  18. else
  19. echo -1 > /sys$DEVPATH/loading
  20. fi
  21. ###END###