mdev_fat.conf 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150
  1. #
  2. # This is a sample mdev.conf
  3. #
  4. # Provide user, group, and mode information for devices. If a regex matches
  5. # the device name provided by sysfs, use the appropriate user:group and mode
  6. # instead of the default 0:0 660.
  7. #
  8. # Syntax:
  9. # [-][ENVVAR=regex;]...devicename_regex user:group mode [=path]|[>path]|[!] [@|$|*cmd args...]
  10. # [-][ENVVAR=regex;]...@maj,min[-min2] user:group mode [=path]|[>path]|[!] [@|$|*cmd args...]
  11. # [-]$ENVVAR=regex user:group mode [=path]|[>path]|[!] [@|$|*cmd args...]
  12. #
  13. # [-]: do not stop on this match, continue reading mdev.conf
  14. # =: move, >: move and create a symlink
  15. # !: do not create device node
  16. # @|$|*: run cmd if $ACTION=remove, @cmd if $ACTION=add, *cmd in all cases
  17. # support module loading on hotplug
  18. $MODALIAS=.* root:root 660 @modprobe "$MODALIAS"
  19. # null may already exist; therefore mode has to be changed with command
  20. null root:root 666 @chmod 666 $MDEV
  21. zero root:root 666
  22. full root:root 666
  23. random root:root 444
  24. urandom root:root 444
  25. hwrandom root:root 444
  26. grsec root:root 660
  27. kmem root:root 640
  28. mem root:root 640
  29. port root:root 640
  30. # console may already exist; therefore mode has to be changed with command
  31. console root:tty 600 @chmod 600 $MDEV
  32. ptmx root:tty 666
  33. pty.* root:tty 660
  34. # Typical devices
  35. tty root:tty 666
  36. tty[0-9]* root:tty 660
  37. vcsa*[0-9]* root:tty 660
  38. ttyS[0-9]* root:uucp 660
  39. # block devices
  40. ram([0-9]*) root:disk 660 >rd/%1
  41. loop([0-9]+) root:disk 660 >loop/%1
  42. sd[a-z].* root:disk 660 */lib/mdev/usbdisk_link
  43. hd[a-z][0-9]* root:disk 660 */lib/mdev/ide_links
  44. md[0-9]* root:disk 660
  45. sr[0-9]* root:cdrom 660 @ln -sf $MDEV cdrom
  46. fd[0-9]* root:floppy 660
  47. # net devices
  48. SUBSYSTEM=net;.* root:root 600 @nameif
  49. tun[0-9]* root:root 600 =net/
  50. tap[0-9]* root:root 600 =net/
  51. # alsa sound devices and audio stuff
  52. pcm.* root:audio 660 =snd/
  53. control.* root:audio 660 =snd/
  54. midi.* root:audio 660 =snd/
  55. seq root:audio 660 =snd/
  56. timer root:audio 660 =snd/
  57. # for kernels/mdevs which expose full path of alsa devices:
  58. snd/pcm.* root:audio 660
  59. snd/control.* root:audio 660
  60. snd/midi.* root:audio 660
  61. snd/seq root:audio 660
  62. snd/timer root:audio 660
  63. adsp root:audio 660 >sound/
  64. audio root:audio 660 >sound/
  65. dsp root:audio 660 >sound/
  66. mixer root:audio 660 >sound/
  67. sequencer.* root:audio 660 >sound/
  68. # Less typical devices
  69. # raid controllers
  70. cciss!(.*) root:disk 660 =cciss/%1
  71. ida!(.*) root:disk 660 =ida/%1
  72. rd!(.*) root:disk 660 =rd/%1
  73. ttyLTM[0-9] root:dialout 660 @ln -sf $MDEV modem
  74. ttySHSF[0-9] root:dialout 660 @ln -sf $MDEV modem
  75. slamr root:dialout 660 @ln -sf $MDEV slamr0
  76. slusb root:dialout 660 @ln -sf $MDEV slusb0
  77. fuse root:root 666
  78. # dri device
  79. card[0-9] root:video 660 =dri/
  80. # misc stuff
  81. agpgart root:root 660 >misc/
  82. psaux root:root 660 >misc/
  83. rtc root:root 664 >misc/
  84. # input stuff
  85. event[0-9]+ root:root 640 =input/
  86. mice root:root 640 =input/
  87. mouse[0-9] root:root 640 =input/
  88. ts[0-9] root:root 600 =input/
  89. # v4l stuff
  90. vbi[0-9] root:video 660 >v4l/
  91. video[0-9] root:video 660 >v4l/
  92. # dvb stuff
  93. dvb.* root:video 660 */lib/mdev/dvbdev
  94. # load drivers for usb devices
  95. usbdev[0-9].[0-9] root:root 660 */lib/mdev/usbdev
  96. usbdev[0-9].[0-9]_.* root:root 660
  97. # zaptel devices
  98. zap(.*) root:dialout 660 =zap/%1
  99. dahdi!(.*) root:dialout 660 =dahdi/%1
  100. # HTC Android
  101. # Attaching it via USB cable causes a flurry of activity:
  102. #
  103. # mdev[1271]: 48.639459 ACTION:add SUBSYSTEM:usb DEVNAME:bus/usb/001/009 DEVPATH:/devices/pci0000:00/0000:00:02.1/usb1/1-5
  104. # mdev[1271]: mknod bus/usb/001/009 (189,8) 20660 0:0
  105. # mdev[1272]: 48.642354 ACTION:add SUBSYSTEM:usb DEVNAME:(null) DEVPATH:/devices/pci0000:00/0000:00:02.1/usb1/1-5/1-5:1.0
  106. # mdev[1272]: running: modprobe "$MODALIAS"
  107. # mdev[1273]: 48.650078 ACTION:add SUBSYSTEM:scsi DEVNAME:(null) DEVPATH:/devices/pci0000:00/0000:00:02.1/usb1/1-5/1-5:1.0/host11
  108. # mdev[1274]: 48.651297 ACTION:add SUBSYSTEM:scsi_host DEVNAME:(null) DEVPATH:/devices/pci0000:00/0000:00:02.1/usb1/1-5/1-5:1.0/host11/scsi_host/host11
  109. # mdev[1275]: 49.649422 ACTION:add SUBSYSTEM:scsi DEVNAME:(null) DEVPATH:/devices/pci0000:00/0000:00:02.1/usb1/1-5/1-5:1.0/host11/target11:0:0
  110. # mdev[1276]: 49.650703 ACTION:add SUBSYSTEM:scsi DEVNAME:(null) DEVPATH:/devices/pci0000:00/0000:00:02.1/usb1/1-5/1-5:1.0/host11/target11:0:0/11:0:0:0
  111. # mdev[1276]: running: modprobe "$MODALIAS"
  112. # modprobe: module scsi:t-0x00 not found in modules.dep
  113. # mdev[1277]: 49.658002 ACTION:add SUBSYSTEM:scsi_disk DEVNAME:(null) DEVPATH:/devices/pci0000:00/0000:00:02.1/usb1/1-5/1-5:1.0/host11/target11:0:0/11:0:0:0/scsi_disk/11:0:0:0
  114. # mdev[1278]: 49.659244 ACTION:add SUBSYSTEM:scsi_device DEVNAME:(null) DEVPATH:/devices/pci0000:00/0000:00:02.1/usb1/1-5/1-5:1.0/host11/target11:0:0/11:0:0:0/scsi_device/11:0:0:
  115. # mdev[1279]: 49.660535 ACTION:add SUBSYSTEM:bsg DEVNAME:bsg/11:0:0:0 DEVPATH:/devices/pci0000:00/0000:00:02.1/usb1/1-5/1-5:1.0/host11/target11:0:0/11:0:0:0/bsg/11:0:0:0
  116. # mdev[1279]: mknod bsg/11:0:0:0 (253,1) 20660 0:0
  117. # mdev[1280]: 49.663516 ACTION:add SUBSYSTEM:bdi DEVNAME:(null) DEVPATH:/devices/virtual/bdi/8:16
  118. # mdev[1281]: 49.664748 ACTION:add SUBSYSTEM:block DEVNAME:sdb DEVPATH:/block/sdb
  119. # mdev[1281]: mknod sdb (8,16) 60660 0:0
  120. # mdev[1282]: 49.677597 ACTION:change SUBSYSTEM:block DEVNAME:sdb DEVPATH:/block/sdb
  121. # mdev[1283]: 50.692936 ACTION:change SUBSYSTEM:block DEVNAME:sdb DEVPATH:/block/sdb
  122. #
  123. # We are hooking to the last events. To avoid having two scripts running,
  124. # we check for DISK_MEDIA_CHANGE=1 (prev to last event has it,
  125. # and it's the _only_ difference in env for these two events as of kernel 3.7.7)
  126. # Unfortunately, there is no event for "user pressed [Turn USB storage on] btn"!
  127. # Script merely backgrounds and tries to rescan partition table for 1 minute:
  128. ACTION=change;SUBSYSTEM=block;DISK_MEDIA_CHANGE=1;.* 0:0 660 */etc/mdev.conf.change_blockdev.sh