xref: /original-bsd/usr.sbin/mkproto/mkproto.8 (revision c3e32dec)
1.\" Copyright (c) 1983, 1991, 1993
2.\"	The Regents of the University of California.  All rights reserved.
3.\"
4.\" %sccs.include.redist.man%
5.\"
6.\"     @(#)mkproto.8	8.1 (Berkeley) 06/06/93
7.\"
8.Dd
9.Dt MKPROTO 8
10.Os BSD 4.2
11.Sh NAME
12.Nm mkproto
13.Nd construct a prototype file system
14.Sh SYNOPSIS
15.Nm mkproto
16.Ar special proto
17.Sh DESCRIPTION
18.Nm Mkproto
19is used to bootstrap a new file system.
20First a new file system is created using
21.Xr newfs 8 .
22.Nm Mkproto
23is then used to copy files from the old file system into the new
24file system according to the directions found in the prototype file
25.Ar proto .
26The prototype file
27contains tokens separated by spaces or
28new lines.
29The first tokens comprise the specification
30for the root directory.
31File specifications consist of tokens
32giving the mode,
33the user-id,
34the group id,
35and the initial contents of the file.
36The syntax of the contents field
37depends on the mode.
38.Pp
39The mode token for a file is a 6 character string.
40The first character
41specifies the type of the file.
42(The characters
43.Fl bcd
44specify regular, block special,
45character special and directory files
46respectively.)
47The second character of the type
48is either
49.Cm u
50or
51.Ql Fl
52to specify set-user-id mode or not.
53The third is
54.Cm g
55or
56.Ql Fl
57for the set-group-id mode.
58The rest of the mode
59is a three digit octal number giving the
60owner, group, and other read, write, execute
61permissions, see
62.Xr chmod 1 .
63.Pp
64Two decimal number
65tokens come after the mode; they specify the
66user and group ID's of the owner of the file.
67.Pp
68If the file is a regular file,
69the next token is a pathname
70whence the contents and size are copied.
71.Pp
72If the file is a block or character special file,
73two decimal number tokens
74follow which give the major and minor device numbers.
75.Pp
76If the file is a directory,
77.Nm mkproto
78makes the entries
79.Ql \&.
80and
81.Ql \&..
82and then
83reads a list of names and
84(recursively)
85file specifications for the entries
86in the directory.
87The scan is terminated with the
88token
89.Cm $ .
90.Pp
91A sample prototype specification follows:
92.Bd -literal -offset indent
93d\-\-777 3 1
94usr	d\-\-777 3 1
95	sh	\-\-\-755 3 1 /bin/sh
96	ken	d\-\-755 6 1
97		$
98	b0	b\-\-644 3 1 0 0
99	c0	c\-\-644 3 1 0 0
100	$
101$
102.Ed
103.Sh SEE ALSO
104.Xr fs 5 ,
105.Xr dir 5 ,
106.Xr fsck 8 ,
107.Xr newfs 8
108.Sh BUGS
109There should be some way to specify links.
110.Pp
111There should be some way to specify bad blocks.
112.Pp
113.Nm Mkproto
114can only be run on virgin file systems.
115It should be possible to copy files into existent file systems.
116.Sh HISTORY
117The
118.Nm
119command appeared in
120.Bx 4.2 .
121