xref: /freebsd/share/man/man5/devfs.conf.5 (revision a03411e84728e9b267056fd31c7d1d9d1dc1b01e)
1.\" Copyright (c) 2004 Roland Smith <rsmith@xs4all.nl>
2.\" All rights reserved.
3.\"
4.\" Redistribution and use in source and binary forms, with or without
5.\" modification, are permitted provided that the following conditions
6.\" are met:
7.\" 1. Redistributions of source code must retain the above copyright
8.\"    notice, this list of conditions and the following disclaimer.
9.\" 2. Redistributions in binary form must reproduce the above copyright
10.\"    notice, this list of conditions and the following disclaimer in the
11.\"    documentation and/or other materials provided with the distribution.
12.\"
13.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
14.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
16.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
17.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
18.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
19.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
20.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
21.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
22.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
23.\" SUCH DAMAGE.
24.\"
25.Dd May 25, 2019
26.Dt DEVFS.CONF 5
27.Os
28.Sh NAME
29.Nm devfs.conf
30.Nd boot-time devfs configuration information
31.Sh DESCRIPTION
32The
33.Nm
34file provides an easy way to set ownership and permissions, or create
35links for devices available at boot.
36.Pp
37It does not work for devices plugged in and out after the system is up
38and running, e.g.\& USB devices.
39See
40.Xr devfs.rules 5
41for setting ownership and permissions for all device nodes, and
42.Xr devd.conf 5
43for actions to be taken when devices are attached or detached.
44.Pp
45Lines starting with a hash sign
46.Pq Ql #
47and empty lines are ignored.
48The lines that specify
49.Nm
50rules consist of three parameters separated by whitespace:
51.Bl -tag -width indent
52.It Ar action
53The action to take for the device.
54The action names are only significant to the first unique character.
55.It Ar devname
56The name of the device created by
57.Xr devfs 5 .
58.It Ar arg
59The argument of the
60.Ar action .
61.El
62.Pp
63The actions currently supported are:
64.Bl -tag -width indent
65.It Ic link
66This action creates a symbolic link named
67.Ar arg
68that points to
69.Ar devname ,
70the name of the device created by
71.Xr devfs 5 .
72.It Ic own
73This action changes the ownership of
74.Ar devname .
75The
76.Ar arg
77parameter must be in the form of an
78.Ar owner Ns : Ns Ar group
79pair, in the same format used by
80.Xr chown 8 .
81.It Ic perm
82This action changes the permissions of
83.Ar devname .
84The
85.Ar arg
86parameter must be a
87.Ar mode
88as explained in
89.Xr chmod 1 .
90.El
91.Sh FILES
92.Bl -tag -compact -width Pa
93.It Pa /etc/devfs.conf
94.It Pa /usr/share/examples/etc/devfs.conf
95.El
96.Sh EXAMPLES
97To create a
98.Pa /dev/cdrom
99link that points to the first CD-ROM,
100the following may be added to
101.Nm :
102.Bd -literal -offset indent
103link	cd0	cdrom
104.Ed
105.Pp
106To set the owner of a device, the
107.Ic own
108action may be specified:
109.Bd -literal -offset indent
110own	cd0	root:cdrom
111.Ed
112.Pp
113To set the permissions of a device, a
114.Ic perm
115action should be used:
116.Bd -literal -offset indent
117perm	cd0	0660
118.Ed
119.Sh SEE ALSO
120.Xr chmod 1 ,
121.Xr devd.conf 5 ,
122.Xr devfs 5 ,
123.Xr devfs.rules 5 ,
124.Xr chown 8
125.Sh AUTHORS
126This manual page was written by
127.An Roland Smith Aq Mt rsmith@xs4all.nl .
128