chiark / gitweb /
[PATCH] udev - switch SYSFS_file to SYSFS{file}
[elogind.git] / etc / udev / udev.rules.gentoo
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 $
3 #
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 #
15
16 ###########################################################
17 #
18 # Add your own rules here
19 #
20 ###########################################################
21
22 # Looking for scsi bus id 42:0:0:1
23 BUS="scsi", PROGRAM="/bin/echo -n test-%b", RESULT="test-42:0:0:1", NAME="%c"
24
25 # A usb camera.
26 BUS="usb", SYSFS{vendor}="FUJIFILM", SYSFS{model}="M100", NAME="camera%n"
27
28 # USB Epson printer to be called lp_epson
29 BUS="usb", SYSFS{serial}="HXOLL0012202323480", NAME="lp_epson"
30
31 # USB HP printer to be called lp_hp
32 BUS="usb", SYSFS{serial}="W09090207101241330", NAME="lp_hp"
33
34 # sound card with PCI bus id 00:0b.0 to be the first sound card
35 BUS="pci", ID="00:0b.0", NAME="dsp"
36
37 # sound card with PCI bus id 00:07.1 to be the second sound card
38 BUS="pci", ID="00:07.1", NAME="dsp1"
39
40 # USB mouse plugged into the third port of the first hub to be called mouse0
41 BUS="usb", PLACE="1.3", NAME="mouse0"
42
43 # USB tablet plugged into the third port of the second hub to be called mouse1
44 BUS="usb", PLACE="2.3", NAME="mouse1"
45 BUS="usb", PLACE="2.4", NAME="mouse2"
46
47 # ttyUSB1 should always be called visor
48 KERNEL="ttyUSB1", NAME="visor"
49 KERNEL="ttyUSB0", NAME="pl2303"
50
51
52 ###########################################################
53 #
54 # For devfs similar /dev layout (neater)
55 #
56 ###########################################################
57
58 # devfs-names for ide-devices (uncomment only one)
59 #  /dev/ide/.../{disc,cd} and /dev/{cdroms,discs}/* type names
60 BUS="ide", PROGRAM="/etc/udev/scripts/ide-devfs.sh %k %b %n", RESULT="hd*", NAME="%1c", SYMLINK="%2c %3c"
61  
62 # fb devices
63 KERNEL="fb[0-9]*", NAME="fb/%n", SYMLINK="%k"
64
65 # loop devices
66 KERNEL="loop[0-9]*", NAME="loop/%n", SYMLINK="%k"
67
68 # md block devices
69 KERNEL="md[0-9]*", NAME="md/%n", SYMLINK="%k"
70
71 # pty devices
72 KERNEL="pty[p-za-e][0-9a-f]*", NAME="pty/m%n", SYMLINK="%k"
73 KERNEL="tty[p-za-e][0-9a-f]*", NAME="tty/s%n", SYMLINK="%k"
74
75 # ram devices
76 KERNEL="ram[0-9]*", NAME="rd/%n", SYMLINK="%k"
77
78 # tty devices
79 KERNEL="tty[0-9]*", NAME="vc/%n", SYMLINK="%k"
80 KERNEL="ttyS[0-9]*", NAME="tts/%n", SYMLINK="%k"
81 KERNEL="ttyUSB[0-9]*", NAME="tts/USB%n"
82
83 # vc devices
84 KERNEL="vcs",        NAME="vcc/0", SYMLINK="%k"
85 KERNEL="vcs[0-9]*",  NAME="vcc/%n", SYMLINK="%k"
86 KERNEL="vcsa",       NAME="vcc/a0", SYMLINK="%k"
87 KERNEL="vcsa[0-9]*", NAME="vcc/a%n", SYMLINK="%k"
88
89 # v4l devices
90 KERNEL="video[0-9]*", NAME="v4l/video%n"
91 KERNEL="radio[0-9]*", NAME="v4l/radio%n"
92 KERNEL="vbi[0-9]*",   NAME="v4l/vbi%n"
93 KERNEL="vtx[0-9]*",   NAME="v4l/vtx%n"
94
95 # dm devices (ignore them)
96 KERNEL="dm-[0-9]*", NAME=""
97
98 # i2c devices
99 KERNEL="i2c-[0-9]*", NAME="i2c/%n", SYMLINK="%k"
100
101 # loop devices
102 KERNEL="loop[0-9]*", NAME="loop/%n", SYMLINK="%k"
103
104 # framebuffer devices
105 KERNEL="fb[0-9]*", NAME="fb/%n", SYMLINK="%k"
106
107 # misc devices
108 KERNEL="rtc",   NAME="misc/%k", SYMLINK="%k"
109 KERNEL="psaux", NAME="misc/%k", SYMLINK="%k"
110
111 # alsa devices
112 KERNEL="controlC[0-9]*", NAME="snd/%k"
113 KERNEL="hw[CD0-9]*",     NAME="snd/%k"
114 KERNEL="pcm[CD0-9cp]*",  NAME="snd/%k"
115 KERNEL="midi[CD0-9]*",   NAME="snd/%k"
116 KERNEL="timer",          NAME="snd/%k"
117 KERNEL="seq",            NAME="snd/%k"
118