2 # hdw-linux device naming rules for udev
6 KERNEL=="pty[pqrstuvwxyzabcdef][0123456789abcdef]", NAME="%k", GROUP="tty", OPTIONS="last_rule"
7 KERNEL=="tty[pqrstuvwxyzabcdef][0123456789abcdef]", NAME="%k", GROUP="tty", OPTIONS="last_rule"
8 KERNEL=="vcs*", NAME="%k", GROUP="tty", OPTIONS="last_rule"
9 KERNEL=="vcsa*", NAME="%k", GROUP="tty", OPTIONS="last_rule"
10 KERNEL=="tty", NAME="%k", GROUP="tty", MODE="0666", OPTIONS="last_rule"
11 KERNEL=="tty[0-9]", NAME="vc/%n", GROUP="tty", OPTIONS="last_rule"
12 KERNEL=="tty[0-9][0-9]", NAME="vc/%n", GROUP="tty", OPTIONS="last_rule"
13 KERNEL=="console", NAME="%k", GROUP="tty", MODE="0600"
14 KERNEL=="ptmx", NAME="%k", GROUP="tty", MODE="0666"
17 KERNEL=="ttyS[0-9]*", NAME="tts/%n", SYMLINK+="%k", GROUP="users"
18 KERNEL=="ttyUSB[0-9]*", NAME="tts/USB%n", GROUP="tty", MODE="0660"
19 KERNEL=="ippp0", NAME="%k", GROUP="tty"
20 KERNEL=="isdn*" NAME="%k", GROUP="tty"
21 KERNEL=="dcbri*", NAME="%k", GROUP="tty"
22 KERNEL=="ircomm*", NAME="%k", GROUP="tty"
25 SUBSYSTEM=="block", GROUP="disk"
27 # cdrom symlinks and other good cdrom naming
28 BUS=="ide", KERNEL=="hd[a-z]", ACTION=="add", IMPORT="/sbin/cdrom_id --export $tempnode"
29 BUS=="scsi", KERNEL="sr[0-9]*", ACTION=="add", IMPORT="/sbin/cdrom_id --export $tempnode"
30 BUS=="scsi", KERNEL="scd[a-z]", ACTION=="add", IMPORT="/sbin/cdrom_id --export $tempnode"
31 ENV{ID_CDROM}=="?*", SYMLINK+="cdrom%e", GROUP="cdrom"
32 ENV{ID_CDROM_CD_RW}=="?*", SYMLINK+="cdrw%e"
33 ENV{ID_CDROM_DVD}=="?*", SYMLINK+="dvd%e"
34 ENV{ID_CDROM_DVD_R}=="?*", SYMLINK+="dvdrw%e"
37 KERNEL=="sd*", NAME="%k", GROUP="disk"
38 KERNEL=="dasd*", NAME="%k", GROUP="disk"
39 KERNEL=="ataraid*", NAME="%k", GROUP="disk"
42 KERNEL=="cciss*", PROGRAM="/etc/udev/scripts/raid-devfs.sh %k", NAME="%c{1}", SYMLINK+="%k"
43 KERNEL=="ida*", PROGRAM="/etc/udev/scripts/raid-devfs.sh %k", NAME="%c{1}", SYMLINK+="%k"
46 KERNEL=="rd*", PROGRAM="/etc/udev/scripts/raid-devfs.sh %k", NAME="%c{1}", SYMLINK+="%k"
49 KERNEL=="card*", NAME="dri/card%n", GROUP="video"
50 KERNEL=="nvidia*", NAME="%k", GROUP="video"
51 KERNEL=="3dfx*", NAME="%k", GROUP="video"
54 SUBSYSTEM=="sound", GROUP="users"
55 KERNEL=="controlC[0-9]*", NAME="snd/%k"
56 KERNEL=="hw[CD0-9]*", NAME="snd/%k"
57 KERNEL=="pcm[CD0-9cp]*", NAME="snd/%k"
58 KERNEL=="midiC[D0-9]*", NAME="snd/%k"
59 KERNEL=="timer", NAME="snd/%k"
60 KERNEL=="seq", NAME="snd/%k"
63 KERNEL=="capi", NAME="capi20", SYMLINK+="isdn/capi20", GROUP="dialout"
64 KERNEL=="capi*", NAME="capi/%n", GROUP="dialout"
67 KERNEL=="cpu[0-9]*", NAME="cpu/%n/cpuid"
68 KERNEL=="msr[0-9]*", NAME="cpu/%n/msr"
69 KERNEL=="microcode", NAME="cpu/microcode"
71 # dm devices (ignore them)
72 KERNEL=="dm-[0-9]*", OPTIONS="ignore_device"
73 # create a symlink named after the device map name
74 # note devmap_name comes with extras/multipath
75 #KERNEL=="dm-[0-9]*", PaudioROGRAM="/sbin/devmap_name %M %m", NAME="%k", SYMLINK+="%c"
76 KERNEL=="device-mapper", NAME="mapper/control"
79 KERNEL=="fb[0-9]*", NAME="fb/%n", SYMLINK+="%k", GROUP="video"
82 KERNEL=="fd[0-9]*", NAME="floppy/%n", SYMLINK+="%k", GROUP="floppy"
85 KERNEL=="i2c-[0-9]*", NAME="i2c/%n", SYMLINK+="%k"
88 KERNEL=="mice", NAME="input/%k", MODE="0644"
89 KERNEL=="mouse*", NAME="input/%k", MODE="0644"
90 KERNEL=="event*", NAME="input/%k", MODE="0600"
91 KERNEL=="js*", NAME="input/%k", MODE="664"
92 KERNEL=="ts*", NAME="input/%k", MODE="0600"
95 KERNEL=="loop[0-9]*", NAME="loop/%n", SYMLINK+="%k", GROUP="disk"
98 KERNEL=="md[0-9]*", NAME="md/%n", SYMLINK+="%k", GROUP="disk"
101 SUBSYSTEM=="aoe", KERNEL=="discover", NAME="etherd/%k", GROUP="disk", MODE="0220"
102 SUBSYSTEM=="aoe", KERNEL=="err", NAME="etherd/%k", GROUP="disk", MODE="0440"
103 SUBSYSTEM=="aoe", KERNEL=="interfaces", NAME="etherd/%k", GROUP="disk", MODE="0220"
106 KERNEL=="agpgart", NAME="misc/%k", SYMLINK+="%k"
107 KERNEL=="psaux", NAME="misc/%k", SYMLINK+="%k"
108 KERNEL=="rtc", NAME="misc/%k", SYMLINK+="%k", MODE="0664"
109 KERNEL=="uinput", NAME="misc/%k", SYMLINK+="%k"
110 KERNEL=="inotify", NAME="misc/%k", SYMLINK+="%k", MODE="0666"
113 KERNEL=="route", NAME="netlink/%k"
114 KERNEL=="skip", NAME="netlink/%k"
115 KERNEL=="usersock", NAME="netlink/%k"
116 KERNEL=="fwmonitor", NAME="netlink/%k"
117 KERNEL=="tcpdiag", NAME="netlink/%k"
118 KERNEL=="nflog", NAME="netlink/%k"
119 KERNEL=="xfrm", NAME="netlink/%k"
120 KERNEL=="arpd", NAME="netlink/%k"
121 KERNEL=="route6", NAME="netlink/%k"
122 KERNEL=="ip6_fw", NAME="netlink/%k"
123 KERNEL=="dnrtmsg", NAME="netlink/%k"
124 KERNEL=="tap*", NAME="netlink/%k"
127 KERNEL=="tun", NAME="net/%k"
130 KERNEL=="ram[0-9]*", NAME="rd/%n", SYMLINK+="%k"
132 # IEEE1394 (firewire) devices (must be before raw devices below)
133 KERNEL=="raw1394", NAME="%k", GROUP="video"
134 KERNEL=="dv1394*", NAME="dv1394/%n", GROUP="video"
135 KERNEL=="video1394*", NAME="video1394/%n", GROUP="video"
138 KERNEL=="raw[0-9]*", NAME="raw/%k", GROUP="disk"
139 KERNEL=="ram*", NAME="%k", GROUP="disk"
142 KERNEL=="adsp", NAME="sound/%k", SYMLINK+="%k", GROUP="users"
143 KERNEL=="adsp[0-9]*", NAME="sound/%k", SYMLINK+="%k", GROUP="users"
144 KERNEL=="audio", NAME="sound/%k", SYMLINK+="%k", GROUP="users"
145 KERNEL=="audio[0-9]*", NAME="sound/%k", SYMLINK+="%k", GROUP="users"
146 KERNEL=="dsp", NAME="sound/%k", SYMLINK+="%k", GROUP="users"
147 KERNEL=="dsp[0-9]*", NAME="sound/%k", SYMLINK+="%k", GROUP="users"
148 KERNEL=="mixer", NAME="sound/%k", SYMLINK+="%k", GROUP="users"
149 KERNEL=="mixer[0-9]*", NAME="sound/%k", SYMLINK+="%k", GROUP="users"
150 KERNEL=="sequencer", NAME="sound/%k", SYMLINK+="%k", GROUP="users"
151 KERNEL=="sequencer[0-9]*", NAME="sound/%k", SYMLINK+="%k", GROUP="users"
154 KERNEL=="random", NAME="%k", MODE="0666"
155 KERNEL=="urandom", NAME="%k", MODE="0444"
156 KERNEL=="mem", NAME="%k", MODE="0640"
157 KERNEL=="kmem", NAME="%k", MODE="0640"
158 KERNEL=="port", NAME="%k", MODE="0640"
159 KERNEL=="full", NAME="%k", MODE="0666"
160 KERNEL=="null", NAME="%k", MODE="0666"
161 KERNEL=="zero", NAME="%k", MODE="0666"
164 KERNEL=="hiddev*", NAME="usb/%k"
165 KERNEL=="auer*", NAME="usb/%k"
166 KERNEL=="legousbtower*", NAME="usb/%k", GROUP="usb"
167 KERNEL=="dabusb*", NAME="usb/%k"
168 BUS=="usb", KERNEL=="lp[0-9]*", NAME="usb/%k", GROUP="lp"
171 KERNEL=="video[0-9]*", NAME="v4l/video%n", SYMLINK+="video%n", GROUP="video"
172 KERNEL=="radio[0-9]*", NAME="v4l/radio%n", GROUP="video"
173 KERNEL=="vbi[0-9]*", NAME="v4l/vbi%n", SYMLINK+="vbi%n", GROUP="video"
174 KERNEL=="vtx[0-9]*", NAME="v4l/vtx%n", GROUP="video"
177 KERNEL=="dvb*", PROGRAM="/etc/udev/scripts/dvb.sh %k", NAME="%c", GROUP="video", MODE="0660"
179 # Asterisk Zaptel devices
180 KERNEL=="zapctl", NAME="zap/ctl"
181 KERNEL=="zaptimer", NAME="zap/timer"
182 KERNEL=="zapchannel", NAME="zap/channel"
183 KERNEL=="zappseudo", NAME="zap/pseudo"
184 KERNEL=="zap[0-9]*", NAME="zap/%n"
187 KERNEL=="pilot", NAME="%k", GROUP="uucp"
190 KERNEL=="jaz*", NAME="%k", GROUP="disk"
193 KERNEL=="pocketzip*", NAME="%k", GROUP="disk"
194 KERNEL=="zip*", NAME="%k", GROUP="disk"
197 KERNEL=="ls120", NAME="%k", GROUP="disk"
200 KERNEL=="lp*", NAME="%k", GROUP="lp"
201 KERNEL=="irlpt", NAME="%k", GROUP="lp"
202 KERNEL=="usblp", NAME="%k", GROUP="lp"
203 KERNEL=="lp*", NAME="%k", GROUP="lp"
206 KERNEL=="ht*", NAME="%k", GROUP="tape"
207 KERNEL=="nht*", NAME="%k", GROUP="tape"
208 KERNEL=="pt*", NAME="%k", GROUP="tape"
209 KERNEL=="npt*", NAME="%k", GROUP="tape"
210 KERNEL=="st*", NAME="%k", GROUP="tape"
211 KERNEL=="nst*", NAME="%k", GROUP="tape"
212 KERNEL=="osst*", NAME="%k", GROUP="tape"
213 KERNEL=="nosst*", NAME="%k", GROUP="tape"
216 KERNEL=="diskonkey*", NAME="%k", GROUP="disk"
219 KERNEL=="microdrive*", NAME="%k", GROUP="disk"
222 KERNEL=="kbd", NAME="%k", MODE="0664"
224 # Sony Vaio Jogdial sonypi device
225 KERNEL=="sonypi", NAME="%k", MODE="0666"
228 KERNEL=="pktcdvd", NAME="pktcdvd/control", GROUP="cdrw", MODE="0660"
229 KERNEL=="pktcdvd[0-9]*", NAME="pktcdvd/pktcdvd%n", GROUP="cdrw", MODE="0660"
232 KERNEL=="umad*", NAME="infiniband/%k"
233 KERNEL=="issm*", NAME="infiniband/%k"
236 KERNEL=="tpm*", NAME="%k", OWNER="tss", GROUP="tss", MODE="0600"
238 #######################################
239 # Persistant block device stuff - begin
240 #######################################
242 # Skip all of this if we are not adding a block device
243 ACTION!="add", GOTO="persistent_end"
244 SUBSYSTEM!="block", GOTO="persistent_end"
246 # skip accessing removable ide devices, cause the ide drivers are horrible broken
247 BUS=="ide", SYSFS{removable}="1", GOTO="no_volume_id"
248 BUS=="ide", SYSFS{../removable}="1", GOTO="no_volume_id"
250 # persistent disk device links /dev/disk/
251 KERNEL=="hd*[!0-9]", IMPORT="/sbin/ata_id --export $tempnode"
252 KERNEL=="hd*[!0-9]", ENV{ID_SERIAL}=="?*", SYMLINK+="disk/by-id/ata-$env{ID_MODEL}_$env{ID_SERIAL}"
253 KERNEL=="hd*[0-9]", IMPORT{parent}=="ID_*", SYMLINK+="disk/by-id/ata-$env{ID_MODEL}_$env{ID_SERIAL}-part%n"
255 KERNEL=="sd*[!0-9]", SYSFS{ieee1394_id}=="*", IMPORT="/bin/echo -e 'ID_SERIAL=$sysfs{ieee1394_id}\nID_BUS=ieee1394'"
256 KERNEL=="sd*[!0-9]", ENV{ID_SERIAL}=="", IMPORT="/sbin/usb_id -x"
257 KERNEL=="sd*[!0-9]", ENV{ID_SERIAL}=="", IMPORT="/sbin/scsi_id -g -x -s %p"
258 KERNEL=="sd*[!0-9]", ENV{ID_SERIAL}=="", IMPORT="/sbin/scsi_id -g -x -a -s %p"
259 KERNEL=="sd*[!0-9]", ENV{ID_SERIAL}=="?*", SYMLINK+="disk/by-id/$env{ID_BUS}-$env{ID_SERIAL}"
260 KERNEL=="sd*[0-9]", IMPORT{parent}=="ID_*"
261 KERNEL=="sd*[0-9]", ENV{ID_SERIAL}=="?*", SYMLINK+="disk/by-id/$env{ID_BUS}-$env{ID_SERIAL}-part%n"
263 # Skip id for ram / loop / fd
264 KERNEL=="ram*", GOTO="no_volume_id"
265 KERNEL=="loop*", GOTO="no_volume_id"
266 KERNEL=="fd*", GOTO="no_volume_id"
268 KERNEL=="*[!0-9]", ENV{ID_TYPE}=="?*", IMPORT="/sbin/path_id %p", SYMLINK+="disk/by-path/$env{ID_PATH}"
269 KERNEL=="*[0-9]", IMPORT{parent}=="ID_*"
270 KERNEL=="*[0-9]", ENV{ID_PATH}=="?*", SYMLINK+="disk/by-path/$env{ID_PATH}-part%n"
273 KERNEL=="*[!0-9]", SYSFS{removable}=="1", GOTO="no_volume_id"
274 KERNEL=="sr*", GOTO="no_volume_id"
275 KERNEL=="*[0-9]", IMPORT="/sbin/vol_id --export $tempnode"
276 KERNEL=="*[0-9]", ENV{ID_FS_UUID}=="?*", SYMLINK+="disk/by-uuid/$env{ID_FS_UUID}"
277 KERNEL=="*[0-9]", ENV{ID_FS_LABEL_SAFE}=="?*", SYMLINK+="disk/by-label/$env{ID_FS_LABEL_SAFE}"
280 LABEL="persistent_end"
282 #####################################
283 # Persistant block device stuff - end
284 #####################################
286 # usbfs-like device nodes
287 SUBSYSTEM="usb_device", PROGRAM="/bin/sh -c 'X=%k X=$${X#usbdev} B=$${X%%%%.*} D=$${X#*.}; echo bus/usb/$$B/$$D'", SYMLINK+="%c"
290 # be backward compatible for a while with the /etc/dev.d and /etc/hotplug.d/ systems
291 # run /etc/hotplug.d/ stuff only if we came from a hotplug event, not for udevstart
292 ENV{UDEVD_EVENT}=="1", RUN+="/sbin/udev_run_hotplugd"
294 # always run /etc/dev.d/ stuff for now.
295 RUN+="/sbin/udev_run_devd"
298 RUN+="socket:/org/kernel/udev/monitor"