chiark / gitweb /
a464b6ba57a02ea55a3139b811415c6b529ed0eb
[elogind.git] / etc / udev / udev.rules.examples
1 # There are a number of modifiers that are allowed to be used in some of the
2 # fields.  See the udev man page for a full description of them.
3 #
4 #
5 # These are some example rules that you could use to name your devices.
6 #
7 # If anyone has any other examples that they think should be in here for others
8 # to use, please send them to greg@kroah.com
9 #
10
11 # Looking for scsi bus id 42:0:0:1
12 BUS="scsi", PROGRAM="/bin/echo -n test-%b", RESULT="test-42:0:0:1", NAME="%c"
13
14 # A usb camera.
15 BUS="usb", SYSFS{vendor}="FUJIFILM", SYSFS{model}="M100", NAME="camera%n"
16
17 # USB Epson printer to be called lp_epson
18 BUS="usb", SYSFS_serial="HXOLL0012202323480", NAME="lp_epson"
19
20 # USB HP printer to be called lp_hp
21 BUS="usb", SYSFS{serial}="W09090207101241330", NAME="lp_hp"
22
23 # sound card with PCI bus id 00:0b.0 to be the first sound card
24 BUS="pci", ID="00:0b.0", NAME="dsp"
25
26 # sound card with PCI bus id 00:07.1 to be the second sound card
27 BUS="pci", ID="00:07.1", NAME="dsp1" 
28
29 # USB mouse plugged into the third port of the first hub to be called mouse0
30 BUS="usb", PLACE="1.3", NAME="mouse0"
31
32 # USB tablet plugged into the third port of the second hub to be called mouse1
33 BUS="usb", PLACE="2.3", NAME="mouse1"
34 BUS="usb", PLACE="2.4", NAME="mouse2"
35
36 # ttyUSB1 should always be called visor
37 KERNEL="ttyUSB1", NAME="visor"
38 KERNEL="ttyUSB0", NAME="pl2303"
39
40 # a devfs like way to name some tty devices
41 KERNEL="ttyS*", NAME="tts/%n"
42 KERNEL="tty*", NAME="vc/%n"
43
44 # if this is a ide cdrom, name it the default name, and create a symlink to cdrom
45 BUS="ide", KERNEL="*[!0-9]", PROGRAM="/bin/cat /proc/ide/%k/media", RESULT="cdrom", NAME="%k", SYMLINK="cdrom"
46
47 # create a symlink named after the device map name
48 # note devmap_name comes with extras/multipath
49 KERNEL="dm-[0-9]*", PROGRAM="/sbin/devmap_name %M %m", NAME="%k", SYMLINK="%c"
50
51 # DRI devices always go into a subdirectory (as per the LSB spec)
52 KERNEL="card*", NAME="dri/card%n"
53
54 # create all 15 partitions of a USB flash card reader
55 # note the trailing spaces in the attribute, use udevinfo(8) to examine your device
56 BUS="scsi", SYSFS{model}="CF/MD           ", NAME{all_partitions}="compactflash"
57
58 # alsa devices
59 KERNEL="controlC[0-9]*", NAME="snd/%k"
60 KERNEL="hw[CD0-9]*",     NAME="snd/%k"
61 KERNEL="pcm[CD0-9cp]*",  NAME="snd/%k"
62 KERNEL="midi[CD0-9]*",   NAME="snd/%k"
63 KERNEL="timer",          NAME="snd/%k"
64 KERNEL="seq",            NAME="snd/%k"
65
66 # input devices
67 KERNEL="mice",          NAME="input/%k"
68 KERNEL="mouse*",        NAME="input/%k"
69 KERNEL="event*",        NAME="input/%k"
70 KERNEL="js*",           NAME="input/%k"
71 KERNEL="ts*",           NAME="input/%k"
72