2007-03-03 09:53:41 +03:00
|
|
|
.\" $NetBSD: MAKEDEV.8.template,v 1.10 2007/03/03 06:53:41 apb Exp $
|
2001-04-16 12:08:19 +04:00
|
|
|
.\"
|
2003-10-25 00:26:57 +04:00
|
|
|
.\" Copyright (c) 2001, 2003 The NetBSD Foundation, Inc.
|
2001-04-16 12:08:19 +04:00
|
|
|
.\" All rights reserved.
|
|
|
|
.\"
|
|
|
|
.\" This code is derived from software contributed to The NetBSD Foundation
|
|
|
|
.\" by Thomas Klausner.
|
|
|
|
.\"
|
|
|
|
.\" 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.
|
|
|
|
.\" 3. All advertising materials mentioning features or use of this software
|
|
|
|
.\" must display the following acknowledgement:
|
|
|
|
.\" This product includes software developed by the NetBSD
|
|
|
|
.\" Foundation, Inc. and its contributors.
|
|
|
|
.\" 4. Neither the name of The NetBSD Foundation nor the names of its
|
|
|
|
.\" contributors may be used to endorse or promote products derived
|
|
|
|
.\" from this software without specific prior written permission.
|
|
|
|
.\"
|
|
|
|
.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. 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 FOUNDATION 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.
|
|
|
|
.\"
|
|
|
|
.Dd @@@DATE@@@
|
2003-10-25 00:26:57 +04:00
|
|
|
.Dt MAKEDEV 8
|
2001-04-16 12:08:19 +04:00
|
|
|
.Os
|
|
|
|
.Sh NAME
|
|
|
|
.Nm MAKEDEV
|
|
|
|
.Nd create system and device special files
|
|
|
|
.Sh SYNOPSIS
|
|
|
|
.Nm
|
2003-12-21 21:02:06 +03:00
|
|
|
.Op Fl fs
|
|
|
|
.Op Fl m Ar mknod
|
2001-04-16 12:08:19 +04:00
|
|
|
.Ar special Op Ar ...
|
2002-03-14 04:33:27 +03:00
|
|
|
.Pp
|
2001-04-16 12:08:19 +04:00
|
|
|
.Nm
|
2003-12-21 21:02:06 +03:00
|
|
|
.Op Fl fs
|
|
|
|
.Op Fl m Ar mknod
|
2001-04-16 12:08:19 +04:00
|
|
|
.Ar device Op Ar ...
|
|
|
|
.Sh DESCRIPTION
|
|
|
|
.Nm
|
|
|
|
is used to create system and device special files.
|
|
|
|
As arguments it takes the names of known devices, like
|
|
|
|
.Ar sd0 ,
|
|
|
|
or of special targets, like
|
|
|
|
.Pa all
|
|
|
|
or
|
|
|
|
.Pa std ,
|
2007-02-27 01:37:57 +03:00
|
|
|
which create a collection of device special files,
|
|
|
|
or
|
|
|
|
.Pa local ,
|
|
|
|
which invokes
|
|
|
|
.Xr MAKEDEV.local 8
|
|
|
|
with the
|
|
|
|
.Pa all
|
|
|
|
argument.
|
2001-04-16 12:08:19 +04:00
|
|
|
.Pp
|
|
|
|
The script is in
|
|
|
|
.Pa /dev/MAKEDEV
|
|
|
|
and must be called from the
|
|
|
|
.Pa /dev
|
|
|
|
directory.
|
2002-03-14 04:33:27 +03:00
|
|
|
For the creation of the devices,
|
|
|
|
.Xr mknod 8
|
|
|
|
is used, which can only be used for creating devices by the
|
|
|
|
super-user.
|
2003-12-21 21:02:06 +03:00
|
|
|
The
|
|
|
|
.Xr mknod 8
|
|
|
|
used can be overridden by the
|
|
|
|
.Fl m
|
|
|
|
flag.
|
|
|
|
.Pp
|
|
|
|
Supported options are:
|
|
|
|
.Bl -tag -width XmXmknodXX
|
|
|
|
.It Fl f
|
|
|
|
Force permissions to be updated on existing devices.
|
|
|
|
.It Fl m Ar mknod
|
|
|
|
Name of
|
|
|
|
.Xr mknod 8
|
|
|
|
program.
|
|
|
|
[Usually, $TOOL_MKNOD or mknod.]
|
|
|
|
.It Fl s
|
|
|
|
Generate
|
|
|
|
.Xr mtree 8
|
|
|
|
specfile instead of creating devices.
|
|
|
|
.El
|
2001-04-16 12:08:19 +04:00
|
|
|
.Pp
|
|
|
|
The special targets supported on
|
2003-10-25 00:26:57 +04:00
|
|
|
.Nx
|
2001-04-16 12:08:19 +04:00
|
|
|
are:
|
|
|
|
.Pp
|
|
|
|
@@@SPECIAL@@@
|
|
|
|
.Pp
|
|
|
|
Please note that any hash marks
|
|
|
|
.Pq Dq #
|
|
|
|
in the following list of supported device targets must be replaced by
|
|
|
|
digits when calling
|
2003-02-25 13:34:36 +03:00
|
|
|
.Nm :
|
2001-04-16 12:08:19 +04:00
|
|
|
.Pp
|
|
|
|
@@@DEVICES@@@
|
2007-03-03 09:53:41 +03:00
|
|
|
.Sh ENVIRONMENT
|
|
|
|
The following environment variables affect the execution of
|
|
|
|
.Nm :
|
|
|
|
.Pp
|
|
|
|
.Bl -tag -width indent
|
|
|
|
.It Ev MAKEDEV_AS_LIBRARY
|
|
|
|
If this is set, then
|
|
|
|
.Nm
|
|
|
|
will define several shell functions and then return,
|
|
|
|
ignoring all its command line options and arguments.
|
|
|
|
This is used to enable
|
|
|
|
.Xr MAKEDEV.local 8
|
|
|
|
to use the shell functions defined in
|
|
|
|
.Nm .
|
|
|
|
.El
|
2001-04-16 12:08:19 +04:00
|
|
|
.Sh FILES
|
2002-03-14 04:33:27 +03:00
|
|
|
.Bl -tag -width "/dev/MAKEDEV.local" -compact
|
2001-04-16 12:08:19 +04:00
|
|
|
.It Pa /dev
|
|
|
|
special device files directory
|
|
|
|
.It Pa /dev/MAKEDEV
|
|
|
|
script described in this man page
|
2002-03-14 04:33:27 +03:00
|
|
|
.It Pa /dev/MAKEDEV.local
|
2007-02-27 01:37:57 +03:00
|
|
|
script for site-specific devices
|
2001-04-16 12:08:19 +04:00
|
|
|
.El
|
2002-03-14 04:33:27 +03:00
|
|
|
.Sh DIAGNOSTICS
|
|
|
|
If the script reports an error that is difficult to understand,
|
|
|
|
you can get more debugging output by using
|
|
|
|
.Dl Ic sh Fl x Ar MAKEDEV Ar argument .
|
2001-04-16 12:08:19 +04:00
|
|
|
.Sh SEE ALSO
|
2005-06-20 17:25:23 +04:00
|
|
|
.Xr config 1 ,
|
2007-02-27 01:54:40 +03:00
|
|
|
.Xr pax 1 ,
|
2001-04-16 12:08:19 +04:00
|
|
|
.Xr intro 4 ,
|
2007-02-27 01:37:57 +03:00
|
|
|
.Xr MAKEDEV.local 8 ,
|
2007-02-27 01:54:40 +03:00
|
|
|
.Xr diskless 8 ,
|
|
|
|
.Xr mknod 8 ,
|
|
|
|
.Xr mtree 8
|
2002-03-14 04:33:27 +03:00
|
|
|
.Sh HISTORY
|
|
|
|
The
|
|
|
|
.Nm
|
|
|
|
command appeared in
|
|
|
|
.Bx 4.2 .
|
2007-03-03 09:53:41 +03:00
|
|
|
The ability to be used as a function library was added in
|
|
|
|
.Nx 5.0 .
|
2003-10-25 00:26:57 +04:00
|
|
|
.Sh NOTES
|
2007-02-27 01:54:40 +03:00
|
|
|
Not all devices listed in this manpage are supported on all platforms.
|
|
|
|
.Pp
|
2001-04-16 12:08:19 +04:00
|
|
|
This man page is generated automatically from the same sources
|
|
|
|
as
|
|
|
|
.Pa /dev/MAKEDEV ,
|
|
|
|
in which the device files are not always sorted, which may result
|
2005-05-17 17:59:40 +04:00
|
|
|
in an unusual (non-alphabetical) order.
|
2007-02-27 01:54:40 +03:00
|
|
|
.Pp
|
|
|
|
In order to allow a diskless
|
|
|
|
.Nx
|
|
|
|
client to obtain its
|
|
|
|
.Pa /dev
|
|
|
|
directory from a file server running a foreign operating system,
|
|
|
|
one of the following techniques may be useful to populate
|
|
|
|
a directory of device nodes on the foreign server:
|
|
|
|
.Bl -bullet
|
|
|
|
.It
|
|
|
|
If the foreign server is sufficiently similar to
|
|
|
|
.Nx ,
|
|
|
|
run
|
|
|
|
.Nm
|
|
|
|
in an appropriate directory of the foreign server,
|
|
|
|
using the
|
|
|
|
.Fl m
|
|
|
|
flag to refer to a script that converts from command line
|
|
|
|
arguments that would be usable with the
|
|
|
|
.Nx
|
|
|
|
.Xr mknod 8
|
|
|
|
command to the equivalent commands for the foreign server.
|
|
|
|
.It
|
|
|
|
Run
|
|
|
|
.Nm
|
|
|
|
with the
|
|
|
|
.Fl s
|
|
|
|
flag to generate an
|
|
|
|
.Xr mtree 8
|
|
|
|
specification file; this can be done on any host with a
|
|
|
|
POSIX-compliant shell and a few widely-available utilities.
|
|
|
|
Use the
|
|
|
|
.Xr pax 1
|
|
|
|
command with the
|
|
|
|
.Fl w Fl M
|
|
|
|
flags to convert the
|
|
|
|
.Xr mtree 8
|
|
|
|
specification file into an archive
|
|
|
|
in a format that supports device nodes
|
|
|
|
(such as
|
|
|
|
.Ar ustar
|
|
|
|
format);
|
|
|
|
this can be done on a
|
|
|
|
.Nx
|
|
|
|
host, or can be done in a cross-build environment using
|
|
|
|
.Sy TOOLDIR Ns Pa /bin/nbpax .
|
|
|
|
Finally, use apropriate tools on the foreign server
|
|
|
|
to unpack the archive and create the device nodes.
|
|
|
|
.El
|