1devlinks(1M)            System Administration Commands            devlinks(1M)
2
3
4

NAME

6       devlinks  -  adds  /dev  entries  for miscellaneous devices and pseudo-
7       devices
8

SYNOPSIS

10       /usr/sbin/devlinks [-d] [-r rootdir] [-t table-file]
11
12

DESCRIPTION

14       devfsadm(1M) is now the preferred command for  /dev  and  /devices  and
15       should be used instead of devlinks.
16
17
18       devlinks  creates  symbolic  links  from the /dev directory tree to the
19       actual block- and character-special device  nodes  under  the  /devices
20       directory tree. The links are created according to specifications found
21       in the table-file (by default /etc/devlink.tab).
22
23
24       devlinks is called each time the system is reconfiguration-booted,  and
25       can only be run after drvconfig(1M) is run.
26
27
28       The  table-file  (normally /etc/devlink.tab) is an ASCII file, with one
29       line per record. Comment lines, which must  contain  a  hash  character
30       (`#') as their first character, are allowed. Each entry must contain at
31       least two fields, but may contain three fields. Fields are separated by
32       single TAB characters.
33
34
35       The fields are:
36
37       devfs-spec        Specification  of  devinfo nodes that will have links
38                         created for them. This specification consists of  one
39                         or  more  keyword-value  pairs,  where the keyword is
40                         separated from the value by an equal-sign (`='),  and
41                         keyword-value pairs are separated from one another by
42                         semicolons.
43
44                         The possible keywords are:
45
46                         type        The devinfo device type. Possible  values
47                                     are       specified      in      ddi_cre‐
48                                     ate_minor_node(9F)
49
50
51                         name        The name of the node. This is the portion
52                                     of  the  /devices  tree  entry  name that
53                                     occurs before the first `@' or `:'  char‐
54                                     acter.
55
56
57                         addr[n]     The  address portion of a node name. This
58                                     is the portion of a node name that occurs
59                                     between  the  `@' and the `:' characters.
60                                     It is possible that a  node  may  have  a
61                                     name  without  an  address part, which is
62                                     the case for many  of  the  pseudo-device
63                                     nodes.  If  a  number  is given after the
64                                     addr it specifies a match of a particular
65                                     comma-separated  subfield  of the address
66                                     field: addr1 matches the first  subfield,
67                                     addr2  matches  the  second,  and  so on.
68                                     addr0 is the same as addr and matches the
69                                     whole field.
70
71
72                         minor[n]    The  minor  portion  of a node name − the
73                                     portion of the name  after  the  `:'.  As
74                                     with addr above, a number after the minor
75                                     keyword specifies a subfield to match.
76
77                         Of these four specifications, only the type  specifi‐
78                         cation must always be present.
79
80
81       name              Specification  of  the  /dev links that correspond to
82                         the devinfo nodes.  This  field  allows  devlinks  to
83                         determine  matching /dev names for the /devices nodes
84                         it has found. The specification of  this  field  uses
85                         escape-sequences  to  allow  portions of the /devices
86                         name to be included in the /dev name, or to  allow  a
87                         counter  to  be  used  in  creating  node names. If a
88                         counter is used to create a name, the portion of  the
89                         name before the counter must be specified absolutely,
90                         and all names in the  /dev/-subdirectory  that  match
91                         (up  to  and including the counter) are considered to
92                         be subdevices of the same  device.  This  means  that
93                         they should all point to the same directory, name and
94                         address under the /devices/-tree
95
96                         The possible escape-sequences are:
97
98                         \D      Substitute the device-name (name) portion  of
99                                 the corresponding devinfo node-name.
100
101
102                         \An     Substitute  the  nth component of the address
103                                 component of the corresponding  devinfo  node
104                                 name. Sub-components are separated by commas,
105                                 and sub-component 0 is the whole address com‐
106                                 ponent.
107
108
109                         \Mn     Substitute the nth sub-component of the minor
110                                 component of the corresponding  devinfo  node
111                                 name. Sub-components are separated by commas,
112                                 and sub-component 0 is the whole minor compo‐
113                                 nent.
114
115
116                         \Nn     Substitute  the value of a 'counter' starting
117                                 at n. There can be only one counter for  each
118                                 dev-spec, and counter-values will be selected
119                                 so they are as low as possible while not col‐
120                                 liding with already-existing link names.
121
122                                 In a dev-spec the counter sequence should not
123                                 be followed by a digit, either explicitly  or
124                                 as a result of another escape-sequence expan‐
125                                 sion. If this occurs, it would not be  possi‐
126                                 ble to correctly match already-existing links
127                                 to their counter entries, since it would  not
128                                 be   possible   to  unambiguously  parse  the
129                                 already-existing /dev-name.
130
131
132
133       extra-dev-link    Optional specification of an  extra  /dev  link  that
134                         points  to  the initial /dev link (specified in field
135                         2). This field may contain a counter  escape-sequence
136                         (as  described  for  the  dev-spec field) but may not
137                         contain any of the other  escape-sequences.  It  pro‐
138                         vides  a way to specify an alias of a particular /dev
139                         name.
140
141

OPTIONS

143       The following options are supported:
144
145       -d               Debugging mode − print out all  devinfo  nodes  found,
146                        and  indicate  what links would be created, but do not
147                        do anything.
148
149
150       -r rootdir       Use rootdir as the  root  of  the  /dev  and  /devices
151                        directories under which the device nodes and links are
152                        created. Changing the root directory does  not  change
153                        the  location  of  the /etc/devlink.tab default table,
154                        nor is the root directory applied to the filename sup‐
155                        plied to the -t option.
156
157
158       -t table-file    Set  the  table  file  used by devlinks to specify the
159                        links that must be created.  If  this  option  is  not
160                        given,  /etc/devlink.tab  is used. This option gives a
161                        way to instruct devlinks just to perform a  particular
162                        piece   of  work,  since  just  the  links-types  that
163                        devlinks is supposed to create can be specified  in  a
164                        command-file and fed to devlinks.
165
166

ERRORS

168       If  devlinks  finds  an  error  in a line of the table-file it prints a
169       warning message on its standard output and goes on to the next line  in
170       the  table-file  without performing any of the actions specified by the
171       erroneous rule.
172
173
174       If it cannot create a link for some filesystem-related reason it prints
175       an error-message and continues with the current rule.
176
177
178       If it cannot read necessary data it prints an error message and contin‐
179       ues with the next table-file line.
180

EXAMPLES

182       Example 1 Using the /etc/devlink.tab Fields
183
184
185       The following are examples of the /etc/devlink.tab fields:
186
187
188         type=pseudo;name=win     win\M0
189         type=ddi_display    framebuffer/\M0     fb\N0
190
191
192
193       The first example states that all devices of type pseudo  with  a  name
194       component of win will be linked to /dev/winx, where x is the minor-com‐
195       ponent of the devinfo-name (this is always a  single-digit  number  for
196       the win driver).
197
198
199
200       The  second  example  states that all devinfo nodes of type ddi_display
201       will be linked to entries under the  /dev/framebuffer  directory,  with
202       names  identical to the entire minor component of the /devices name. In
203       addition an extra link will be created pointing from  /dev/fbn  to  the
204       entry  under /dev/framebuffer. This entry will use a counter to end the
205       name.
206
207

FILES

209       /dev                entries for the miscellaneous devices  for  general
210                           use
211
212
213       /devices            device nodes
214
215
216       /etc/devlink.tab    the default rule-file
217
218

ATTRIBUTES

220       See attributes(5) for descriptions of the following attributes:
221
222
223
224
225       ┌─────────────────────────────┬─────────────────────────────┐
226       │      ATTRIBUTE TYPE         │      ATTRIBUTE VALUE        │
227       ├─────────────────────────────┼─────────────────────────────┤
228       │Availability                 │SUNWcsu                      │
229       └─────────────────────────────┴─────────────────────────────┘
230

SEE ALSO

232       devfsadm(1M), attributes(5), devfs(7FS), ddi_create_minor_node(9F)
233

BUGS

235       It  is  very  easy  to construct mutually-contradictory link specifica‐
236       tions, or specifications that can never be matched.  The  program  does
237       not check for these conditions.
238
239
240
241SunOS 5.11                        15 Jul 2002                     devlinks(1M)
Impressum