blob: 8b9463603e30680afeb1677a47f0e70ab8eae869 [file] [log] [blame]
Denys Vlasenko6e8e6662009-11-07 04:00:03 +01001#
2# This is a sample mdev.conf
3#
4
5# Provide user, group, and mode information for devices. If a regex matches
6# the device name provided by sysfs, use the appropriate user:group and mode
7# instead of the default 0:0 660.
8#
9# Syntax:
Denys Vlasenko44f8d012009-11-07 18:21:03 +010010# devicename_regex user:group mode [>|=path] [@|$|*cmd args...]
Denys Vlasenko6e8e6662009-11-07 04:00:03 +010011#
12# =: move, >: move and create a symlink
13# @|$|*: run $cmd on delete, @cmd on create, *cmd on both
14
Denys Vlasenko44f8d012009-11-07 18:21:03 +010015# support module loading on hotplug
16$MODALIAS=.* root:root 660 @modprobe "$MODALIAS"
17
Denys Vlasenko6e8e6662009-11-07 04:00:03 +010018# null may already exist; therefore ownership has to be changed with command
19null root:root 666 @chmod 666 $MDEV
20zero root:root 666
21full root:root 666
Denys Vlasenkobf40f562009-11-07 17:54:44 +010022random root:root 444
Denys Vlasenko6e8e6662009-11-07 04:00:03 +010023urandom root:root 444
Denys Vlasenkobf40f562009-11-07 17:54:44 +010024hwrandom root:root 444
Denys Vlasenko6e8e6662009-11-07 04:00:03 +010025grsec root:root 660
26
27kmem root:root 640
28mem root:root 640
29port root:root 640
30# console may already exist; therefore ownership has to be changed with command
31console root:tty 600 @chmod 600 $MDEV
32ptmx root:tty 666
33pty.* root:tty 660
34
35# Typical devices
36
37tty root:tty 666
38tty[0-9]* root:tty 660
39vcsa*[0-9]* root:tty 660
40ttyS[0-9]* root:uucp 660
41
42# block devices
43ram([0-9]*) root:disk 660 >rd/%1
44loop([0-9]+) root:disk 660 >loop/%1
45sd[a-z].* root:disk 660 */lib/mdev/usbdisk_link
46hd[a-z][0-9]* root:disk 660 */lib/mdev/ide_links
47md[0-9]* root:disk 660
48sr[0-9]* root:cdrom 660 @ln -sf $MDEV cdrom
49fd[0-9]* root:floppy 660
50
51# net devices
52tun[0-9]* root:root 600 =net/
53tap[0-9]* root:root 600 =net/
54
55# alsa sound devices and audio stuff
56pcm.* root:audio 660 =snd/
57control.* root:audio 660 =snd/
58midi.* root:audio 660 =snd/
59seq root:audio 660 =snd/
60timer root:audio 660 =snd/
61
62adsp root:audio 660 >sound/
63audio root:audio 660 >sound/
64dsp root:audio 660 >sound/
65mixer root:audio 660 >sound/
66sequencer.* root:audio 660 >sound/
67
68# Less typical devices
69
70# raid controllers
71cciss!(.*) root:disk 660 =cciss/%1
72ida!(.*) root:disk 660 =ida/%1
73rd!(.*) root:disk 660 =rd/%1
74
75ttyLTM[0-9] root:dialout 660 @ln -sf $MDEV modem
76ttySHSF[0-9] root:dialout 660 @ln -sf $MDEV modem
77slamr root:dialout 660 @ln -sf $MDEV slamr0
78slusb root:dialout 660 @ln -sf $MDEV slusb0
Denys Vlasenkobf40f562009-11-07 17:54:44 +010079
Denys Vlasenko6e8e6662009-11-07 04:00:03 +010080fuse root:root 666
81
82# dri device
83card[0-9] root:video 660 =dri/
84
85# misc stuff
86agpgart root:root 660 >misc/
87psaux root:root 660 >misc/
88rtc root:root 664 >misc/
89
90# input stuff
91event[0-9]+ root:root 640 =input/
92mice root:root 640 =input/
93mouse[0-9] root:root 640 =input/
94ts[0-9] root:root 600 =input/
95
96# v4l stuff
97vbi[0-9] root:video 660 >v4l/
98video[0-9] root:video 660 >v4l/
99
100# dvb stuff
101dvb.* root:video 660 */lib/mdev/dvbdev
102
103# load drivers for usb devices
104usbdev[0-9].[0-9] root:root 660 */lib/mdev/usbdev
105usbdev[0-9].[0-9]_.* root:root 660
106
107# zaptel devices
108zap(.*) root:dialout 660 =zap/%1
109dahdi!(.*) root:dialout 660 =dahdi/%1