aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--share/man/man5/Makefile2
-rw-r--r--share/man/man5/devfs.conf.5139
-rw-r--r--share/man/man5/devfs.rules.592
3 files changed, 233 insertions, 0 deletions
diff --git a/share/man/man5/Makefile b/share/man/man5/Makefile
index 14b9333975f4..be3af326c00c 100644
--- a/share/man/man5/Makefile
+++ b/share/man/man5/Makefile
@@ -9,6 +9,8 @@ MAN= acct.5 \
config.5 \
core.5 \
devfs.5 \
+ devfs.conf.5 \
+ devfs.rules.5 \
device.hints.5 \
dir.5 \
disktab.5 \
diff --git a/share/man/man5/devfs.conf.5 b/share/man/man5/devfs.conf.5
new file mode 100644
index 000000000000..4b1acdc44ee0
--- /dev/null
+++ b/share/man/man5/devfs.conf.5
@@ -0,0 +1,139 @@
+.\" Copyright (c) 2004 Roland Smith <rsmith@xs4all.nl>
+.\" All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\" notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\" notice, this list of conditions and the following disclaimer in the
+.\" documentation and/or other materials provided with the distribution.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\" $FreeBSD$
+.\"
+.Dd May 17, 2005
+.Dt DEVFS.CONF 5
+.Os
+.Sh NAME
+.Nm devfs.conf
+.Nd boot-time devfs configuration information
+.Sh DESCRIPTION
+The
+.Nm
+file provides an easy way to set ownership and permissions, or create
+links for devices available at boot.
+.Pp
+It does not work for devices plugged in and out after the system is up
+and running, e.g.\& USB devices.
+See
+.Xr devfs.rules 5
+for setting ownership and permissions for all device nodes, and
+.Xr usbd.conf 5
+for actions to be taken when USB devices are attached or detached.
+.Pp
+Lines starting with a hash sign
+.Pq Ql #
+and empty lines are ignored.
+The lines that specify
+.Nm
+rules consist of three parameters separated by whitespace:
+.Bl -tag -width indent
+.It Li action
+The action to take for the device.
+The action names are only significant to the first unique character.
+.It Li devname
+The name of the device created by
+.Xr devfs 5
+.It Li arg
+The argument of the
+.Dq Li action
+.El
+.Pp
+The actions currently supported are:
+.Bl -tag -width indent
+.It Li link
+This action creates a symbolic link named
+.Dq Li arg
+that points to
+Dq Li devname ,
+the name of the device created by
+.Xr devfs 5 .
+.It Li own
+This action changes the ownership of
+.Dq Li devname .
+The
+.Dq Li arg
+parameter must be in the form of an
+.Li "owner:group"
+pair, in the same format used by
+.Xr chown 8 .
+.It Li perm
+This action changes the permissions of
+.Dq Li devname .
+The
+.Dq Li arg
+paramater must be a
+.Pa mode
+as explained in
+.Xr chmod 1 .
+.El
+.Sh EXAMPLES
+To create a
+.Pa /dev/cdrom
+link that points to the first
+.Xr SCSI 4
+or
+.Xr atapicam 4
+CD-ROM,
+the following may be added to
+.Nm :
+.Bd -literal -offset indent
+link cd0 cdrom
+.Ed
+.Pp
+Similarly, to link
+.Pa /dev/cdrom
+to the first ATAPI CD-ROM device, the following action may be used:
+.Bd -literal -offset indent
+link acd0 cdrom
+.Ed
+.Pp
+To set the owner of a device, the
+.Dq Li own
+action may be specified:
+.Bd -literal -offset indent
+own cd0 root:cdrom
+.Ed
+.Pp
+To set the permissions of a device, a
+.Dq Li perm
+action should be used:
+.Bd -literal -offset indent
+perm cd0 0660
+.Ed
+.Sh FILES
+.Bl -tag -compact
+.It Pa /etc/devfs.conf
+.It Pa /usr/share/examples/etc/devfs.conf
+.El
+.Sh SEE ALSO
+.Xr chmod 1 ,
+.Xr devfs 5 ,
+.Xr devfs.rules 5 ,
+.Xr usbd.conf 5 ,
+.Xr chown 8
+.Sh AUTHORS
+.An "Roland Smith" Aq rsmith@xs4all.nl
diff --git a/share/man/man5/devfs.rules.5 b/share/man/man5/devfs.rules.5
new file mode 100644
index 000000000000..7d07a584d246
--- /dev/null
+++ b/share/man/man5/devfs.rules.5
@@ -0,0 +1,92 @@
+.\" Copyright (c) 2004 Roland Smith <rsmith@xs4all.nl>
+.\" All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\" notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\" notice, this list of conditions and the following disclaimer in the
+.\" documentation and/or other materials provided with the distribution.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\" $FreeBSD$
+.\"
+.Dd May 17, 2005
+.Dt DEVFS.RULES 5
+.Os
+.Sh NAME
+.Nm devfs.rules
+.Nd devfs configuration information
+.Sh DESCRIPTION
+The
+.Nm
+file provides an easy way to create and apply
+.Xr devfs 8
+rules, even for devices that are not available at boot.
+.Pp
+For devices available at boot, see
+.Xr devfs.conf 5 .
+.Pp
+The format of this file is simple.
+Empty lines and lines beginning with a hash sign
+.Pq Ql #
+are ignored.
+A line between brackets denotes the start of a ruleset.
+In the brackets should be the name of the ruleset and its number,
+separated by an equal sign.
+.Pp
+Other lines are rule specifications as documented in
+.Xr devfs 8 ,
+in the section
+.Dq "Rule Specification" .
+These lines are prepended with
+.Dq Li rule
+and are passed to
+.Xr devfs 8
+by the startup scripts of the system.
+It is important to put path elements that contain
+.Xr glob 3
+special characters between quotes.
+.Sh EXAMPLES
+To make all the partitions of
+.Xr da 4
+devices readable and writable by their owner and the
+.Dq Li usb
+group, the following rule may be used:
+.Bd -literal -offset indent
+add path 'da*s*' mode 0660 group usb
+.Ed
+.Pp
+To make all the
+.Xr uscanner 4
+devices accessible to their owner and the
+.Dq Li usb
+group, a similar rule may be used:
+.Bd -literal -offset indent
+add path 'uscanner*' mode 0660 group usb
+.Ed
+.Sh FILES
+.Bl -tag -compact
+.It Pa /etc/devfs.rules
+.It Pa /etc/defaults/devfs.rules
+.El
+.Sh SEE ALSO
+.Xr glob 3 ,
+.Xr devfs 5 ,
+.Xr devfs.conf 5 ,
+.Xr devfs 8
+.Sh AUTHORS
+.An "Roland Smith" Aq rsmith@xs4all.nl