blob: 9ac333608837154d1fd3cdfc38f719e2ebc1fcce [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:
10# devicename_regex user:group mode [>|=path] [@|$|*command args...]
11#
12# =: move, >: move and create a symlink
13# @|$|*: run $cmd on delete, @cmd on create, *cmd on both
14
15# null may already exist; therefore ownership has to be changed with command
16null root:root 666 @chmod 666 $MDEV
17zero root:root 666
18full root:root 666
Denys Vlasenkobf40f562009-11-07 17:54:44 +010019random root:root 444
Denys Vlasenko6e8e6662009-11-07 04:00:03 +010020urandom root:root 444
Denys Vlasenkobf40f562009-11-07 17:54:44 +010021hwrandom root:root 444
Denys Vlasenko6e8e6662009-11-07 04:00:03 +010022grsec root:root 660
23
24kmem root:root 640
25mem root:root 640
26port root:root 640
27# console may already exist; therefore ownership has to be changed with command
28console root:tty 600 @chmod 600 $MDEV
29ptmx root:tty 666
30pty.* root:tty 660
31
32# Typical devices
33
34tty root:tty 666
35tty[0-9]* root:tty 660
36vcsa*[0-9]* root:tty 660
37ttyS[0-9]* root:uucp 660
38
39# block devices
40ram([0-9]*) root:disk 660 >rd/%1
41loop([0-9]+) root:disk 660 >loop/%1
42sd[a-z].* root:disk 660 */lib/mdev/usbdisk_link
43hd[a-z][0-9]* root:disk 660 */lib/mdev/ide_links
44md[0-9]* root:disk 660
45sr[0-9]* root:cdrom 660 @ln -sf $MDEV cdrom
46fd[0-9]* root:floppy 660
47
48# net devices
49tun[0-9]* root:root 600 =net/
50tap[0-9]* root:root 600 =net/
51
52# alsa sound devices and audio stuff
53pcm.* root:audio 660 =snd/
54control.* root:audio 660 =snd/
55midi.* root:audio 660 =snd/
56seq root:audio 660 =snd/
57timer root:audio 660 =snd/
58
59adsp root:audio 660 >sound/
60audio root:audio 660 >sound/
61dsp root:audio 660 >sound/
62mixer root:audio 660 >sound/
63sequencer.* root:audio 660 >sound/
64
65# Less typical devices
66
67# raid controllers
68cciss!(.*) root:disk 660 =cciss/%1
69ida!(.*) root:disk 660 =ida/%1
70rd!(.*) root:disk 660 =rd/%1
71
72ttyLTM[0-9] root:dialout 660 @ln -sf $MDEV modem
73ttySHSF[0-9] root:dialout 660 @ln -sf $MDEV modem
74slamr root:dialout 660 @ln -sf $MDEV slamr0
75slusb root:dialout 660 @ln -sf $MDEV slusb0
Denys Vlasenkobf40f562009-11-07 17:54:44 +010076
Denys Vlasenko6e8e6662009-11-07 04:00:03 +010077fuse root:root 666
78
79# dri device
80card[0-9] root:video 660 =dri/
81
82# misc stuff
83agpgart root:root 660 >misc/
84psaux root:root 660 >misc/
85rtc root:root 664 >misc/
86
87# input stuff
88event[0-9]+ root:root 640 =input/
89mice root:root 640 =input/
90mouse[0-9] root:root 640 =input/
91ts[0-9] root:root 600 =input/
92
93# v4l stuff
94vbi[0-9] root:video 660 >v4l/
95video[0-9] root:video 660 >v4l/
96
97# dvb stuff
98dvb.* root:video 660 */lib/mdev/dvbdev
99
100# load drivers for usb devices
101usbdev[0-9].[0-9] root:root 660 */lib/mdev/usbdev
102usbdev[0-9].[0-9]_.* root:root 660
103
104# zaptel devices
105zap(.*) root:dialout 660 =zap/%1
106dahdi!(.*) root:dialout 660 =dahdi/%1