Annotation of /trunk/udev/udev.rules.magellan
Parent Directory | Revision Log
Revision 121 -
(hide annotations)
(download)
Wed Mar 21 16:48:37 2007 UTC (17 years, 7 months ago) by niro
File size: 12232 byte(s)
Wed Mar 21 16:48:37 2007 UTC (17 years, 7 months ago) by niro
File size: 12232 byte(s)
- moved to udev root. manage versions with tags now
1 | niro | 121 | # /etc/udev/rules/50-udev.rules: device naming rules for udev |
2 | # $Header: /root/magellan-cvs/src/udev/udev.rules.magellan,v 1.1 2007-03-21 16:48:37 niro Exp $ | ||
3 | # | ||
4 | # There are a number of modifiers that are allowed to be used in some | ||
5 | # of the different fields. They provide the following subsitutions: | ||
6 | # %n - the "kernel number" of the device. | ||
7 | # For example, 'sda3' has a "kernel number" of '3' | ||
8 | # %k - the kernel name for the device. | ||
9 | # %M - the kernel major number for the device | ||
10 | # %m - the kernel minor number for the device | ||
11 | # %b - the bus id for the device | ||
12 | # %c - the string returned by the PROGRAM. (Note, this doesn't work within | ||
13 | # the PROGRAM field for the obvious reason.) | ||
14 | # %s{filename} - the content of a sysfs attribute. | ||
15 | # %% - the '%' char itself. | ||
16 | # | ||
17 | # Try not to modify this file, if you wish to change things, create a new rule | ||
18 | # file that can be run before this one. | ||
19 | # | ||
20 | |||
21 | |||
22 | # console | ||
23 | KERNEL=="pty[pqrstuvwxyzabcdef][0123456789abcdef]", NAME="%k", GROUP="tty", OPTIONS="last_rule" | ||
24 | KERNEL=="tty[pqrstuvwxyzabcdef][0123456789abcdef]", NAME="%k", GROUP="tty", OPTIONS="last_rule" | ||
25 | KERNEL=="vcs*", NAME="%k", GROUP="tty", OPTIONS="last_rule" | ||
26 | KERNEL=="vcsa*", NAME="%k", GROUP="tty", OPTIONS="last_rule" | ||
27 | KERNEL=="tty", NAME="%k", GROUP="tty", MODE="0666", OPTIONS="last_rule" | ||
28 | KERNEL=="tty[0-9]", NAME="%k", GROUP="tty", OPTIONS="last_rule" | ||
29 | KERNEL=="tty[0-9][0-9]", NAME="%k", GROUP="tty", OPTIONS="last_rule" | ||
30 | KERNEL=="console", NAME="%k", GROUP="tty", MODE="0600" | ||
31 | KERNEL=="ptmx", NAME="%k", GROUP="tty", MODE="0666" | ||
32 | |||
33 | # tty devices | ||
34 | KERNEL=="ttyS[0-9]*", NAME="%k", SYMLINK="tts/%n", GROUP="tty" | ||
35 | KERNEL=="ttyUSB[0-9]*", NAME="%k", SYMLINK="tts/USB%n", GROUP="tty", MODE="0660" | ||
36 | KERNEL=="ippp0", NAME="%k", GROUP="tty" | ||
37 | KERNEL=="isdn*" NAME="%k", GROUP="tty" | ||
38 | KERNEL=="dcbri*", NAME="%k", GROUP="tty" | ||
39 | KERNEL=="ircomm*", NAME="%k", GROUP="tty" | ||
40 | |||
41 | # all block devices | ||
42 | SUBSYSTEM=="block", GROUP="disk" | ||
43 | |||
44 | # cdrom symlinks and other good cdrom naming | ||
45 | BUS=="ide", KERNEL=="hd[a-z]", ACTION=="add", IMPORT="cdrom_id --export $tempnode" | ||
46 | BUS=="scsi", KERNEL=="sr[0-9]*", ACTION=="add", IMPORT="cdrom_id --export $tempnode" | ||
47 | BUS=="scsi", KERNEL=="scd[a-z]", ACTION=="add", IMPORT="cdrom_id --export $tempnode" | ||
48 | BUS=="scsi", KERNEL=="sg[0-9]*", ACTION=="add", DRIVERS=="sr", GROUP="cdrom" | ||
49 | ENV{ID_CDROM}=="?*", PROGRAM="seq_node.sh %r %k cdrom", SYMLINK+="%c", GROUP="cdrom" | ||
50 | ENV{ID_CDROM_CD_RW}=="?*", PROGRAM="seq_node.sh %r %k cdrw", SYMLINK+="%c" | ||
51 | ENV{ID_CDROM_DVD}=="?*", PROGRAM="seq_node.sh %r %k dvd", SYMLINK+="%c" | ||
52 | ENV{ID_CDROM_DVD_R}=="?*", PROGRAM="seq_node.sh %r %k dvdrw", SYMLINK+="%c" | ||
53 | |||
54 | |||
55 | # disk devices | ||
56 | KERNEL=="sd*", NAME="%k", GROUP="disk" | ||
57 | KERNEL=="dasd*", NAME="%k", GROUP="disk" | ||
58 | KERNEL=="ataraid*", NAME="%k", GROUP="disk" | ||
59 | |||
60 | # compaq smart array | ||
61 | KERNEL=="cciss*", NAME="%k" | ||
62 | KERNEL=="ida*", NAME="%k" | ||
63 | |||
64 | # mylex | ||
65 | KERNEL=="rd*", NAME="%k" | ||
66 | |||
67 | # dri devices | ||
68 | KERNEL=="card*", NAME="dri/card%n", GROUP="video" | ||
69 | KERNEL=="nvidia*", NAME="%k", GROUP="video" | ||
70 | KERNEL=="3dfx*", NAME="%k", GROUP="video" | ||
71 | |||
72 | # alsa devices | ||
73 | SUBSYSTEM=="sound", GROUP="audio" | ||
74 | KERNEL=="controlC[0-9]*", NAME="snd/%k" | ||
75 | KERNEL=="hw[CD0-9]*", NAME="snd/%k" | ||
76 | KERNEL=="pcm[CD0-9cp]*", NAME="snd/%k" | ||
77 | KERNEL=="midiC[D0-9]*", NAME="snd/%k" | ||
78 | KERNEL=="timer", NAME="snd/%k" | ||
79 | KERNEL=="seq", NAME="snd/%k" | ||
80 | |||
81 | # capi devices | ||
82 | KERNEL=="capi", NAME="capi20", SYMLINK+="isdn/capi20", GROUP="dialout" | ||
83 | KERNEL=="capi*", NAME="capi/%n", GROUP="dialout" | ||
84 | |||
85 | # cpu devices | ||
86 | KERNEL=="cpu[0-9]*", NAME="cpu/%n/cpuid" | ||
87 | KERNEL=="msr[0-9]*", NAME="cpu/%n/msr" | ||
88 | KERNEL=="microcode", NAME="cpu/microcode" | ||
89 | |||
90 | # dm devices (ignore them) | ||
91 | KERNEL=="dm-[0-9]*", OPTIONS="ignore_device" | ||
92 | # create a symlink named after the device map name | ||
93 | # note devmap_name comes with extras/multipath | ||
94 | #KERNEL=="dm-[0-9]*", PROGRAM="/sbin/devmap_name %M %m", NAME="%k", SYMLINK+="%c" | ||
95 | KERNEL=="device-mapper", NAME="mapper/control" | ||
96 | |||
97 | # fb devices | ||
98 | KERNEL=="fb[0-9]*", NAME="fb/%n", SYMLINK+="%k", GROUP="video" | ||
99 | |||
100 | # floppy devices | ||
101 | KERNEL=="fd[0-9]*", NAME="floppy/%n", SYMLINK+="%k", GROUP="floppy" | ||
102 | |||
103 | # i2c devices | ||
104 | KERNEL=="i2c-[0-9]*", NAME="i2c/%n", SYMLINK+="%k" | ||
105 | |||
106 | # input devices | ||
107 | KERNEL=="mice", NAME="input/%k", MODE="0644" | ||
108 | KERNEL=="mouse*", NAME="input/%k", MODE="0644" | ||
109 | KERNEL=="event*", NAME="input/%k", MODE="0600" | ||
110 | KERNEL=="js*", NAME="input/%k", MODE="664" | ||
111 | KERNEL=="ts*", NAME="input/%k", MODE="0600" | ||
112 | |||
113 | # loop devices | ||
114 | KERNEL=="loop[0-9]*", NAME="loop/%n", SYMLINK+="%k", GROUP="disk" | ||
115 | |||
116 | # md block devices | ||
117 | KERNEL=="md[0-9]*", NAME="md/%n", SYMLINK+="%k", GROUP="disk" | ||
118 | |||
119 | # aoe char devices, | ||
120 | SUBSYSTEM=="aoe", KERNEL=="discover", NAME="etherd/%k", GROUP="disk", MODE="0220" | ||
121 | SUBSYSTEM=="aoe", KERNEL=="err", NAME="etherd/%k", GROUP="disk", MODE="0440" | ||
122 | SUBSYSTEM=="aoe", KERNEL=="interfaces", NAME="etherd/%k", GROUP="disk", MODE="0220" | ||
123 | |||
124 | # misc devices | ||
125 | KERNEL=="agpgart", NAME="misc/%k", SYMLINK+="%k" | ||
126 | KERNEL=="psaux", NAME="misc/%k", SYMLINK+="%k" | ||
127 | KERNEL=="rtc", NAME="misc/%k", SYMLINK+="%k", MODE="0664" | ||
128 | KERNEL=="uinput", NAME="misc/%k", SYMLINK+="%k" | ||
129 | KERNEL=="inotify", NAME="misc/%k", SYMLINK+="%k", MODE="0666" | ||
130 | |||
131 | # netlink devices | ||
132 | KERNEL=="route", NAME="netlink/%k" | ||
133 | KERNEL=="skip", NAME="netlink/%k" | ||
134 | KERNEL=="usersock", NAME="netlink/%k" | ||
135 | KERNEL=="fwmonitor", NAME="netlink/%k" | ||
136 | KERNEL=="tcpdiag", NAME="netlink/%k" | ||
137 | KERNEL=="nflog", NAME="netlink/%k" | ||
138 | KERNEL=="xfrm", NAME="netlink/%k" | ||
139 | KERNEL=="arpd", NAME="netlink/%k" | ||
140 | KERNEL=="route6", NAME="netlink/%k" | ||
141 | KERNEL=="ip6_fw", NAME="netlink/%k" | ||
142 | KERNEL=="dnrtmsg", NAME="netlink/%k" | ||
143 | KERNEL=="tap*", NAME="netlink/%k" | ||
144 | |||
145 | # network devices | ||
146 | KERNEL=="tun", NAME="net/%k", MODE="0600" | ||
147 | |||
148 | # ramdisk devices | ||
149 | KERNEL=="ram[0-9]*", NAME="rd/%n", SYMLINK+="%k" | ||
150 | |||
151 | # IEEE1394 (firewire) devices (must be before raw devices below) | ||
152 | KERNEL=="raw1394", NAME="%k", GROUP="video" | ||
153 | KERNEL=="dv1394*", NAME="dv1394/%n", GROUP="video" | ||
154 | KERNEL=="video1394*", NAME="video1394/%n", GROUP="video" | ||
155 | |||
156 | # raw devices | ||
157 | KERNEL=="raw[0-9]*", NAME="raw/%k", GROUP="disk" | ||
158 | KERNEL=="ram*", NAME="%k", GROUP="disk" | ||
159 | |||
160 | # sound devices | ||
161 | KERNEL=="adsp", NAME="sound/%k", SYMLINK+="%k", GROUP="audio" | ||
162 | KERNEL=="adsp[0-9]*", NAME="sound/%k", SYMLINK+="%k", GROUP="audio" | ||
163 | KERNEL=="audio", NAME="sound/%k", SYMLINK+="%k", GROUP="audio" | ||
164 | KERNEL=="audio[0-9]*", NAME="sound/%k", SYMLINK+="%k", GROUP="audio" | ||
165 | KERNEL=="dsp", NAME="sound/%k", SYMLINK+="%k", GROUP="audio" | ||
166 | KERNEL=="dsp[0-9]*", NAME="sound/%k", SYMLINK+="%k", GROUP="audio" | ||
167 | KERNEL=="mixer", NAME="sound/%k", SYMLINK+="%k", GROUP="audio" | ||
168 | KERNEL=="mixer[0-9]*", NAME="sound/%k", SYMLINK+="%k", GROUP="audio" | ||
169 | KERNEL=="sequencer", NAME="sound/%k", SYMLINK+="%k", GROUP="audio" | ||
170 | KERNEL=="sequencer[0-9]*", NAME="sound/%k", SYMLINK+="%k", GROUP="audio" | ||
171 | |||
172 | # memory devices | ||
173 | KERNEL=="random", NAME="%k", MODE="0666" | ||
174 | KERNEL=="urandom", NAME="%k", MODE="0444" | ||
175 | KERNEL=="mem", NAME="%k", MODE="0640" | ||
176 | KERNEL=="kmem", NAME="%k", MODE="0640" | ||
177 | KERNEL=="port", NAME="%k", MODE="0640" | ||
178 | KERNEL=="full", NAME="%k", MODE="0666" | ||
179 | KERNEL=="null", NAME="%k", MODE="0666" | ||
180 | KERNEL=="zero", NAME="%k", MODE="0666" | ||
181 | |||
182 | # usb devices | ||
183 | KERNEL=="hiddev*", NAME="usb/%k" | ||
184 | KERNEL=="auer*", NAME="usb/%k" | ||
185 | KERNEL=="legousbtower*", NAME="usb/%k", GROUP="usb" | ||
186 | KERNEL=="dabusb*", NAME="usb/%k" | ||
187 | BUS=="usb", KERNEL=="lp[0-9]*", NAME="usb/%k", GROUP="lp" | ||
188 | |||
189 | # v4l devices | ||
190 | KERNEL=="video[0-9]*", NAME="v4l/video%n", SYMLINK+="video%n", GROUP="video" | ||
191 | KERNEL=="radio[0-9]*", NAME="v4l/radio%n", SYMLINK+="radio%n", GROUP="video" | ||
192 | KERNEL=="vbi[0-9]*", NAME="v4l/vbi%n", SYMLINK+="vbi%n", GROUP="video" | ||
193 | KERNEL=="vtx[0-9]*", NAME="v4l/vtx%n", GROUP="video" | ||
194 | |||
195 | # dvb devices | ||
196 | SUBSYSTEM=="dvb", PROGRAM="/bin/sh -c 'K=%k; K=$${K#dvb}; printf dvb/adapter%%i/%%s $${K%%%%.*} $${K#*.}'", NAME="%c", GROUP="video" | ||
197 | |||
198 | # Asterisk Zaptel devices | ||
199 | KERNEL=="zapctl", NAME="zap/ctl" | ||
200 | KERNEL=="zaptimer", NAME="zap/timer" | ||
201 | KERNEL=="zapchannel", NAME="zap/channel" | ||
202 | KERNEL=="zappseudo", NAME="zap/pseudo" | ||
203 | KERNEL=="zap[0-9]*", NAME="zap/%n" | ||
204 | |||
205 | # pilot/palm devices | ||
206 | KERNEL=="pilot", NAME="%k", GROUP="uucp" | ||
207 | |||
208 | # jaz devices | ||
209 | KERNEL=="jaz*", NAME="%k", GROUP="disk" | ||
210 | |||
211 | # zip devices | ||
212 | KERNEL=="pocketzip*", NAME="%k", GROUP="disk" | ||
213 | KERNEL=="zip*", NAME="%k", GROUP="disk" | ||
214 | |||
215 | # ls120 devices | ||
216 | KERNEL=="ls120", NAME="%k", GROUP="disk" | ||
217 | |||
218 | # lp devices | ||
219 | KERNEL=="lp*", NAME="%k", GROUP="lp" | ||
220 | KERNEL=="irlpt", NAME="%k", GROUP="lp" | ||
221 | KERNEL=="usblp", NAME="%k", GROUP="lp" | ||
222 | KERNEL=="lp*", NAME="%k", GROUP="lp" | ||
223 | KERNEL=="parport*", NAME="%k", GROUP="lp" | ||
224 | |||
225 | # tape devices | ||
226 | KERNEL=="ht*", NAME="%k", GROUP="tape" | ||
227 | KERNEL=="nht*", NAME="%k", GROUP="tape" | ||
228 | KERNEL=="pt*", NAME="%k", GROUP="tape" | ||
229 | KERNEL=="npt*", NAME="%k", GROUP="tape" | ||
230 | KERNEL=="st*", NAME="%k", GROUP="tape" | ||
231 | KERNEL=="nst*", NAME="%k", GROUP="tape" | ||
232 | KERNEL=="osst*", NAME="%k", GROUP="tape" | ||
233 | KERNEL=="nosst*", NAME="%k", GROUP="tape" | ||
234 | |||
235 | # diskonkey devices | ||
236 | KERNEL=="diskonkey*", NAME="%k", GROUP="disk" | ||
237 | |||
238 | # rem_ide devices | ||
239 | KERNEL=="microdrive*", NAME="%k", GROUP="disk" | ||
240 | |||
241 | # kbd devices | ||
242 | KERNEL=="kbd", NAME="%k", MODE="0664" | ||
243 | |||
244 | # Sony Vaio Jogdial sonypi device | ||
245 | KERNEL=="sonypi", NAME="%k", MODE="0666" | ||
246 | |||
247 | # packet devices | ||
248 | KERNEL=="pktcdvd", NAME="pktcdvd/control", GROUP="cdrw", MODE="0660" | ||
249 | KERNEL=="pktcdvd[0-9]*", NAME="pktcdvd/pktcdvd%n", GROUP="cdrw", MODE="0660" | ||
250 | |||
251 | # infiniband devices | ||
252 | KERNEL=="umad*", NAME="infiniband/%k" | ||
253 | KERNEL=="issm*", NAME="infiniband/%k" | ||
254 | |||
255 | |||
256 | # usbfs-like device nodes | ||
257 | SUBSYSTEM=="usb_device", PROGRAM="/bin/sh -c 'K=%k; K=$${K#usbdev}; printf bus/usb/%%03i/%%03i $${K%%%%.*} $${K#*.}'", NAME="%c", MODE="0644" | ||
258 | |||
259 | |||
260 | # Setting timeout for tape-devices to 900 seconds | ||
261 | # if you need timeouts for other devices add a similar rule | ||
262 | # with correct type-value, or open a bug on bugs.gentoo.org. | ||
263 | ACTION=="add", SUBSYSTEM=="scsi" , ATTRS{type}=="1", RUN+="/bin/sh -c 'echo 900 > /sys$$DEVPATH/timeout'" | ||
264 | |||
265 | # assign cdrom-permission also to associated generic device (for cd-burning ...) | ||
266 | KERNEL=="sg[0-9]*", ACTION=="add", ATTRS{type}=="4|5", GROUP="cdrom" | ||
267 | |||
268 | |||
269 | # Module autoloading | ||
270 | # this driver is broken and should not be loaded automatically | ||
271 | SUBSYSTEM=="platform", ENV{MODALIAS}=="i82365", GOTO="module_load_end" | ||
272 | |||
273 | # Autoload modules that lack aliases but have them defined inutoload modules | ||
274 | ENV{MODALIAS}=="?*", ACTION=="add", RUN+="modprobe.sh $env{MODALIAS}" | ||
275 | |||
276 | # /etc/modprobe.conf. | ||
277 | SUBSYSTEM=="pnp", ENV{MODALIAS}!="?*", RUN+="/bin/sh -c 'while read id; do modprobe.sh pnp:d$$id; done < /sys$devpath/id'" | ||
278 | # If you have problems with some pnp modules being loaded, please enter the | ||
279 | # following aliases into the modprobe configuration files. These are needed by | ||
280 | # udev to autoload some modules | ||
281 | # alias pnp:dPNP0510 irtty-sir | ||
282 | # alias pnp:dPNP0511 irtty-sir | ||
283 | # alias pnp:dPNP0700 floppy | ||
284 | # alias pnp:dPNP0800 pcspkr | ||
285 | # alias pnp:dPNP0b00 rtc | ||
286 | # alias pnp:dPNP0303 atkbd | ||
287 | # alias pnp:dPNP0f13 psmouse | ||
288 | # alias pnp:dPNPb02f analog | ||
289 | |||
290 | |||
291 | SUBSYSTEM=="i2o", ACTION=="add", RUN+="modprobe.sh i2o_block" | ||
292 | SUBSYSTEM=="mmc", ACTION=="add", RUN+="modprobe.sh mmc_block" | ||
293 | |||
294 | # Parts taken from redhat-rules | ||
295 | # sd: 0 TYPE_DISK, 7 TYPE_MOD, 14 TYPE_RBC | ||
296 | # sr: 4 TYPE_WORM, 5 TYPE_ROM | ||
297 | # st/osst: 1 TYPE_TAPE | ||
298 | |||
299 | # Load driver for scsi-device | ||
300 | ACTION=="add", SUBSYSTEM=="scsi_device", RUN+="modprobe.sh sg" | ||
301 | ACTION=="add", SUBSYSTEM=="scsi_device", ATTRS{type}=="0|7|14", RUN+="modprobe.sh sd_mod" | ||
302 | ACTION=="add", SUBSYSTEM=="scsi_device", ATTRS{type}=="4|5", RUN+="modprobe.sh sr_mod" | ||
303 | ACTION=="add", SUBSYSTEM=="scsi_device", ATTRS{type}=="8", RUN+="modprobe.sh ch" | ||
304 | |||
305 | ACTION=="add", SUBSYSTEM=="scsi_device", ATTRS{type}=="1", ENV{ID_SCSI_TAPE_DRIVER}="st" | ||
306 | ACTION=="add", SUBSYSTEM=="scsi_device", ATTRS{type}=="1", ATTRS{vendor}=="On[sS]tream", ATTRS{model}!="ADR*", ENV{ID_SCSI_TAPE_DRIVER}="osst" | ||
307 | ENV{ID_SCSI_TAPE_DRIVER}=="?*", RUN+="modprobe.sh $env{ID_SCSI_TAPE_DRIVER}" | ||
308 | |||
309 | SUBSYSTEM=="ide", ACTION=="add", ATTR{media}=="tape", RUN+="modprobe.sh ide-scsi" | ||
310 | |||
311 | LABEL="module_load_end" | ||
312 | |||
313 | # Load firmware | ||
314 | SUBSYSTEM=="firmware", ACTION=="add", RUN+="firmware.sh" | ||
315 | |||
316 | # be backward compatible for a while with the /etc/dev.d and /etc/hotplug.d/ systems | ||
317 | # run /etc/hotplug.d/ stuff only if we came from a hotplug event, not for udevstart | ||
318 | #ENV{UDEVD_EVENT}=="1", RUN+="udev_run_hotplugd $env{SUBSYSTEM}" | ||
319 | |||
320 | # always run /etc/dev.d/ stuff for now. | ||
321 | RUN+="udev_run_devd $env{SUBSYSTEM}" | ||
322 | |||
323 | # debugging monitor | ||
324 | RUN+="socket:/org/kernel/udev/monitor" |