chiark / gitweb /
update Debian rules
[elogind.git] / etc / udev / debian / udev.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 # %e the smallest number for that name which does not matches an existing node
7 # %k the kernel name for the device
8 # %M the kernel major number for the device
9 # %m the kernel minor number for the device
10 # %b the bus id for the device
11 # %c the string returned by the PROGRAM
12 # %s{filename} the content of a sysfs attribute
13 # %% the '%' char itself
14 #
15
16 # workaround for devices which do not report media changes
17 BUS=="ide", KERNEL=="hd[a-z]", SYSFS{removable}=="1", \
18         ENV{ID_MODEL}=="IOMEGA_ZIP*",   NAME="%k", OPTIONS+="all_partitions"
19
20 # SCSI devices
21 BUS=="scsi", KERNEL=="sr[0-9]*",        NAME="scd%n", SYMLINK+="sr%n"
22
23 # USB devices
24 BUS=="usb", KERNEL=="auer[0-9]*",       NAME="usb/%k"
25 BUS=="usb", KERNEL=="cpad[0-9]*",       NAME="usb/%k"
26 BUS=="usb", KERNEL=="dabusb*",          NAME="usb/%k"
27 BUS=="usb", KERNEL=="hiddev*",          NAME="usb/%k"
28 BUS=="usb", KERNEL=="legousbtower*",    NAME="usb/%k"
29 BUS=="usb", KERNEL=="lp[0-9]*",         NAME="usb/%k"
30 BUS=="usb", KERNEL=="ttyUSB*", SYSFS{product}=="Palm Handheld*", \
31                                         SYMLINK+="pilot"
32
33 # usbfs-like devices
34 SUBSYSTEM=="usb_device",        PROGRAM="/bin/sh -c 'K=%k; K=$${K#usbdev}; B=$${K%%%%.*}; D=$${K#*.}; echo bus/usb/$$B/$$D'", \
35                                 NAME="%c"
36
37 # serial devices
38 KERNEL=="capi",                 NAME="capi20", SYMLINK+="isdn/capi20"
39 KERNEL=="capi[0-9]*",           NAME="capi/%n"
40
41 # video devices
42 KERNEL=="dvb*",                 PROGRAM="/bin/sh -c 'K=%k; K=$${K#dvb}; A=$${K%%%%.*}; D=$${K#*.}; echo dvb/adapter$$A/$$D'", \
43                                 NAME="%c"
44 KERNEL=="card[0-9]*",           NAME="dri/%k"
45
46 # misc devices
47 KERNEL=="hw_random",            NAME="hwrng"
48 KERNEL=="tun",                  NAME="net/%k"
49
50 KERNEL=="cdemu[0-9]*",          NAME="cdemu/%n"
51 KERNEL=="pktcdvd[0-9]*",        NAME="pktcdvd/%n"
52 KERNEL=="pktcdvd",              NAME="pktcdvd/control"
53
54 KERNEL=="cpu[0-9]*",            NAME="cpu/%n/cpuid"
55 KERNEL=="msr[0-9]*",            NAME="cpu/%n/msr"
56 KERNEL=="microcode",            NAME="cpu/microcode"
57
58 KERNEL=="umad*",                NAME="infiniband/%k"
59 KERNEL=="issm*",                NAME="infiniband/%k"
60 KERNEL=="uverbs*",              NAME="infiniband/%k"
61 KERNEL=="ucm*",                 NAME="infiniband/%k"
62
63 # ALSA devices
64 KERNEL=="controlC[0-9]*",       NAME="snd/%k"
65 KERNEL=="hwC[D0-9]*",           NAME="snd/%k"
66 KERNEL=="pcmC[D0-9cp]*",        NAME="snd/%k"
67 KERNEL=="midiC[D0-9]*",         NAME="snd/%k"
68 KERNEL=="timer",                NAME="snd/%k"
69 KERNEL=="seq",                  NAME="snd/%k"
70
71 # ieee1394 devices       
72 KERNEL=="dv1394*",              NAME="dv1394/%n"
73 KERNEL=="video1394*",           NAME="video1394/%n"
74
75 # input devices
76 KERNEL=="mice",                 NAME="input/%k"
77 KERNEL=="mouse[0-9]*",          NAME="input/%k"
78 KERNEL=="event[0-9]*",          NAME="input/%k"
79 KERNEL=="js[0-9]*",             NAME="input/%k"
80 KERNEL=="ts[0-9]*",             NAME="input/%k"
81 KERNEL=="uinput",               NAME="input/%k"
82
83 # Zaptel
84 KERNEL=="zapctl",               NAME="zap/ctl"
85 KERNEL=="zaptimer",             NAME="zap/timer"
86 KERNEL=="zapchannel",           NAME="zap/channel"
87 KERNEL=="zappseudo",            NAME="zap/pseudo"
88 KERNEL=="zap[0-9]*",            NAME="zap/%n"
89
90 # AOE character devices
91 SUBSYSTEM=="aoe", KERNEL=="discover",   NAME="etherd/%k"
92 SUBSYSTEM=="aoe", KERNEL=="err",        NAME="etherd/%k"
93 SUBSYSTEM=="aoe", KERNEL=="interfaces", NAME="etherd/%k"
94
95 # device mapper creates its own device nodes, so ignore these
96 KERNEL=="dm-[0-9]*",            NAME=""
97 KERNEL=="device-mapper",        NAME="mapper/control"
98