mdev_fat.conf 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144
  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 ownership 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 ownership 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. adsp root:audio 660 >sound/
  58. audio root:audio 660 >sound/
  59. dsp root:audio 660 >sound/
  60. mixer root:audio 660 >sound/
  61. sequencer.* root:audio 660 >sound/
  62. # Less typical devices
  63. # raid controllers
  64. cciss!(.*) root:disk 660 =cciss/%1
  65. ida!(.*) root:disk 660 =ida/%1
  66. rd!(.*) root:disk 660 =rd/%1
  67. ttyLTM[0-9] root:dialout 660 @ln -sf $MDEV modem
  68. ttySHSF[0-9] root:dialout 660 @ln -sf $MDEV modem
  69. slamr root:dialout 660 @ln -sf $MDEV slamr0
  70. slusb root:dialout 660 @ln -sf $MDEV slusb0
  71. fuse root:root 666
  72. # dri device
  73. card[0-9] root:video 660 =dri/
  74. # misc stuff
  75. agpgart root:root 660 >misc/
  76. psaux root:root 660 >misc/
  77. rtc root:root 664 >misc/
  78. # input stuff
  79. event[0-9]+ root:root 640 =input/
  80. mice root:root 640 =input/
  81. mouse[0-9] root:root 640 =input/
  82. ts[0-9] root:root 600 =input/
  83. # v4l stuff
  84. vbi[0-9] root:video 660 >v4l/
  85. video[0-9] root:video 660 >v4l/
  86. # dvb stuff
  87. dvb.* root:video 660 */lib/mdev/dvbdev
  88. # load drivers for usb devices
  89. usbdev[0-9].[0-9] root:root 660 */lib/mdev/usbdev
  90. usbdev[0-9].[0-9]_.* root:root 660
  91. # zaptel devices
  92. zap(.*) root:dialout 660 =zap/%1
  93. dahdi!(.*) root:dialout 660 =dahdi/%1
  94. # HTC Android
  95. # Attaching it via USB cable causes a flurry of activity:
  96. #
  97. # mdev[1271]: 48.639459 ACTION:add SUBSYSTEM:usb DEVNAME:bus/usb/001/009 DEVPATH:/devices/pci0000:00/0000:00:02.1/usb1/1-5
  98. # mdev[1271]: mknod bus/usb/001/009 (189,8) 20660 0:0
  99. # 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
  100. # mdev[1272]: running: modprobe "$MODALIAS"
  101. # 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
  102. # 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
  103. # 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
  104. # 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
  105. # mdev[1276]: running: modprobe "$MODALIAS"
  106. # modprobe: module scsi:t-0x00 not found in modules.dep
  107. # 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
  108. # 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:
  109. # 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
  110. # mdev[1279]: mknod bsg/11:0:0:0 (253,1) 20660 0:0
  111. # mdev[1280]: 49.663516 ACTION:add SUBSYSTEM:bdi DEVNAME:(null) DEVPATH:/devices/virtual/bdi/8:16
  112. # mdev[1281]: 49.664748 ACTION:add SUBSYSTEM:block DEVNAME:sdb DEVPATH:/block/sdb
  113. # mdev[1281]: mknod sdb (8,16) 60660 0:0
  114. # mdev[1282]: 49.677597 ACTION:change SUBSYSTEM:block DEVNAME:sdb DEVPATH:/block/sdb
  115. # mdev[1283]: 50.692936 ACTION:change SUBSYSTEM:block DEVNAME:sdb DEVPATH:/block/sdb
  116. #
  117. # We are hooking to the last events. To avoid having two scripts running,
  118. # we check for DISK_MEDIA_CHANGE=1 (prev to last event has it,
  119. # and it's the _only_ difference in env for these two events as of kernel 3.7.7)
  120. # Unfortunately, there is no event for "user pressed [Turn USB storage] btn"!
  121. # Script merely backgrounds and tries to rescan partition table for 1 minute:
  122. ACTION=change;SUBSYSTEM=block;DISK_MEDIA_CHANGE=1;.* 0:0 660 */etc/mdev.conf.change_blockdev.sh