mirror of the now-defunct rocklinux.org
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

148 lines
5.1 KiB

  1. # There are a number of modifiers that are allowed to be used in some
  2. # of the different fields. They provide the following subsitutions:
  3. #
  4. # %n the "kernel number" of the device.
  5. # For example, 'sda3' has a "kernel number" of '3'
  6. # %e the smallest number for that name which does not matches an existing node
  7. # %k the kernel name for the device
  8. # %M the kernel major number for the device
  9. # %m the kernel minor number for the device
  10. # %b the bus id for the device
  11. # %c the string returned by the PROGRAM
  12. # %s{filename} the content of a sysfs attribute
  13. # %% the '%' char itself
  14. #
  15. # workaround for devices which do not report media changes
  16. BUS=="ide", KERNEL=="hd[a-z]", ATTR{removable}=="1", \
  17. ENV{ID_MODEL}=="IOMEGA_ZIP*", OPTIONS+="all_partitions"
  18. # IDE devices
  19. BUS=="ide", KERNEL=="hd[a-z]*", PROGRAM="ide-devfs.sh %k %b %n", \
  20. SYMLINK+="%c{1} %c{2}", GROUP="%c{3}"
  21. # SCSI devices
  22. BUS=="scsi", PROGRAM="scsi-devfs.sh %k %b %n", SYMLINK+="%c{1} %c{2}"
  23. # RAID controllers
  24. KERNEL=="cciss!*|ida!*|rd!*", PROGRAM="raid-devfs.sh %k", \
  25. SYMLINK+="%c{1}"
  26. # other block devices
  27. KERNEL=="md[0-9]*", SYMLINK+="md/%n"
  28. KERNEL=="loop[0-9]*", SYMLINK+="loop/%n"
  29. KERNEL=="ram[0-9]*", SYMLINK+="rd/%n"
  30. # USB devices
  31. BUS=="usb", KERNEL=="auer[0-9]*", SYMLINK+="usb/%k"
  32. BUS=="usb", KERNEL=="cpad[0-9]*", SYMLINK+="usb/%k"
  33. BUS=="usb", KERNEL=="dabusb*", SYMLINK+="usb/%k"
  34. BUS=="usb", KERNEL=="hiddev*", SYMLINK+="usb/%k"
  35. BUS=="usb", KERNEL=="legousbtower*", SYMLINK+="usb/%k"
  36. BUS=="usb", KERNEL=="lp[0-9]*", SYMLINK+="usb/%k"
  37. BUS=="usb", KERNEL=="ttyUSB*", ATTR{product}=="Palm Handheld*", \
  38. SYMLINK+="pilot"
  39. # usbfs-like devices
  40. SUBSYSTEM=="usb_device", PROGRAM="/bin/sh -c 'K=%k; K=$${K#usbdev}; B=$${K%%%%.*}; D=$${K#*.}; echo bus/usb/$$B/$$D'", \
  41. SYMLINK+="%c"
  42. # serial devices
  43. KERNEL=="ttyS[0-9]*", SYMLINK+="tts/%n"
  44. KERNEL=="ttyUSB[0-9]*", SYMLINK+="tts/USB%n"
  45. KERNEL=="rfcomm[0-9]*", SYMLINK+="bluetooth/rfcomm/%n",
  46. KERNEL=="capi", SYMLINK+="capi20", SYMLINK+="isdn/capi20"
  47. KERNEL=="capi[0-9]*", SYMLINK+="capi/%n"
  48. # vc devices
  49. KERNEL=="tty[0-9]*", SYMLINK+="vc/%n"
  50. KERNEL=="vcs", SYMLINK+="vcc/0"
  51. KERNEL=="vcs[0-9]*", SYMLINK+="vcc/%n"
  52. KERNEL=="vcsa", SYMLINK+="vcc/a0"
  53. KERNEL=="vcsa[0-9]*", SYMLINK+="vcc/a%n"
  54. # video devices
  55. KERNEL=="video[0-9]*", SYMLINK+="v4l/%k"
  56. KERNEL=="radio[0-9]*", SYMLINK+="v4l/%k"
  57. KERNEL=="vbi[0-9]*", SYMLINK+="v4l/%k"
  58. KERNEL=="vtx[0-9]*", SYMLINK+="v4l/%k"
  59. KERNEL=="dvb*", PROGRAM="/bin/sh -c 'KSYMLINK+=%k; KSYMLINK+=$${KNAME#dvb}; A=$${KNAME%%%%.*}; D=$${KNAME#*.}; echo dvb/adapter$$A/$$D'", \
  60. SYMLINK+="%c"
  61. KERNEL=="fb[0-9]*", SYMLINK+="fb/%n"
  62. KERNEL=="card[0-9]*", SYMLINK+="dri/%k"
  63. # misc devices
  64. KERNEL=="apm_bios", SYMLINK+="misc/%k",
  65. KERNEL=="agpgart", SYMLINK+="misc/%k"
  66. KERNEL=="hw_random", SYMLINK+="hwrng"
  67. KERNEL=="nvram", SYMLINK+="misc/%k"
  68. KERNEL=="psaux", SYMLINK+="misc/%k"
  69. KERNEL=="rtc", SYMLINK+="misc/%k"
  70. KERNEL=="tun", SYMLINK+="net/%k"
  71. # printers and parallel devices
  72. KERNEL=="lp[0-9]*", SYMLINK+="printers/%n"
  73. KERNEL=="parport[0-9]*", SYMLINK+="parports/%n"
  74. KERNEL=="i2c-[0-9]*", SYMLINK+="i2c/%n"
  75. KERNEL=="fd[0-9]*", SYMLINK+="floppy/%n"
  76. KERNEL=="cdemu[0-9]*", SYMLINK+="cdemu/%n"
  77. KERNEL=="pktcdvd[0-9]*", SYMLINK+="pktcdvd/%n"
  78. KERNEL=="pktcdvd", SYMLINK+="pktcdvd/control"
  79. KERNEL=="cpu[0-9]*", SYMLINK+="cpu/%n/cpuid"
  80. KERNEL=="msr[0-9]*", SYMLINK+="cpu/%n/msr"
  81. KERNEL=="microcode", SYMLINK+="cpu/microcode misc/microcode"
  82. KERNEL=="umad*", SYMLINK+="infiniband/%k"
  83. KERNEL=="issm*", SYMLINK+="infiniband/%k"
  84. KERNEL=="uverbs*", SYMLINK+="infiniband/%k"
  85. KERNEL=="ucm*", SYMLINK+="infiniband/%k"
  86. # sound devices
  87. KERNEL=="controlC[0-9]*", SYMLINK+="snd/%k"
  88. KERNEL=="hwC[D0-9]*", SYMLINK+="snd/%k"
  89. KERNEL=="pcmC[D0-9cp]*", SYMLINK+="snd/%k"
  90. KERNEL=="midiC[D0-9]*", SYMLINK+="snd/%k"
  91. KERNEL=="timer", SYMLINK+="snd/%k"
  92. KERNEL=="seq", SYMLINK+="snd/%k"
  93. KERNEL=="audio*", SYMLINK+="sound/%k"
  94. KERNEL=="dsp*", SYMLINK+="sound/%k"
  95. KERNEL=="adsp*", SYMLINK+="sound/%k"
  96. KERNEL=="midi*", SYMLINK+="sound/%k"
  97. KERNEL=="mixer*", SYMLINK+="sound/%k"
  98. KERNEL=="sequencer*", SYMLINK+="sound/%k"
  99. KERNEL=="amidi*", SYMLINK+="sound/%k"
  100. KERNEL=="dmmidi*", SYMLINK+="sound/%k"
  101. KERNEL=="admmidi*", SYMLINK+="sound/%k"
  102. # ieee1394 devices
  103. KERNEL=="dv1394*", SYMLINK+="dv1394/%n"
  104. KERNEL=="video1394*", SYMLINK+="video1394/%n"
  105. # input devices
  106. KERNEL=="mice", SYMLINK+="input/%k"
  107. KERNEL=="mouse[0-9]*", SYMLINK+="input/%k"
  108. KERNEL=="event[0-9]*", SYMLINK+="input/%k"
  109. KERNEL=="js[0-9]*", SYMLINK+="input/%k"
  110. KERNEL=="ts[0-9]*", SYMLINK+="input/%k"
  111. KERNEL=="uinput", SYMLINK+="input/%k"
  112. # Zaptel
  113. KERNEL=="zapctl", SYMLINK+="zap/ctl"
  114. KERNEL=="zaptimer", SYMLINK+="zap/timer"
  115. KERNEL=="zapchannel", SYMLINK+="zap/channel"
  116. KERNEL=="zappseudo", SYMLINK+="zap/pseudo"
  117. KERNEL=="zap[0-9]*", SYMLINK+="zap/%n"
  118. # AOE character devices
  119. SUBSYSTEM=="aoe", KERNEL=="discover", SYMLINK+="etherd/%k"
  120. SUBSYSTEM=="aoe", KERNEL=="err", SYMLINK+="etherd/%k"
  121. SUBSYSTEM=="aoe", KERNEL=="interfaces", SYMLINK+="etherd/%k"
  122. # device mapper creates its own device nodes, so ignore these
  123. # KERNEL=="dm-[0-9]*", SYMLINK+=""
  124. KERNEL=="device-mapper", SYMLINK+="mapper/control"
  125. ACTION=="add", SUBSYSTEM=="firmware", RUN+="firmware_helper"