chiark / gitweb /
dd329712ddb950985cd4642749e7dda4f33ef8c7
[elogind.git] / etc / udev / gentoo / 50-udev.rules
1 # /etc/udev/rules/50-udev.rules:  device naming rules for udev
2 #
3 # Gentoo specific rules
4 #
5 # There are a number of modifiers that are allowed to be used in some of the
6 # fields.  See the udev man page for a full description of them.
7 #
8 # Try not to modify this file, if you wish to change things, create a new rule
9 # file that can be run before this one.
10 #
11
12 # Net devices can have arbitrary names, even
13 # ones set by the user. Not try to match normal
14 # rules on net devices (Bug #166652)
15 SUBSYSTEM=="net", GOTO="gentoo_device_rules_end"
16
17 # console
18 KERNEL=="pty[pqrstuvwxyzabcdef][0123456789abcdef]", NAME="%k", GROUP="tty",     OPTIONS="last_rule"
19 KERNEL=="tty[pqrstuvwxyzabcdef][0123456789abcdef]", NAME="%k", GROUP="tty",     OPTIONS="last_rule"
20 KERNEL=="vcs*",                 NAME="%k", GROUP="tty",                 OPTIONS="last_rule"
21 KERNEL=="vcsa*",                NAME="%k", GROUP="tty",                 OPTIONS="last_rule"
22 KERNEL=="tty",                  NAME="%k", GROUP="tty", MODE="0666",    OPTIONS="last_rule"
23 KERNEL=="tty[0-9]",             NAME="%k", GROUP="tty",                 OPTIONS="last_rule"
24 KERNEL=="tty[0-9][0-9]",        NAME="%k", GROUP="tty",                 OPTIONS="last_rule"
25 KERNEL=="console",              NAME="%k", GROUP="tty", MODE="0600"
26 KERNEL=="ptmx",                 NAME="%k", GROUP="tty", MODE="0666"
27
28 # tty devices
29 KERNEL=="ttyS[0-9]*",   NAME="%k", SYMLINK="tts/%n", GROUP="uucp", MODE="0660"
30 KERNEL=="ttyUSB[0-9]*", NAME="%k", SYMLINK="tts/USB%n", GROUP="uucp", MODE="0660"
31 KERNEL=="ippp0",        NAME="%k", GROUP="uucp", MODE="0660"
32 KERNEL=="isdn*"         NAME="%k", GROUP="uucp", MODE="0660"
33 KERNEL=="dcbri*",       NAME="%k", GROUP="uucp", MODE="0660"
34 KERNEL=="ircomm*",      NAME="%k", GROUP="uucp", MODE="0660"
35
36 # all block devices
37 SUBSYSTEM=="block", GROUP="disk"
38
39 # cdrom symlinks and other good cdrom naming
40 KERNEL=="sr[0-9]*|hd[a-z]|pcd[0-9]*", ACTION=="add", IMPORT{program}="cdrom_id --export $tempnode"
41 ENV{ID_CDROM}=="?*", GROUP="cdrom"
42 SUBSYSTEM=="block", KERNEL=="sr[0-9]*", SYMLINK+="scd%n"
43
44 # assign cdrom-permission also to associated generic device (for cd-burning ...)
45 KERNEL=="sg[0-9]*", ACTION=="add", ATTRS{type}=="4|5", GROUP="cdrom"
46
47 # disk devices
48 KERNEL=="sd*",          NAME="%k", GROUP="disk"
49 KERNEL=="dasd*",        NAME="%k", GROUP="disk"
50 KERNEL=="ataraid*",     NAME="%k", GROUP="disk"
51
52 # compaq smart array
53 KERNEL=="cciss*",       NAME="%k"
54 KERNEL=="ida*",         NAME="%k"
55
56 # mylex
57 KERNEL=="rd*",          NAME="%k"
58
59 # dri devices
60 KERNEL=="card*",        NAME="dri/card%n", GROUP="video"
61 KERNEL=="nvidia*",      NAME="%k", GROUP="video"
62 KERNEL=="3dfx*",        NAME="%k", GROUP="video"
63
64 # alsa devices
65 SUBSYSTEM=="sound", GROUP="audio"
66 KERNEL=="controlC[0-9]*",       NAME="snd/%k"
67 KERNEL=="hw[CD0-9]*",           NAME="snd/%k"
68 KERNEL=="pcm[CD0-9cp]*",        NAME="snd/%k"
69 KERNEL=="midiC[D0-9]*",         NAME="snd/%k"
70 KERNEL=="timer",                NAME="snd/%k"
71 KERNEL=="seq",                  NAME="snd/%k"
72
73 # capi devices
74 KERNEL=="capi",         NAME="capi20", SYMLINK+="isdn/capi20", GROUP="uucp", MODE="0660"
75 KERNEL=="capi*",        NAME="capi/%n", GROUP="uucp", MODE="0660"
76
77 # cpu devices
78 KERNEL=="cpu[0-9]*",    NAME="cpu/%n/cpuid"
79 KERNEL=="msr[0-9]*",    NAME="cpu/%n/msr"
80 KERNEL=="microcode",    NAME="cpu/microcode"
81
82 # fb devices
83 KERNEL=="fb[0-9]*",     NAME="fb/%n", SYMLINK+="%k", GROUP="video"
84
85 # floppy devices
86 KERNEL=="fd[0-9]*",     NAME="floppy/%k", SYMLINK+="%k", GROUP="floppy"
87 KERNEL=="fd[0-9]*", ACTION=="add", ATTRS{cmos}=="*", RUN+="create_floppy_devices -c -t $attr{cmos} -m %M -M 0660 -G floppy $root/floppy/%k"
88 KERNEL=="fd[0-9]*", ACTION=="remove", RUN+="/bin/sh -c 'rm -f $root/floppy/%k?*'"
89
90 # i2c devices
91 KERNEL=="i2c-[0-9]*",   NAME="i2c/%n", SYMLINK+="%k"
92
93 # input devices
94 KERNEL=="mice",         NAME="input/%k", MODE="0644"
95 KERNEL=="mouse*",       NAME="input/%k", MODE="0644"
96 KERNEL=="event*",       NAME="input/%k", MODE="0600"
97 KERNEL=="js*",          NAME="input/%k", MODE="0664"
98 KERNEL=="ts*",          NAME="input/%k", MODE="0600"
99
100 # loop devices
101 KERNEL=="loop[0-9]*",   NAME="loop/%n", SYMLINK+="%k", GROUP="disk"
102
103 # md block devices
104 KERNEL=="md[0-9]*",     NAME="md/%n", SYMLINK+="%k", GROUP="disk"
105
106 # aoe char devices,
107 SUBSYSTEM=="aoe", KERNEL=="discover",   NAME="etherd/%k", GROUP="disk", MODE="0220"
108 SUBSYSTEM=="aoe", KERNEL=="err",        NAME="etherd/%k", GROUP="disk", MODE="0440"
109 SUBSYSTEM=="aoe", KERNEL=="interfaces", NAME="etherd/%k", GROUP="disk", MODE="0220"
110
111 # misc devices
112 KERNEL=="agpgart",      NAME="misc/%k", SYMLINK+="%k"
113 KERNEL=="psaux",        NAME="misc/%k", SYMLINK+="%k"
114 KERNEL=="rtc",          NAME="misc/%k", SYMLINK+="%k", MODE="0664"
115 KERNEL=="uinput",       NAME="misc/%k", SYMLINK+="%k"
116 KERNEL=="inotify",      NAME="misc/%k", SYMLINK+="%k", MODE="0666"
117
118 # netlink devices
119 KERNEL=="route",        NAME="netlink/%k"
120 KERNEL=="skip",         NAME="netlink/%k"
121 KERNEL=="usersock",     NAME="netlink/%k"
122 KERNEL=="fwmonitor",    NAME="netlink/%k"
123 KERNEL=="tcpdiag",      NAME="netlink/%k"
124 KERNEL=="nflog",        NAME="netlink/%k"
125 KERNEL=="xfrm",         NAME="netlink/%k"
126 KERNEL=="arpd",         NAME="netlink/%k"
127 KERNEL=="route6",       NAME="netlink/%k"
128 KERNEL=="ip6_fw",       NAME="netlink/%k"
129 KERNEL=="dnrtmsg",      NAME="netlink/%k"
130 KERNEL=="tap*",         NAME="netlink/%k"
131
132 # network devices
133 KERNEL=="tun",          NAME="net/%k",  MODE="0660", OPTIONS+="ignore_remove"
134 KERNEL=="ppp",          MODE="0600", OPTIONS+="ignore_remove"
135
136 # ramdisk devices
137 KERNEL=="ram[0-9]*",    NAME="rd/%n", SYMLINK+="%k"
138
139 # IEEE1394 (firewire) devices (must be before raw devices below)
140 KERNEL=="raw1394",      NAME="%k",              GROUP="video"
141 KERNEL=="dv1394*",      NAME="dv1394/%n",       GROUP="video"
142 KERNEL=="video1394*",   NAME="video1394/%n",    GROUP="video"
143
144 # raw devices
145 SUBSYSTEM=="raw",       KERNEL=="raw[0-9]*",    NAME="raw/%k", GROUP="disk"
146 KERNEL=="ram*",         NAME="%k", GROUP="disk"
147
148 # sound devices
149 KERNEL=="adsp",                 NAME="sound/%k", SYMLINK+="%k", GROUP="audio"
150 KERNEL=="adsp[0-9]*",           NAME="sound/%k", SYMLINK+="%k", GROUP="audio"
151 KERNEL=="audio",                NAME="sound/%k", SYMLINK+="%k", GROUP="audio"
152 KERNEL=="audio[0-9]*",          NAME="sound/%k", SYMLINK+="%k", GROUP="audio"
153 KERNEL=="dsp",                  NAME="sound/%k", SYMLINK+="%k", GROUP="audio"
154 KERNEL=="dsp[0-9]*",            NAME="sound/%k", SYMLINK+="%k", GROUP="audio"
155 KERNEL=="mixer",                NAME="sound/%k", SYMLINK+="%k", GROUP="audio"
156 KERNEL=="mixer[0-9]*",          NAME="sound/%k", SYMLINK+="%k", GROUP="audio"
157 KERNEL=="sequencer",            NAME="sound/%k", SYMLINK+="%k", GROUP="audio"
158 KERNEL=="sequencer[0-9]*",      NAME="sound/%k", SYMLINK+="%k", GROUP="audio"
159
160 # memory devices
161 KERNEL=="random",       NAME="%k", MODE="0666"
162 KERNEL=="urandom",      NAME="%k", MODE="0444"
163 KERNEL=="mem",          NAME="%k", MODE="0640"
164 KERNEL=="kmem",         NAME="%k", MODE="0640"
165 KERNEL=="port",         NAME="%k", MODE="0640"
166 KERNEL=="full",         NAME="%k", MODE="0666"
167 KERNEL=="null",         NAME="%k", MODE="0666"
168 KERNEL=="zero",         NAME="%k", MODE="0666"
169
170 # usb devices
171 KERNEL=="hiddev*",              NAME="usb/%k"
172 KERNEL=="auer*",                NAME="usb/%k"
173 KERNEL=="legousbtower*",        NAME="usb/%k", GROUP="usb"
174 KERNEL=="dabusb*",              NAME="usb/%k"
175 KERNEL=="lp[0-9]*",     SUBSYSTEM=="usb",       NAME="usb/%k", GROUP="lp"
176
177 # v4l devices
178 KERNEL=="video[0-9]*",  NAME="v4l/video%n", SYMLINK+="video%n", GROUP="video"
179 KERNEL=="radio[0-9]*",  NAME="v4l/radio%n", SYMLINK+="radio%n", GROUP="video"
180 KERNEL=="vbi[0-9]*",    NAME="v4l/vbi%n", SYMLINK+="vbi%n", GROUP="video"
181 KERNEL=="vtx[0-9]*",    NAME="v4l/vtx%n", GROUP="video"
182
183 # dvb devices
184 SUBSYSTEM=="dvb", PROGRAM="/bin/sh -c 'K=%k; K=$${K#dvb}; printf dvb/adapter%%i/%%s $${K%%%%.*} $${K#*.}'", NAME="%c", GROUP="video"
185
186 # Asterisk Zaptel devices
187 KERNEL=="zapctl",       NAME="zap/ctl"
188 KERNEL=="zaptimer",     NAME="zap/timer"
189 KERNEL=="zapchannel",   NAME="zap/channel"
190 KERNEL=="zappseudo",    NAME="zap/pseudo"
191 KERNEL=="zap[0-9]*",    NAME="zap/%n"
192
193 # pilot/palm devices
194 KERNEL=="pilot",        NAME="%k", GROUP="uucp"
195
196 # jaz devices
197 KERNEL=="jaz*",         NAME="%k", GROUP="disk"
198
199 # zip devices
200 KERNEL=="pocketzip*",   NAME="%k", GROUP="disk"
201 KERNEL=="zip*",         NAME="%k", GROUP="disk"
202
203 # ls120 devices
204 KERNEL=="ls120",        NAME="%k", GROUP="disk"
205
206 # lp devices
207 KERNEL=="lp*",          NAME="%k", GROUP="lp"
208 KERNEL=="irlpt",        NAME="%k", GROUP="lp"
209 KERNEL=="usblp",        NAME="%k", GROUP="lp"
210 KERNEL=="lp*",          NAME="%k", GROUP="lp"
211 KERNEL=="parport*",     NAME="%k", GROUP="lp"
212
213 # tape devices
214 KERNEL=="ht*",          NAME="%k", GROUP="tape"
215 KERNEL=="nht*",         NAME="%k", GROUP="tape"
216 KERNEL=="pt*",          NAME="%k", GROUP="tape"
217 KERNEL=="npt*",         NAME="%k", GROUP="tape"
218 KERNEL=="st*",          NAME="%k", GROUP="tape"
219 KERNEL=="nst*",         NAME="%k", GROUP="tape"
220 KERNEL=="osst*",        NAME="%k", GROUP="tape"
221 KERNEL=="nosst*",       NAME="%k", GROUP="tape"
222
223 # diskonkey devices
224 KERNEL=="diskonkey*",   NAME="%k", GROUP="disk"
225
226 # rem_ide devices
227 KERNEL=="microdrive*",  NAME="%k", GROUP="disk"
228
229 # kbd devices
230 KERNEL=="kbd",          NAME="%k", MODE="0664"
231
232 # Sony Vaio Jogdial sonypi device
233 KERNEL=="sonypi",       NAME="%k", MODE="0666"
234
235 # packet devices
236 KERNEL=="pktcdvd",              NAME="pktcdvd/control", GROUP="cdrw", MODE="0660"
237 KERNEL=="pktcdvd[0-9]*",        NAME="pktcdvd/pktcdvd%n", GROUP="cdrw", MODE="0660"
238
239 # infiniband devices
240 KERNEL=="umad*",        NAME="infiniband/%k"
241 KERNEL=="issm*",        NAME="infiniband/%k"
242
243
244 # usbfs-like device nodes
245 # the way to go up to kernel 2.6.21 (and above if setting USB_DEVICE_CLASS=y)
246 SUBSYSTEM=="usb_device", PROGRAM="/bin/sh -c 'K=%k; K=$${K#usbdev}; printf bus/usb/%%03i/%%03i $${K%%%%.*} $${K#*.}'", NAME="%c", GROUP="usb", MODE="0664"
247 # starting from kernel 2.6.22 use this rule
248 SUBSYSTEM=="usb", ACTION=="add", ENV{DEVTYPE}=="usb_device", \
249         NAME="bus/usb/$env{BUSNUM}/$env{DEVNUM}", GROUP="usb", MODE="0664" 
250
251 # Timeouts for scsi devices
252 # Setting timeout for tape-devices (type 1) to 900 seconds
253 # and 60 seconds for device types 0, 7 and 14
254 # if you need timeouts for other devices add a similar rule
255 # with correct type-value, or open a bug on bugs.gentoo.org.
256 SUBSYSTEM=="scsi", KERNEL=="[0-9]*:[0-9]*", ACTION=="add", ATTR{type}=="0|7|14", ATTR{timeout}="60"
257 SUBSYSTEM=="scsi", KERNEL=="[0-9]*:[0-9]*", ACTION=="add", ATTR{type}=="1", ATTR{timeout}="900"
258
259
260 # Load firmware
261 SUBSYSTEM=="firmware", ACTION=="add", RUN+="firmware.sh"
262
263 LABEL="gentoo_device_rules_end"