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