chiark / gitweb /
89a3f02bac0a23962316c6da3667dd9eeceb5cd1
[elogind.git] / etc / udev / redhat / 50-udev.rules
1 # There are a number of modifiers that are allowed to be used in some of the
2 # fields.  See the udev man page for a full description of them.
3 #
4 # default is OWNER="root" GROUP="root", MODE="0600"
5 #
6
7 KERNEL=="*", OWNER="root" GROUP="root", MODE="0600"
8
9 # all block devices
10 SUBSYSTEM=="block",             GROUP="disk", MODE="0640"
11 KERNEL=="root",                 GROUP="disk", MODE="0640"
12
13 # console devices
14 KERNEL=="tty",                  NAME="%k", GROUP="tty", MODE="0666", OPTIONS="last_rule"
15 KERNEL=="console",              NAME="%k", MODE="0600", OPTIONS="last_rule"
16 KERNEL=="tty[0-9]*",            NAME="%k", GROUP="tty", MODE="0660", OPTIONS="last_rule"
17 KERNEL=="vc/[0-9]*",            NAME="%k", GROUP="tty", MODE="0660", OPTIONS="last_rule"
18
19 # pty devices
20 #  Set this to 0660 if you only want users belonging to tty group
21 #  to be able to allocate PTYs
22 KERNEL=="ptmx",                 NAME="%k", GROUP="tty", MODE="666", OPTIONS="last_rule"
23 KERNEL=="pty[pqrstuvwxyzabcdef][0123456789abcdef]", NAME="%k", GROUP="tty", MODE="660", OPTIONS="last_rule"
24 KERNEL=="tty[pqrstuvwxyzabcdef][0123456789abcdef]", NAME="%k", GROUP="tty", MODE="660", OPTIONS="last_rule"
25 KERNEL=="pty/m*",               NAME="%k", GROUP="tty", MODE="0660", OPTIONS="last_rule"
26
27 # serial+dialup devices
28 KERNEL=="ippp*",                NAME="%k", MODE="0660"
29 KERNEL=="isdn*",                NAME="%k", MODE="0660"
30 KERNEL=="isdnctrl*",            NAME="%k", MODE="0660"
31 KERNEL=="capi*",                NAME="%k", MODE="0660"
32 KERNEL=="dcbri*",               NAME="%k", MODE="0660"
33 KERNEL=="ircomm*",              NAME="%k", GROUP="uucp", MODE="0660"
34 KERNEL=="tts/[0-9]*",           NAME="%k", GROUP="uucp", MODE="0660"
35 KERNEL=="tts/USB[0-9]*",        NAME="%k", GROUP="uucp", MODE="0660"
36 KERNEL=="tty[A-Z]*",            NAME="%k", GROUP="uucp", MODE="0660"
37 KERNEL=="pppox*",               NAME="%k", GROUP="uucp", MODE="0660"
38 KERNEL=="ircomm*",              NAME="%k", GROUP="uucp", MODE="0660"
39 KERNEL=="modems/mwave*",        NAME="%k", GROUP="uucp", MODE="0660"
40 KERNEL=="hvc*",                 NAME="%k", GROUP="uucp", MODE="0660"
41 KERNEL=="hvsi*",                NAME="%k", GROUP="uucp", MODE="0660"
42 KERNEL=="iseries/vtty*",        NAME="%k", GROUP="uucp", MODE="0660"
43 KERNEL=="ttyUSB*", SYSFS{product}=="Palm Handheld*", SYMLINK+="pilot"
44 KERNEL=="ttyUSB*", SYSFS{product}=="palmOne Handheld*", SYMLINK+="pilot"
45
46 # vc devices
47 KERNEL=="vcs",                  NAME="%k", OWNER="vcsa", GROUP="tty", OPTIONS="last_rule"
48 KERNEL=="vcs[0-9]*",            NAME="%k", OWNER="vcsa", GROUP="tty", OPTIONS="last_rule"
49 KERNEL=="vcsa",                 NAME="%k", OWNER="vcsa", GROUP="tty", OPTIONS="last_rule"
50 KERNEL=="vcsa[0-9]*",           NAME="%k", OWNER="vcsa", GROUP="tty", OPTIONS="last_rule"
51 KERNEL=="vcc/*",                NAME="%k", OWNER="vcsa", GROUP="tty", OPTIONS="last_rule"
52
53 # memory devices
54 KERNEL=="random",               MODE="0666", OPTIONS="last_rule"
55 KERNEL=="urandom",              MODE="0444", OPTIONS="last_rule"
56 KERNEL=="mem",                  GROUP="kmem", MODE="0640", OPTIONS="last_rule"
57 KERNEL=="kmem",                 GROUP="kmem", MODE="0640", OPTIONS="last_rule"
58 KERNEL=="port",                 GROUP="kmem", MODE="0640", OPTIONS="last_rule"
59 KERNEL=="full",                 MODE="0666", OPTIONS="last_rule"
60 KERNEL=="null",                 MODE="0666", OPTIONS="last_rule"
61 KERNEL=="zero",                 MODE="0666", OPTIONS="last_rule"
62 # 183 = /dev/hwrng        Generic random number generator
63 KERNEL=="hw_random",            NAME="hwrng", SYMLINK+="%k"
64
65 # misc devices
66 KERNEL=="nvram",                MODE="0660"
67 KERNEL=="rtc",                  MODE="0644"
68
69 # floppy devices
70 KERNEL=="fd[01]*",              GROUP="floppy", MODE="0660"
71 # fix floppy devices
72 KERNEL=="nvram", ACTION=="add", RUN+="load_floppy_module.sh"
73 KERNEL=="fd[0-9]*", ACTION=="add", SYSFS{device/cmos}=="*", RUN+="create_floppy_devices -c -t $sysfs{device/cmos} -m %M /dev/%k"
74 KERNEL=="fd[0-9]*", ACTION=="remove", RUN+="/bin/sh -c 'rm -f /dev/%k*'"
75
76 # audio devices
77 KERNEL=="dsp*",                 MODE="0660"
78 KERNEL=="audio*",               MODE="0660"
79 KERNEL=="midi*",                MODE="0660"
80 KERNEL=="mixer*",               MODE="0660"
81 KERNEL=="sequencer*",           MODE="0660"
82 KERNEL=="sound/*",              MODE="0660"
83 KERNEL=="snd/*",                MODE="0660"
84 KERNEL=="beep",                 MODE="0660"
85 KERNEL=="admm*",                MODE="0660"
86 KERNEL=="adsp*",                MODE="0660"
87 KERNEL=="aload*",               MODE="0660"
88 KERNEL=="amidi*",               MODE="0660"
89 KERNEL=="dmfm*",                MODE="0660"
90 KERNEL=="dmmidi*",              MODE="0660"
91 KERNEL=="sndstat",              MODE="0660"
92
93 # pilot/palm devices
94 KERNEL=="pilot",                GROUP="uucp", MODE="0660"
95
96 # lp devices
97 KERNEL=="lp*",                  GROUP="lp", MODE="0660"
98 KERNEL=="parport*",             GROUP="lp", MODE="0660"
99 KERNEL=="irlpt*",               GROUP="lp", MODE="0660"
100 KERNEL=="usblp*",               GROUP="lp", MODE="0660"
101 KERNEL=="usb/lp*",              GROUP="lp", MODE="0660"
102
103 # tape devices
104 KERNEL=="ht*",                  GROUP="disk", MODE="0660"
105 KERNEL=="nht*",                 GROUP="disk", MODE="0660"
106 KERNEL=="pt[0-9]*",             GROUP="disk", MODE="0660"
107 KERNEL=="npt*",                 GROUP="disk", MODE="0660"
108 KERNEL=="st*",                  GROUP="disk", MODE="0660"
109 KERNEL=="nst*",                 GROUP="disk", MODE="0660"
110 KERNEL=="osst*",                GROUP="disk", MODE="0660"
111 KERNEL=="nosst*",               GROUP="disk", MODE="0660"
112
113 # diskonkey devices
114 KERNEL=="diskonkey*",           GROUP="disk", MODE="0640"
115
116 # rem_ide devices
117 KERNEL=="microdrive*",          GROUP="disk", MODE="0640"
118
119 # kbd devices
120 KERNEL=="kbd",                  MODE="0644"
121
122 # joystick devices
123 KERNEL=="js[0-9]*",             MODE="0644"
124 KERNEL=="djs[0-9]*",            MODE="0644"
125
126 # v4l devices
127 KERNEL=="video*",               MODE="0660"
128 KERNEL=="radio*",               MODE="0660"
129 KERNEL=="winradio*",            MODE="0660"
130 KERNEL=="vtx*",                 MODE="0660"
131 KERNEL=="vbi*",                 MODE="0660"
132 KERNEL=="video/*",              MODE="0660"
133 KERNEL=="vttuner",              MODE="0660"
134 KERNEL=="v4l/*",                MODE="0660"
135
136 # input devices
137 KERNEL=="input/*",              MODE="0660"
138
139 # gpm devices
140 KERNEL=="gpmctl",               MODE="0700"
141
142 # dri devices
143 KERNEL=="nvidia*",              MODE="0660"
144 KERNEL=="3dfx*",                MODE="0660"
145 KERNEL=="card[0-9]*",           NAME="dri/%k", MODE="0666"
146
147 # usb devices
148 KERNEL=="usb/dabusb*",          MODE="0660"
149 KERNEL=="usb/mdc800*",          MODE="0660"
150 KERNEL=="usb/rio500",           MODE="0660"
151
152 # s390 devices
153 KERNEL=="z90crypt",             MODE="0666"
154
155 # DVB
156 KERNEL=="dvb",                  MODE="0660"
157 SUBSYSTEM=="dvb", PROGRAM="/bin/sh -c 'K=%k; K=$${K#dvb}; printf dvb/adapter%%i/%%s $${K%%%%.*} $${K#*.}'", \
158         NAME="%c", MODE="0660"
159
160 # create a symlink named after the device map name
161 # note devmap_name comes with extras/multipath
162 #KERNEL=="dm-[0-9]*", PROGRAM="/sbin/devmap_name %M %m", NAME="%k", SYMLINK+="%c"
163
164
165 # alsa devices
166 KERNEL=="controlC[0-9]*",       NAME="snd/%k"
167 KERNEL=="hw[CD0-9]*",           NAME="snd/%k"
168 KERNEL=="pcm[CD0-9cp]*",        NAME="snd/%k"
169 KERNEL=="midi[CD0-9]*",         NAME="snd/%k"
170 KERNEL=="timer",                NAME="snd/%k"
171 KERNEL=="seq",                  NAME="snd/%k"
172
173 # input devices
174 KERNEL=="mice",                 NAME="input/%k"
175 KERNEL=="mouse*",               NAME="input/%k"
176 KERNEL=="event*",               NAME="input/%k"
177 KERNEL=="js*",                  NAME="input/%k", SYMLINK+="%k"
178 KERNEL=="ts*",                  NAME="input/%k"
179
180 # IEEE1394 (firewire) devices (must be before raw devices below)
181 KERNEL=="raw1394",              NAME="%k"
182 KERNEL=="dv1394*",              NAME="dv1394/%n"
183 KERNEL=="video1394*",           NAME="video1394/%n"
184
185 KERNEL=="raw[0-9]*",            NAME="raw/%k"
186
187 KERNEL=="lp[0-9]*",             SYMLINK+="par%n"
188 BUS=="usb", KERNEL=="lp[0-9]*", NAME="usb/%k"
189
190 KERNEL=="microcode",            NAME="cpu/%k"
191 KERNEL=="msr[0-9]*",            NAME="cpu/%n/msr"
192 KERNEL=="cpu[0-9]*",            NAME="cpu/%n/cpuid"
193
194 KERNEL=="ram1",                 SYMLINK+="ram"
195 KERNEL=="video0",               SYMLINK+="video"
196 KERNEL=="radio0",               SYMLINK+="radio"
197 KERNEL=="audio0",               SYMLINK+="audio"
198 KERNEL=="dsp0",                 SYMLINK+="dsp"
199 KERNEL=="fb0",                  SYMLINK+="fb"
200 KERNEL=="qft0",                 SYMLINK+="ftape"
201 KERNEL=="isdnctrl0",            SYMLINK+="isdnctrl"
202 KERNEL=="mixer0",               SYMLINK+="mixer"
203 KERNEL=="ram0",                 SYMLINK+="ramdisk"
204 KERNEL=="sbpcd0",               SYMLINK+="sbpcd"
205 KERNEL=="radio0",               SYMLINK+="radio"
206 KERNEL=="tty0",                 SYMLINK+="systty"
207 KERNEL=="vbi0",                 SYMLINK+="vbi"
208 KERNEL=="null",                 SYMLINK+="XOR"
209
210 KERNEL=="tun",                  NAME="net/%k"
211
212 KERNEL=="device-mapper",        NAME="mapper/control"
213
214 # old compat symlinks with enumeration
215 KERNEL=="sr[0-9]*",             SYMLINK+="cdrom cdrom-%k"
216 KERNEL=="scd[0-9]*",            SYMLINK+="cdrom cdrom-%k"
217 KERNEL=="pcd[0-9]*",            SYMLINK+="cdrom cdrom-%k"
218 KERNEL=="fd[0-9]*",             SYMLINK+="floppy-%k"
219 KERNEL=="nst[0-9]", BUS=="scsi",        SYMLINK+="tape-%k", MODE="0660"
220 KERNEL=="nosst[0-9]", BUS=="scsi",      SYMLINK+="tape-%k", MODE="0660"
221
222 KERNEL=="umad*",                NAME="infiniband/%k"
223 KERNEL=="issm*",                NAME="infiniband/%k"
224
225 # Section for zaptel device
226 KERNEL=="zapctl",               NAME="zap/ctl"
227 KERNEL=="zaptimer",             NAME="zap/timer"
228 KERNEL=="zapchannel",           NAME="zap/channel"
229 KERNEL=="zappseudo",            NAME="zap/pseudo"
230 KERNEL=="zap[0-9]*",            NAME="zap/%n"
231
232 KERNEL=="pktcdvd", NAME="%k/control"
233
234
235
236 KERNEL=="hd[a-z]", BUS=="ide", SYSFS{removable}=="1", \
237         SYSFS{device/media}=="floppy", \
238         SYMLINK+="floppy floppy-%k", OPTIONS+="ignore_remove, all_partitions"
239
240 KERNEL=="hd[a-z]", BUS=="ide", SYSFS{removable}=="1", SYSFS{device/media}=="cdrom", SYMLINK+="cdrom cdrom-%k"
241
242 KERNEL=="hd[a-z]", BUS=="ide", SYSFS{removable}=="1", PROGRAM=="check-cdrom.sh %k DVD", SYMLINK+="dvd dvd-%k"
243 KERNEL=="sr[0-9]*", BUS=="scsi", PROGRAM=="check-cdrom.sh %k DVD", SYMLINK+="dvd dvd-%k"
244
245 KERNEL=="hd[a-z]", BUS=="ide", SYSFS{removable}=="1", PROGRAM=="check-cdrom.sh %k CD-R", SYMLINK+="cdwriter cdwriter-%k cdrw cdrw-%k"
246 KERNEL=="sr[0-9]*", BUS=="scsi", PROGRAM=="check-cdrom.sh %k CD-R", SYMLINK+="cdwriter cdwriter-%k cdrw cdrw-%k"
247
248 KERNEL=="hd[a-z]", BUS=="ide", SYSFS{removable}=="1", PROGRAM="check-cdrom.sh %k DVD-R", SYMLINK+="dvdwriter dvdwriter-%k dvdrw dvdrw-%k"
249 KERNEL=="sr[0-9]*", BUS=="scsi", PROGRAM=="check-cdrom.sh %k DVD-R", SYMLINK+="dvdwriter dvdwriter-%k dvdrw dvdrw-%k"
250
251 # rename sr* to scd*
252 KERNEL=="sr[0-9]*", BUS=="scsi", NAME="scd%n"
253 KERNEL=="hd*[0-9]", BUS=="ide", SYSFS{../removable}=="1", \
254         OPTIONS+="ignore_remove"
255
256
257 #######################################
258 # Persistent block device stuff - begin
259 #######################################
260 # persistent disk links: /dev/disk/{by-id,by-uuid,by-label,by-path}
261 # scheme based on "Linux persistent device names", 2004, Hannes Reinecke <hare@suse.de>
262
263 ACTION!="add", GOTO="persistent_end"
264 SUBSYSTEM!="block", GOTO="persistent_end"
265
266 # skip rules for inappropriate block devices
267 KERNEL=="ram*|loop*|fd*|nbd*", GOTO="persistent_end"
268
269 # never access removable ide devices, the drivers are causing event loops on open()
270 BUS=="ide", DRIVER!="ide-cdrom", SYSFS{removable}=="1", GOTO="persistent_end"
271 BUS=="ide", KERNEL=="hd*[0-9]", SYSFS{../removable}=="1", GOTO="persistent_end"
272
273 # by-id (hardware serial number)
274 KERNEL=="hd*[!0-9]", IMPORT{program}="/sbin/ata_id --export $tempnode"
275 KERNEL=="hd*[!0-9]", ENV{ID_SERIAL}=="?*", SYMLINK+="disk/by-id/ata-$env{ID_MODEL}_$env{ID_SERIAL}"
276 KERNEL=="hd*[0-9]", IMPORT{parent}=="ID_*", SYMLINK+="disk/by-id/ata-$env{ID_MODEL}_$env{ID_SERIAL}-part%n"
277
278 KERNEL=="sd*[!0-9]|sr*", SYSFS{ieee1394_id}=="*", ENV{ID_SERIAL}="$sysfs{ieee1394_id}", ENV{ID_BUS}="ieee1394"
279 KERNEL=="sd*[!0-9]|sr*", ENV{ID_SERIAL}=="", IMPORT{program}="/sbin/usb_id -x"
280 KERNEL=="sd*[!0-9]|sr*", ENV{ID_SERIAL}=="", IMPORT{program}="/sbin/scsi_id -g -x -s %p -d $tempnode"
281 KERNEL=="sd*[!0-9]|sr*", ENV{ID_SERIAL}=="", IMPORT{program}="/sbin/scsi_id -g -x -a -s %p -d $tempnode"
282 KERNEL=="dasd*[!0-9]", IMPORT{program}="/sbin/dasd_id --export $tempnode"
283 KERNEL=="sd*[!0-9]|sr*|dasd*[!0-9]", ENV{ID_SERIAL}=="?*", SYMLINK+="disk/by-id/$env{ID_BUS}-$env{ID_SERIAL}"
284
285 # for partitions import parent information
286 KERNEL=="sd*[0-9]|dasd*[0-9]", IMPORT{parent}=="ID_*"
287 KERNEL=="sd*[0-9]|dasd*[0-9]", ENV{ID_SERIAL}=="?*", SYMLINK+="disk/by-id/$env{ID_BUS}-$env{ID_SERIAL}-part%n"
288
289 # by-path (shortest physical path)
290 KERNEL=="*[!0-9]|sr*", ENV{ID_TYPE}=="?*", IMPORT{program}="/sbin/path_id %p", SYMLINK+="disk/by-path/$env{ID_PATH}"
291 KERNEL=="sr*", GOTO="persistent_end"
292 KERNEL=="*[0-9]", IMPORT{parent}=="ID_*"
293 KERNEL=="*[0-9]", ENV{ID_PATH}=="?*", SYMLINK+="disk/by-path/$env{ID_PATH}-part%n"
294
295 # by-label/by-uuid (filesystem properties)
296 KERNEL=="*[!0-9]", SYSFS{removable}=="1", GOTO="persistent_end"
297 IMPORT{program}="/sbin/vol_id --export $tempnode"
298 ENV{ID_FS_UUID}=="?*", SYMLINK+="disk/by-uuid/$env{ID_FS_UUID}"
299 ENV{ID_FS_LABEL_SAFE}=="?*", SYMLINK+="disk/by-label/$env{ID_FS_LABEL_SAFE}"
300
301 # BIOS Enhanced Disk Device
302 KERNEL=="*[!0-9]", IMPORT{program}="/sbin/edd_id --export $tempnode"
303 KERNEL=="*[!0-9]", ENV{ID_EDD}=="?*", SYMLINK+="disk/by-id/edd-$env{ID_EDD}"
304 KERNEL=="*[0-9]", ENV{ID_EDD}=="?*", SYMLINK+="disk/by-id/edd-$env{ID_EDD}-part%n"
305
306 LABEL="persistent_end"
307
308 #####################################
309 # Persistent block device stuff - end
310 #####################################
311
312 ACTION=="add", SUBSYSTEM=="usb_device", \
313         PROGRAM="/bin/sh -c 'K=%k; K=$${K#usbdev}; printf bus/usb/%%03i/%%03i $${K%%%%.*} $${K#*.}'", \
314         NAME="%c", MODE="0644"
315
316 ACTION=="add", SUBSYSTEM=="?*", ENV{MODALIAS}=="?*", RUN+="/sbin/modprobe $env{MODALIAS}"
317
318 ACTION=="add", SUBSYSTEM=="pcmcia", ENV{MODALIAS}=="*", \
319         RUN+="/bin/sh -c 'echo 1 > /sys/$DEVPATH/allow_func_id_match'"
320
321 # sd:           0 TYPE_DISK, 7 TYPE_MOD, 14 TYPE_RBC
322 # sr:           4 TYPE_WORM, 5 TYPE_ROM
323 # st/osst:      1 TYPE_TAPE
324 # sg:           8 changer, [36] scanner
325 ACTION=="add", SUBSYSTEM="scsi" , SYSFS{type}=="0|7|14", \
326         RUN+="/bin/sh -c 'echo 60 > /sys$$DEVPATH/timeout'"
327 ACTION=="add", SUBSYSTEM="scsi" , SYSFS{type}=="1", \
328         RUN+="/bin/sh -c 'echo 900 > /sys$$DEVPATH/timeout'"
329
330
331 ACTION=="add", SUBSYSTEM=="scsi_device" RUN+="/sbin/modprobe sg"
332 ACTION=="add", SUBSYSTEM=="scsi_device", SYSFS{type}=="0|7|14", \
333         RUN+="/sbin/modprobe sd_mod"
334 ACTION=="add", SUBSYSTEM=="scsi_device", SYSFS{type}=="[45]", \
335         RUN+="/sbin/modprobe sr_mod"
336
337 ACTION=="add", KERNEL=="sg[0-9]*", BUS=="scsi", SYSFS{type}=="[36]", \
338         SYMLINK+="scanner scanner-%k", MODE="0660"
339
340 ACTION=="add", KERNEL=="sg[0-9]*", BUS=="scsi", SYSFS{type}=="8", \
341         SYMLINK+="changer changer-%k", MODE="0660", GROUP="disk"
342
343 ACTION=="add", SUBSYSTEM=="scsi_device", SYSFS{type}=="1", SYSFS{device/vendor}=="On[sS]tream", \
344         SYSFS{model}!="ADR*", RUN+="/sbin/modprobe osst"
345 ACTION=="add", SUBSYSTEM=="scsi_device", SYSFS{type}=="1", SYSFS{device/vendor}=="On[sS]tream", \
346         SYSFS{model}=="ADR*", RUN+="/sbin/modprobe st"
347 ACTION=="add", SUBSYSTEM=="scsi_device", SYSFS{type}=="1", SYSFS{device/vendor}!="On[sS]tream", \
348         RUN+="/sbin/modprobe st"
349
350 RUN+="socket:/org/kernel/udev/monitor"
351