# Provide user, group, and mode information for devices. If a regex matches # the device name provided by sysfs, use the appropriate user:group and mode # instead of the default 0:0 660. # # Syntax: # [-]devicename_regex user:group mode [>|=path] [@|$|*cmd args...] # [-]$varname=regex user:group mode [>|=path] [@|$|*cmd args...] # [-]subsystem/regex user:group mode [>|=path] [@|$|*cmd args...] # [-]@major,minor[-minor2] user:group mode [>|=path] [@|$|*cmd args...] # # Leading minus in 1st field means "don't stop on this line", otherwise # search is stopped after the first match. # default is 0:0 660. user, group can be names (no nss!) or numeric. # # =: move, >: move and create a symlink from match to new name # if lhs is regex: %1..%9 are backrefs to captures # !: don't create node (but run scripts) # @|$|*: run $cmd on delete, @cmd on create, *cmd on both AND on change # cmd also gets $SUBSYSTEM and $MDEV # If it's there, this will help debug mdev issues. # -.* root:root 666 @/usr/bin/mdevdebug.sh $MODALIAS=.* root:root 660 @/bin/busybox modprobe "$MODALIAS" # null may already exist; therefore ownership has to be changed with command null root:root 666 @chmod 666 $MDEV zero root:root 666 full root:root 666 random root:root 666 urandom root:root 666 hwrandom root:root 444 hw_random root:root 444 =hwrng grsec root:root 660 kmem root:root 640 mem root:root 640 port root:root 640 # Block devices and removable media sd[a-z][0-9] root:nobody 660 */usr/bin/blockhandler.sh mmcblk[0-9]p[0-9] root:nobody 660 */usr/bin/blockhandler.sh ram[0-9]* root:nobody 660 loop[0-9]* root:nobody 660 sd[!a-z].* root:nobody 660 */lib/mdev/sddev hd[!a-z].* root:nobody 660 */lib/mdev/hddev control root:root 000 =mapper/ md.* root:nobody 660 mtd.* root:nobody 660 ndb.* root:nobody 660 gnbd.* root:nobody 660 btibm.* root:nobody 660 dm-.* root:nobody 660 vd.* root:nobody 660 sg.* root:nobody 660 # block-related scsi.*/.* root:nobody 660 ! bdi.*/.* root:nobody 660 ! sch[0-9]* root:nobody 660 pg[0-9]* root:nobody 660 qft[0-9]* root:nobody 660 nqft[0-9]* root:nobody 660 zqft[0-9]* root:nobody 660 nzqft[0-9]* root:nobody 660 rawqft[0-9]* root:nobody 660 nrawqft[0-9]* root:nobody 660 rawctl root:nobody 660 =raw/ raw[0-9]* root:nobody 660 =raw/ aoe.* root:nobody 660 =etherd/ bsg/.* root:nobody 660 =bsg/ # Typical devices # console may already exist; therefore ownership has to be changed with command console root:root 600 @chmod 600 $MDEV ptmx root:root 666 pty.* root:root 660 tty root:root 666 tty[0-9]* root:root 660 vcsa*[0-9]* root:root 660 # serial ttyS[0-9]* root:root 660 ppox[0-9]* root:root 660 ircomm[0-9]* root:root 660 noz[0-9]* root:root 660 rfcomm[0-9]* root:root 660 mwave root:root 660 hvc.* root:root 660 hvsi.* root:root 660 ttyUSB[0-9]* root:root 660 ttyACM[0-9]* root:root 660 ttyLTM[0-9]* root:root 660 ttySHSF[0-9]* root:root 660 slamr root:root 660 slusb root:root 660 # alsa sound devices pcm.* root:root 660 =snd/ control.* root:root 660 =snd/ midi.* root:root 660 =snd/ seq root:root 660 =snd/ timer root:root 660 =snd/ # input stuff input/event[0-9]* root:root 640 */lib/mdev/inputdev input/js[0-9]* root:root 644 input/.* root:root 640 # mice root:root 640 =input/ # mouse[0-9] root:root 640 =input/ # ts[0-9] root:root 600 =input/ # v4l vttuner.* root:root 660 >v4l/ video.* root:root 660 >v4l/ vtx.* root:root 660 >v4l/ vbi.* root:root 660 >v4l/ winradio.* root:root 660 >v4l/ v4l.* root:root 660 >v4l/ # USB connected devices # usb.* root:root - @/usr/bin/usbhandler.sh bus/usb/.* root:root 665 */lib/mdev/usb # graphics fb[0-9]* root:root 660 # dri card[0-9]* root:video 660 =dri/ controlD[0-9]* root:root 660 =dri/ # dvb dvb.* root:root 660 */lib/mdev/dvbdev # audio snd/.* root:root 660 hpet root:root 660 adsp root:root 660 audio root:root 660 dsp root:root 660 mixer root:root 660 sequencer.* root:root 660 # network -net/.* root:root 600 @nameif tun root:root 666 =net/ tun[0-9]* root:root 600 =net/ tap[0-9]* root:root 600 =net/ rfkill root:rfkill 64 # misc rtc root:root 664 rtc[0-9]* root:root 664 @ln -sf $MDEV rtc hiddev[0-9]* root:root 660 =usb/