hotplug.json 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. [
  2. [ "case", "ACTION", {
  3. "add": [
  4. [ "if",
  5. [ "and",
  6. [ "has", "MAJOR" ],
  7. [ "has", "MINOR" ]
  8. ],
  9. [
  10. [ "if",
  11. [ "eq", "DEVNAME", "null" ],
  12. [
  13. [ "makedev", "/dev/%DEVNAME%", "0666" ],
  14. [ "exec", "/bin/ln", "-s", "/proc/self/fd", "/dev/fd" ],
  15. [ "exec", "/bin/ln", "-s", "/proc/self/fd/0", "/dev/stdin" ],
  16. [ "exec", "/bin/ln", "-s", "/proc/self/fd/1", "/dev/stdout" ],
  17. [ "exec", "/bin/ln", "-s", "/proc/self/fd/2", "/dev/stderr" ],
  18. [ "return" ]
  19. ]
  20. ],
  21. [ "if",
  22. [ "eq", "DEVNAME",
  23. [ "full", "ptmx", "zero", "tty", "net", "random", "urandom" ]
  24. ],
  25. [
  26. [ "makedev", "/dev/%DEVNAME%", "0666" ],
  27. [ "return" ]
  28. ]
  29. ],
  30. [ "if",
  31. [ "regex", "DEVNAME", "^snd" ],
  32. [ "makedev", "/dev/%DEVNAME%", "0660", "audio" ]
  33. ],
  34. [ "if",
  35. [ "regex", "DEVNAME", "^tty" ],
  36. [ "makedev", "/dev/%DEVNAME%", "0660", "dialout" ]
  37. ],
  38. [ "if",
  39. [ "has", "DEVNAME" ],
  40. [ "makedev", "/dev/%DEVNAME%", "0600" ]
  41. ]
  42. ]
  43. ],
  44. [ "if",
  45. [ "has", "FIRMWARE" ],
  46. [
  47. [ "exec", "/sbin/hotplug-call", "%SUBSYSTEM%" ],
  48. [ "load-firmware", "/lib/firmware" ],
  49. [ "return" ]
  50. ]
  51. ],
  52. [ "if",
  53. [ "regex", "DEVNAME", "^ttyGS" ],
  54. [ "start-console", "%DEVNAME%" ]
  55. ]
  56. ],
  57. "remove" : [
  58. [ "if",
  59. [ "and",
  60. [ "has", "DEVNAME" ],
  61. [ "has", "MAJOR" ],
  62. [ "has", "MINOR" ]
  63. ],
  64. [ "rm", "/dev/%DEVNAME%" ]
  65. ]
  66. ]
  67. } ],
  68. [ "if",
  69. [ "and",
  70. [ "has", "BUTTON" ],
  71. [ "eq", "SUBSYSTEM", "button" ]
  72. ],
  73. [ "button", "/etc/rc.button/%BUTTON%" ]
  74. ],
  75. [ "if",
  76. [ "and",
  77. [ "eq", "SUBSYSTEM", "usb-serial" ],
  78. [ "regex", "DEVNAME",
  79. [ "^ttyUSB", "^ttyACM" ]
  80. ]
  81. ],
  82. [ "exec", "/sbin/hotplug-call", "tty" ],
  83. [ "if",
  84. [ "isdir", "/etc/hotplug.d/%SUBSYSTEM%" ],
  85. [ "exec", "/sbin/hotplug-call", "%SUBSYSTEM%" ]
  86. ]
  87. ]
  88. ]