1 .TH UDEV 8 "October 2003" "" "Linux Administrator's Manual"
3 udev \- Linux configurable dynamic device naming support
5 .BI udev " hotplug-subsystem"
8 creates or removes device node files usually located in the /dev directory.
9 Its goal is to provide a dynamic device directory that contains only the files
10 for devices that are actually present.
16 is executed if a kernel device is added or removed from the system.
19 reads the sysfs directory of the given device to collect device attributes
20 like label, serial number or bus device number.
21 These attributes are treated as a key
22 to determine a unique name for device file creation.
24 maintains a database for devices present on the system.
28 queries the internal database for the name of the device file to be deleted.
30 All udev configuration files consist of a set of lines of text. All empty
31 lines, and lines beginning with a '#' will be ignored.
35 expects its main configuration file at
36 .I /etc/udev/udev.conf.
37 The file consists of a set of variables and values that allow the user to
38 override default udev values. The current set of variables that can be
39 overridden in this file is:
42 This is the where in the filesystem to place the device nodes. The default
47 The name and location of the udev database. The default value for this is
51 This is the location of the udev rules file. The default value for this is
52 .I /etc/udev/udev.rules
55 This is the location of the udev permission file. The default value for this is
56 .I /etc/udev/udev.permissions
59 This is the default mode for all nodes that have no explicit match in the
60 permissions file. The default value for this is
64 A sample \fIudev.conf\fP might look like this:
67 # udev_root - where in the filesystem to place the device nodes
70 # udev_db - The name and location of the udev database.
71 udev_db="/udev/.udev.tdb"
73 # udev_rules - The name and location of the udev rules file
74 udev_rules="/etc/udev/udev.rules"
76 # udev_permissions - The name and location of the udev permission file
77 udev_permissions="/etc/udev/udev.permissions"
79 # default_mode - set the default mode for all nodes that have no
80 # explicit match in the permissions file
84 The rules for udev to use when naming devices may specified at
85 .I /etc/udev/udev.rules
89 .I /etc/udev/udev.conf
92 Every line in the rules file define the mapping between device attributes and
93 the device file name. It starts with a keyword defining the method used to
94 match, followed by one ore more keys to compare and the filename for the
95 device. If no matching configuration is found, the default kernel device name
101 .I method, key,[key,...] name
104 where valid methods with corresponding keys are:
107 calling external program, that returns a string to match
109 keys: \fBBUS\fP, \fBPROGRAM\fP, \fBID\fP
112 device label or serial number, like USB serial number, SCSI UUID or
115 keys: \fBBUS\fP, \fIsysfs_attribute\fP
118 device number on the bus, like PCI bus id
120 keys: \fBBUS\fP, \fBID\fP
123 device position on bus, like physical port of USB device
125 keys: \fBBUS\fP, \fBPLACE\fP
128 string replacement of the kernel device name
130 key: \fBKERNEL_NAME\fP
132 The methods are applied in the following order:
147 fields support simple printf-like string subtitution:
151 the "kernel number" of the device
152 for example, 'sda3' has a "kernel number" of '3'
155 the kernel major number for the device
158 the kernel minor number for the device
161 the bus id for the device
164 the CALLOUT program returned string
165 (this does not work within the PROGRAM field for the obvious reason.)
168 Use the devfs style disk name for this device.
169 For partitions, this will result in 'part%n'
170 If this is not a partition, it will result in 'disk'
173 A sample \fIudev.rules\fP might look like this:
176 # if /sbin/scsi_id returns "OEM 0815" device will be called disk1
177 CALLOUT, BUS="scsi", PROGRAM="/sbin/scsi_id", ID="OEM 0815", NAME="disk1"
179 # USB printer to be called lp_color
180 LABEL, BUS="usb", serial="W09090207101241330", NAME="lp_color"
182 # sound card with PCI bus id 00:0b.0 to be called dsp
183 NUMBER, BUS="pci", ID="00:0b.0", NAME="dsp"
185 # USB mouse at third port of the second hub to be called mouse1
186 TOPOLOGY, BUS="usb", PLACE="2.3", NAME="mouse1"
188 # ttyUSB1 should always be called pda
189 REPLACE, KERNEL="ttyUSB1", NAME="pda"
191 # USB webcams to be called webcam0, webcam1, ...
192 LABEL, BUS="usb", model="WebCam Version 3", NAME="webcam%n"
195 Permissions and ownership for the created device files may specified at
196 .I /etc/udev/udev.permissions
200 .I /etc/udev/udev.conf
202 The file consists of a set of lines. All empty lines and
203 lines beginning with a '#' will be ignored.
205 Every line lists a device name followed by owner, group and permission
206 mode. All values are separated by colons. The name field may end with a
207 wildcard to apply the values to a whole class of devices.
211 was built using klibc or is used before the user database is accessible (e.g.
213 ), only numeric owner and group values may be used.
215 A sample \fIudev.permissions\fP might look like this:
218 #name:user:group:mode
219 input/*:root:root:644
221 video*:root:video:0660
228 /sbin/udev udev program
229 /etc/udev/* udev config files
230 /etc/hotplug.d/default/udev.hotplug hotplug symlink to udev program
237 .I http://linux-hotplug.sourceforge.net/
241 was developed by Greg Kroah-Hartman <greg@kroah.com> with much help from
242 Dan Stekloff <dsteklof@us.ibm.com> and many others.