chiark / gitweb /
update Debian rules
[elogind.git] / etc / udev / debian / devfs.rules
1 # There are a number of modifiers that are allowed to be used in some
2 # of the different fields. They provide the following subsitutions:
3 #
4 # %n the "kernel number" of the device.
5 #    For example, 'sda3' has a "kernel number" of '3'
6 # %k the kernel name for the device
7 # %M the kernel major number for the device
8 # %m the kernel minor number for the device
9 # %b the bus id for the device
10 # %c the string returned by the PROGRAM
11 # %s{filename} the content of a sysfs attribute
12 # %% the '%' char itself
13 #
14
15 # workaround for devices which do not report media changes
16 SUBSYSTEMS=="ide", KERNEL=="hd[a-z]", ATTRS{removable}=="1", \
17         ENV{ID_MODEL}=="IOMEGA_ZIP*",   NAME="%k", OPTIONS+="all_partitions"
18 SUBSYSTEMS=="ide", KERNEL=="hd[a-z]", ATTRS{media}=="floppy", \
19         OPTIONS+="all_partitions"
20
21 # IDE devices
22 SUBSYSTEMS=="ide", KERNEL=="hd[a-z]*", PROGRAM="ide-devfs.sh %k %b %n", \
23                                         NAME="%c{1}", SYMLINK+="%k %c{2}"
24
25 # SCSI devices
26 SUBSYSTEMS=="scsi", PROGRAM="scsi-devfs.sh %k %b %n", \
27                                         NAME="%c{1}", SYMLINK+="%k %c{2}"
28
29 # RAID controllers
30 KERNEL=="cciss!*|ida!*|rd!*", PROGRAM="raid-devfs.sh %k", \
31                                         NAME="%c{1}", SYMLINK+="%k"
32
33 # other block devices
34 KERNEL=="md[0-9]*",                     NAME="md/%n",
35 KERNEL=="loop[0-9]*",                   NAME="loop/%n"
36 KERNEL=="ram[0-9]*",                    NAME="rd/%n"
37
38 # USB devices
39 SUBSYSTEMS=="usb", KERNEL=="auer[0-9]*",        NAME="usb/%k"
40 SUBSYSTEMS=="usb", KERNEL=="cpad[0-9]*",        NAME="usb/%k"
41 SUBSYSTEMS=="usb", KERNEL=="dabusb*",           NAME="usb/%k"
42 SUBSYSTEMS=="usb", KERNEL=="hiddev*",           NAME="usb/%k"
43 SUBSYSTEMS=="usb", KERNEL=="legousbtower*",     NAME="usb/%k"
44 SUBSYSTEMS=="usb", KERNEL=="lp[0-9]*",          NAME="usb/%k"
45 SUBSYSTEMS=="usb", KERNEL=="ttyUSB*", \
46         ATTRS{product}=="Palm Handheld*|Handspring Visor|palmOne Handheld", \
47                                                 SYMLINK+="pilot"
48
49 # usbfs-like devices
50 SUBSYSTEM=="usb_device",        PROGRAM="/bin/sh -c 'K=%k; K=$${K#usbdev}; printf bus/usb/%%03i/%%03i $${K%%%%.*} $${K#*.}'", \
51                                 NAME="%c"
52
53 # serial devices
54 KERNEL=="ttyS[0-9]*",           NAME="tts/%n"
55 KERNEL=="ttyUSB[0-9]*",         NAME="tts/USB%n"
56 KERNEL=="rfcomm[0-9]*",         NAME="bluetooth/rfcomm/%n",
57 KERNEL=="capi",                 NAME="capi20", SYMLINK+="isdn/capi20"
58 KERNEL=="capi[0-9]*",           NAME="capi/%n"
59
60 # vc devices
61 KERNEL=="tty[0-9]*",            NAME="vc/%n"
62 KERNEL=="vcs",                  NAME="vcc/0"
63 KERNEL=="vcs[0-9]*",            NAME="vcc/%n"
64 KERNEL=="vcsa",                 NAME="vcc/a0"
65 KERNEL=="vcsa[0-9]*",           NAME="vcc/a%n"
66
67 # video devices
68 KERNEL=="video[0-9]*",          NAME="v4l/%k"
69 KERNEL=="radio[0-9]*",          NAME="v4l/%k"
70 KERNEL=="vbi[0-9]*",            NAME="v4l/%k"
71 KERNEL=="vtx[0-9]*",            NAME="v4l/%k"
72 KERNEL=="dvb*",                 PROGRAM="/bin/sh -c 'K=%k; K=$${K#dvb}; printf dvb/adapter%%i/%%s $${K%%%%.*} $${K#*.}", \
73                                 NAME="%c"
74 KERNEL=="fb[0-9]*",             NAME="fb/%n"
75 KERNEL=="card[0-9]*",           NAME="dri/%k"
76
77 # misc devices
78 KERNEL=="apm_bios",             NAME="misc/%k",
79 KERNEL=="agpgart",              NAME="misc/%k"
80 KERNEL=="hw_random",            NAME="hwrng"
81 KERNEL=="nvram",                NAME="misc/%k"
82 KERNEL=="psaux",                NAME="misc/%k"
83 KERNEL=="rtc",                  NAME="misc/%k"
84 KERNEL=="tun",                  NAME="net/%k"
85 KERNEL=="evtchn",               NAME="xen/%k"
86
87 # printers and parallel devices
88 KERNEL=="lp[0-9]*",             NAME="printers/%n"
89 KERNEL=="parport[0-9]*",        NAME="parports/%n"
90
91 KERNEL=="i2c-[0-9]*",           NAME="i2c/%n"
92 KERNEL=="fd[0-9]*",             NAME="floppy/%n"
93
94 KERNEL=="cdemu[0-9]*",          NAME="cdemu/%n"
95 KERNEL=="pktcdvd[0-9]*",        NAME="pktcdvd/%n"
96 KERNEL=="pktcdvd",              NAME="pktcdvd/control"
97
98 KERNEL=="cpu[0-9]*",            NAME="cpu/%n/cpuid"
99 KERNEL=="msr[0-9]*",            NAME="cpu/%n/msr"
100 KERNEL=="microcode",            NAME="cpu/microcode"
101
102 KERNEL=="umad*",                NAME="infiniband/%k"
103 KERNEL=="issm*",                NAME="infiniband/%k"
104 KERNEL=="uverbs*",              NAME="infiniband/%k"
105 KERNEL=="ucm*",                 NAME="infiniband/%k"
106
107 # sound devices
108 KERNEL=="controlC[0-9]*",       NAME="snd/%k"
109 KERNEL=="hwC[D0-9]*",           NAME="snd/%k"
110 KERNEL=="pcmC[D0-9cp]*",        NAME="snd/%k"
111 KERNEL=="midiC[D0-9]*",         NAME="snd/%k"
112 KERNEL=="timer",                NAME="snd/%k"
113 KERNEL=="seq",                  NAME="snd/%k"
114 KERNEL=="audio*",               NAME="sound/%k"
115 KERNEL=="dsp*",                 NAME="sound/%k"
116 KERNEL=="adsp*",                NAME="sound/%k"
117 KERNEL=="midi*",                NAME="sound/%k"
118 KERNEL=="mixer*",               NAME="sound/%k"
119 KERNEL=="sequencer*",           NAME="sound/%k"
120 KERNEL=="amidi*",               NAME="sound/%k"
121 KERNEL=="dmmidi*",              NAME="sound/%k"
122 KERNEL=="admmidi*",             NAME="sound/%k"
123
124 # ieee1394 devices       
125 KERNEL=="dv1394*",              NAME="dv1394/%n"
126 KERNEL=="video1394*",           NAME="video1394/%n"
127
128 # input devices
129 KERNEL=="mice",                 NAME="input/%k"
130 KERNEL=="mouse[0-9]*",          NAME="input/%k"
131 KERNEL=="event[0-9]*",          NAME="input/%k"
132 KERNEL=="js[0-9]*",             NAME="input/%k"
133 KERNEL=="ts[0-9]*",             NAME="input/%k"
134 KERNEL=="uinput",               NAME="input/%k"
135
136 # Zaptel
137 KERNEL=="zapctl",               NAME="zap/ctl"
138 KERNEL=="zaptimer",             NAME="zap/timer"
139 KERNEL=="zapchannel",           NAME="zap/channel"
140 KERNEL=="zappseudo",            NAME="zap/pseudo"
141 KERNEL=="zap[0-9]*",            NAME="zap/%n"
142
143 # AOE character devices
144 SUBSYSTEM=="aoe", KERNEL=="discover",   NAME="etherd/%k"
145 SUBSYSTEM=="aoe", KERNEL=="err",        NAME="etherd/%k"
146 SUBSYSTEM=="aoe", KERNEL=="interfaces", NAME="etherd/%k"
147 SUBSYSTEM=="aoe", KERNEL=="revalidate", NAME="etherd/%k"
148
149 # device mapper creates its own device nodes, so ignore these
150 KERNEL=="dm-[0-9]*",            NAME=""
151 KERNEL=="device-mapper",        NAME="mapper/control"
152