chiark / gitweb /
79b74bf659736f850d368aac0e9a682d0068728a
[elogind.git] / udev.8
1 .TH UDEV 8 "October 2003" "" "Linux Administrator's Manual"
2 .SH NAME
3 udev \- Linux configurable dynamic device naming support
4 .SH SYNOPSIS
5 .BI udev " hotplug-subsystem"
6 .SH "DESCRIPTION"
7 .B udev
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.
11 .P
12 As part of the
13 .B hotplug
14 subsystem,
15 .B udev
16 is executed if a kernel device is added or removed from the system.
17 On device creation,
18 .B udev
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.
23 .B udev
24 maintains a database for devices present on the system.
25 .br
26 On device removal,
27 .B udev
28 queries the internal database for the name of the device file to be deleted.
29 .SH "CONFIGURATION"
30 .B udev
31 expects its configuration at
32 .I /etc/udev/udev.config.
33 The file consists of a set of lines. All empty lines and
34 lines beginning with a '#' will be ignored.
35 .br
36 Every line defines the mapping between device attributes and the device file
37 name. It starts with a keyword defining the method used to match, followed by
38 one ore more keys to compare and the filename for the device. If no matching
39 configuration is found, the default kernel device name is used.
40 .P
41 The line format is:
42 .RS
43 .sp
44 .I method, key,[key,...] name
45 .sp
46 .RE
47 where valid methods with corresponding keys are:
48 .TP
49 .B LABEL
50 device label or serial number, like USB serial number, SCSI UUID or
51 file system label
52 .br
53 keys: \fBBUS\fP, \fIsysfs_attribute\fP
54 .TP
55 .B NUMBER
56 device number on the bus, like PCI bus id
57 .br
58 keys: \fBBUS\fP, \fBID\fP
59 .TP
60 .B TOPOLOGY
61 device position on bus, like physical port of USB device
62 .br
63 keys: \fBBUS\fP, \fBPLACE\fP
64 .TP
65 .B REPLACE
66 string replacement of the kernel device name
67 .br
68 key: \fBKERNEL_NAME\fP
69 .TP
70 .B CALLOUT
71 calling external program, that returns a string to match
72 .br
73 keys: \fBBUS\fP, \fBPROGRAM\fP, \fBID\fP
74 .P
75 A sample \fIudev.conf\fP might look like this:
76 .sp
77 .nf
78 # USB printer to be called lp_color
79 LABEL, BUS="usb", serial="W09090207101241330", NAME="lp_color"
80
81 # sound card with PCI bus id 00:0b.0 to be called dsp
82 NUMBER, BUS="pci", ID="00:0b.0", NAME="dsp"
83
84 # USB mouse at third port of the second hub to be called mouse1
85 TOPOLOGY, BUS="usb", PLACE="2.3", NAME="mouse1"
86
87 # ttyUSB1 should always be called pda
88 REPLACE, KERNEL="ttyUSB1", NAME="pda"
89
90 # if /sbin/scsi_id returns "OEM 0815" device will be called disk1
91 CALLOUT, PROGRAM="/sbin/scsi_id" BUS="scsi", ID="OEM 0815" NAME="disk1"
92 .fi
93 .P
94 Permissions and ownership for the created device files may specified at
95 .I /etc/udev/udev.permissions.
96 The file consists of a set of lines. All empty lines and
97 lines beginning with a '#' will be ignored.
98 .br
99 Every line lists a device name followed by owner, group and permission mode. All values are separated by colons.
100 .sp
101 A sample \fIudev.permissions\fP might look like this:
102 .sp
103 .nf
104 #name:user:group:mode
105 ttyUSB1:root:uucp:0666
106 dsp1:::0666
107 .fi
108
109 .SH "FILES"
110 .nf
111 .ft B
112 .ft
113 /sbin/udev                           udev program
114 /etc/udev/*                          udev config and database files
115 /etc/hotplug.d/default/udev.hotplug  hotplug symlink to udev program
116 .fi
117 .LP
118 .SH "SEE ALSO"
119 .BR hotplug (8)
120 .PP
121 The
122 .I http://linux-hotplug.sourceforge.net/
123 web site.
124 .SH AUTHORS
125 .B udev
126 was developed by Greg Kroah-Hartman <greg@kroah.com> with much help from
127 Dan Stekloff <dsteklof@us.ibm.com> and many others.