1 # /etc/udev/udev.rules: device naming rules for udev
2 # $Header: /home/cvsroot/gentoo-x86/sys-fs/udev/files/udev.rules,v 1.1 2003/12/26 23:32:44 azarah Exp $
4 # There are a number of modifiers that are allowed to be used in the NAME or PROGRAM fields.
5 # 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 return value of the external PROGRAM (note, this doesn't work within
13 # the PROGRAM field for the obvious reason.)
14 # %D - use the devfs style disk name for this device.
15 # For partitions, this will result in 'part%n'
16 # If this is not a partition, it will result in 'disc'
19 ###########################################################
21 # Add your own rules here
23 ###########################################################
25 # Looking for scsi bus id 42:0:0:1
26 BUS="scsi", PROGRAM="/bin/echo -n test-%b", RESULT="test-42:0:0:1", NAME="%c"
29 BUS="usb", SYSFS_vendor="FUJIFILM", SYSFS_model="M100", NAME="camera%n"
31 # USB Epson printer to be called lp_epson
32 BUS="usb", SYSFS_serial="HXOLL0012202323480", NAME="lp_epson"
34 # USB HP printer to be called lp_hp
35 BUS="usb", SYSFS_serial="W09090207101241330", NAME="lp_hp"
37 # sound card with PCI bus id 00:0b.0 to be the first sound card
38 BUS="pci", ID="00:0b.0", NAME="dsp"
40 # sound card with PCI bus id 00:07.1 to be the second sound card
41 BUS="pci", ID="00:07.1", NAME="dsp1"
43 # USB mouse plugged into the third port of the first hub to be called mouse0
44 BUS="usb", PLACE="1.3", NAME="mouse0"
46 # USB tablet plugged into the third port of the second hub to be called mouse1
47 BUS="usb", PLACE="2.3", NAME="mouse1"
48 BUS="usb", PLACE="2.4", NAME="mouse2"
50 # ttyUSB1 should always be called visor
51 KERNEL="ttyUSB1", NAME="visor"
52 KERNEL="ttyUSB0", NAME="pl2303"
55 ###########################################################
57 # For devfs similar /dev layout (neater)
59 ###########################################################
61 # devfs-names for ide-devices (uncomment only one)
62 # /dev/ide/.../{disc,cd} and /dev/{cdroms,discs}/* type names
63 BUS="ide", PROGRAM="/etc/udev/scripts/ide-devfs.sh %k %b %n", RESULT="hd*", NAME="%1c", SYMLINK="%2c %3c"
66 KERNEL="fb[0-9]*", NAME="fb/%n", SYMLINK="%k"
69 KERNEL="loop[0-9]*", NAME="loop/%n", SYMLINK="%k"
72 KERNEL="md[0-9]*", NAME="md/%n", SYMLINK="%k"
75 KERNEL="pty[p-za-e][0-9a-f]*", NAME="pty/m%n", SYMLINK="%k"
76 KERNEL="tty[p-za-e][0-9a-f]*", NAME="tty/s%n", SYMLINK="%k"
79 KERNEL="ram[0-9]*", NAME="rd/%n", SYMLINK="%k"
82 KERNEL="tty[0-9]*", NAME="vc/%n", SYMLINK="%k"
83 KERNEL="ttyS[0-9]*", NAME="tts/%n", SYMLINK="%k"
84 KERNEL="ttyUSB[0-9]*", NAME="tts/USB%n"
87 KERNEL="vcs", NAME="vcc/0", SYMLINK="%k"
88 KERNEL="vcs[0-9]*", NAME="vcc/%n", SYMLINK="%k"
89 KERNEL="vcsa", NAME="vcc/a0", SYMLINK="%k"
90 KERNEL="vcsa[0-9]*", NAME="vcc/a%n", SYMLINK="%k"
93 KERNEL="video[0-9]*", NAME="v4l/video%n"
94 KERNEL="radio[0-9]*", NAME="v4l/radio%n"
95 KERNEL="vbi[0-9]*", NAME="v4l/vbi%n"
96 KERNEL="vtx[0-9]*", NAME="v4l/vtx%n"
98 # dm devices (ignore them)
99 KERNEL="dm-[0-9]*", NAME=""
102 KERNEL="i2c-[0-9]*", NAME="i2c/%n", SYMLINK="%k"
105 KERNEL="loop[0-9]*", NAME="loop/%n", SYMLINK="%k"
107 # framebuffer devices
108 KERNEL="fb[0-9]*", NAME="fb/%n", SYMLINK="%k"
111 KERNEL="rtc", NAME="misc/%k", SYMLINK="%k"
112 KERNEL="psaux", NAME="misc/%k", SYMLINK="%k"
115 KERNEL="controlC[0-9]*", NAME="snd/%k"
116 KERNEL="hw[CD0-9]*", NAME="snd/%k"
117 KERNEL="pcm[CD0-9cp]*", NAME="snd/%k"
118 KERNEL="midi[CD0-9]*", NAME="snd/%k"
119 KERNEL="timer", NAME="snd/%k"
120 KERNEL="seq", NAME="snd/%k"