70-persistent-usb-gps.rules 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. #
  2. # ## This file is obselete, and kept for historical records
  3. # ## only. It documents alternate ways to use the (then) new
  4. # ## udev facility.
  5. #
  6. # ## See the file gpsd.rules in the source for updated rules
  7. #
  8. # Author: Fulup Ar Foll
  9. # Date: 26-jun-09
  10. # Object: make sure GPS dev (ex: /dev/gps-usb) dont change name on sleep/wakeup
  11. # -----------------------------------------------------------------------------
  12. #
  13. # 1) place this file in /etc/udev/rules.d
  14. # 2) use default config or update with your own vendor:product ID (use "lsusb" to find them)
  15. # 3) reload udev with "/etc/init.d/udev reload"
  16. #
  17. # Device alias can be:
  18. # (default) - by path ==> SYMLINK="serial-$env(ID_PATH)" /dev/gps-pci-0000:00:1d.1-usb-0:1:1.0
  19. # - static ==> SYMLINK="gps-usb" /dev/gps-usb
  20. # - custom ==> RUN+="/usr/local/bin/myscript" /dev/any-thingk-you-want
  21. #
  22. # DEFAULT CONFIG: you can use this file "as it is", you should then see a /dev/gps-pci*
  23. # that will be created for any of the serial/usb you hot-plug. The name is fixed but
  24. # depend on the USB port you use. As a result the name is fixed until you keep the same socket.
  25. #
  26. # -----------------------------------------------------------------------
  27. # check "man 7 udev" for forther syntax. (search for %n)
  28. # -----------------------------------------------------------------------
  29. # Examples
  30. # -----------------------------------------------------------------------
  31. # Your own script: SUBSYSTEM=="tty", SYSFS{idVendor}=="xxxx", SYSFS{idProduct}=="yyyy", RUN+="/usr/local/bin/myscript"
  32. # Static device name: SUBSYSTEM=="tty", SYSFS{idVendor}=="xxxx", SYSFS{idProduct}=="yyyy", SYMLINK="gps-usb"
  33. # Path dependent name: SUBSYSTEM=="tty", SYSFS{idVendor}=="xxxx", SYSFS{idProduct}=="yyyy", SYMLINK="gps-$env{ID_PATH}"
  34. # In first case you do what ever you want, script received the information about context in environement variables
  35. # In second case you name is fixe (ex: /dev/gps-usb) this is working if your usb/serial ID(vendor:product) is unique
  36. # In third case your device name depend on the port it is plugged in.
  37. # ========================================================================================
  38. # update YOUR CONFIG here after
  39. # ========================================================================================
  40. # Default rules is applied for any unspecified vendor:product devices
  41. # -----------------------------------------------------------------------------------------
  42. SUBSYSTEM=="tty", SYSFS{idVendor}=="?*", SYSFS{idProduct}=="?*", SYMLINK="gps-$env{ID_PATH}"
  43. # Well known device may get a static device name
  44. # -----------------------------------------------------------------------
  45. SUBSYSTEM=="tty", SYSFS{idVendor}=="10c4", SYSFS{idProduct}=="ea60", SYMLINK="gps-usb"