1 .\" $NetBSD: MAKEDEV.8.template,v 1.18 2008/04/30 13:10:57 martin Exp $
3 .\" Copyright (c) 2001, 2003, 2007, 2008 The NetBSD Foundation, Inc.
4 .\" All rights reserved.
6 .\" This code is derived from software contributed to The NetBSD Foundation
7 .\" by Thomas Klausner.
9 .\" Redistribution and use in source and binary forms, with or without
10 .\" modification, are permitted provided that the following conditions
12 .\" 1. Redistributions of source code must retain the above copyright
13 .\" notice, this list of conditions and the following disclaimer.
14 .\" 2. Redistributions in binary form must reproduce the above copyright
15 .\" notice, this list of conditions and the following disclaimer in the
16 .\" documentation and/or other materials provided with the distribution.
18 .\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
19 .\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
20 .\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
21 .\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
22 .\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
23 .\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
24 .\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
25 .\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
26 .\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
27 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
28 .\" POSSIBILITY OF SUCH DAMAGE.
35 .Nd create system and device special files
37 .\" Please keep this in sync with MAKEDEV.local.8
43 .Bro Ar special | device Brc Op Ar ...
46 is used to create system and device special files.
47 As arguments it takes the names of known devices, like
49 or of special targets, like
53 which create a collection of device special files,
64 Devices are created in the current working directory;
67 should be invoked with
69 as the current working directory.
71 Supported options are:
72 .Bl -tag -width XmXmknodXX
74 Force permissions to be updated on existing devices.
79 it is not compatible with the
86 Create a memory file system, union mounted over the current directory,
87 to contain the device special files.
88 The memory file system is created using
92 in that order of preference.
96 flag is specified more than once, then
98 assumes that it is being invoked from
100 to populate a memory file system for
104 will also redirect its output to the system console.
108 and specify the name or path to the
111 [Usually, $TOOL_MKNOD or mknod.]
115 and specify the name or path to the
118 [Usually, $TOOL_PAX or pax.]
122 specfile instead of creating devices.
126 and specify the name or path to the
129 [Usually, $TOOL_MTREE or mtree.]
133 has several possible methods of creating device nodes:
138 command once for each device node.
139 This is the traditional method, but it is slow because each device node
140 is created using a new process.
150 By internally creating a specfile in a format usable by
152 and providing the specfile on standard input to a
156 command, invoked with options that request it to create the device nodes
157 as well as any necessary subdirectories.
158 This is much faster than creating device nodes with
160 because it requires much fewer processes;
161 however, it's not compatible with the
179 option is specified, then
181 will not create device nodes at all, but will output
182 a specfile in a format usable by
187 .Fl m , Fl p , Fl s ,
190 flags are mutually exclusive.
191 If none of these flags is specified, then
198 in that order of preference, depending on which commands
199 appear to be available and usable.
200 In normal use, it's expected that
202 will be available, so it will be chosen.
209 will not be available, but
213 The special targets supported on
219 Please note that any hash marks
221 in the following list of supported device targets must be replaced by
227 The following environment variables affect the execution of
230 .Bl -tag -width indent
231 .It Ev MAKEDEV_AS_LIBRARY
234 will define several shell functions and then return,
235 ignoring all its command line options and arguments.
236 This is used to enable
238 to use the shell functions defined in
242 .Bl -tag -width "/dev/MAKEDEV.local" -compact
244 special device files directory
246 script described in this man page
247 .It Pa /dev/MAKEDEV.local
248 script for site-specific devices
251 If the script reports an error that is difficult to understand,
252 you can get more debugging output by using
253 .Dl Ic sh Fl x Ar MAKEDEV Ar argument .
260 .Xr MAKEDEV.local 8 ,
275 options were added in
282 options were added in
284 The ability to be used as a function library was added in
289 option is not compatible with the use of
294 Not all devices listed in this manpage are supported on all platforms.
296 This man page is generated automatically from the same sources
299 in which the device files are not always sorted, which may result
300 in an unusual (non-alphabetical) order.
302 In order to allow a diskless
306 directory from a file server running a foreign operating system,
307 one of the following techniques may be useful to populate
308 a directory of device nodes on the foreign server:
311 If the foreign server is sufficiently similar to
315 in an appropriate directory of the foreign server,
318 flag to refer to a script that converts from command line
319 arguments that would be usable with the
322 command to the equivalent commands for the foreign server.
330 specification file; this can be done on any host with a
331 POSIX-compliant shell and a few widely-available utilities.
338 specification file into an archive
339 in a format that supports device nodes
343 this can be done on a
345 host, or can be done in a cross-build environment using
346 .Sy TOOLDIR Ns Pa /bin/nbpax .
347 Finally, use apropriate tools on the foreign server
348 to unpack the archive and create the device nodes.