Commit | Line | Data |
---|---|---|
b42074ab CL |
1 | .\" Copyright (c) 1983, 1991 Regents of the University of California. |
2 | .\" All rights reserved. | |
f25e9191 | 3 | .\" |
b42074ab | 4 | .\" %sccs.include.redist.man% |
f25e9191 | 5 | .\" |
b42074ab CL |
6 | .\" @(#)mkproto.8 6.3 (Berkeley) %G% |
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 | |
f25e9191 KM |
19 | is used to bootstrap a new file system. |
20 | First a new file system is created using | |
b42074ab CL |
21 | .Xr newfs 8 . |
22 | .Nm Mkproto | |
f25e9191 KM |
23 | is then used to copy files from the old file system into the new |
24 | file system according to the directions found in the prototype file | |
b42074ab | 25 | .Ar proto . |
f25e9191 KM |
26 | The prototype file |
27 | contains tokens separated by spaces or | |
28 | new lines. | |
29 | The first tokens comprise the specification | |
30 | for the root directory. | |
31 | File specifications consist of tokens | |
32 | giving the mode, | |
33 | the user-id, | |
34 | the group id, | |
35 | and the initial contents of the file. | |
36 | The syntax of the contents field | |
37 | depends on the mode. | |
b42074ab | 38 | .Pp |
f25e9191 KM |
39 | The mode token for a file is a 6 character string. |
40 | The first character | |
41 | specifies the type of the file. | |
42 | (The characters | |
b42074ab | 43 | .Fl bcd |
f25e9191 KM |
44 | specify regular, block special, |
45 | character special and directory files | |
46 | respectively.) | |
47 | The second character of the type | |
48 | is either | |
b42074ab | 49 | .Cm u |
f25e9191 | 50 | or |
b42074ab | 51 | .Ql Fl |
f25e9191 KM |
52 | to specify set-user-id mode or not. |
53 | The third is | |
b42074ab | 54 | .Cm g |
f25e9191 | 55 | or |
b42074ab | 56 | .Ql Fl |
f25e9191 KM |
57 | for the set-group-id mode. |
58 | The rest of the mode | |
59 | is a three digit octal number giving the | |
60 | owner, group, and other read, write, execute | |
61 | permissions, see | |
b42074ab CL |
62 | .Xr chmod 1 . |
63 | .Pp | |
f25e9191 KM |
64 | Two decimal number |
65 | tokens come after the mode; they specify the | |
66 | user and group ID's of the owner of the file. | |
b42074ab | 67 | .Pp |
f25e9191 KM |
68 | If the file is a regular file, |
69 | the next token is a pathname | |
70 | whence the contents and size are copied. | |
b42074ab | 71 | .Pp |
f25e9191 KM |
72 | If the file is a block or character special file, |
73 | two decimal number tokens | |
74 | follow which give the major and minor device numbers. | |
b42074ab | 75 | .Pp |
f25e9191 | 76 | If the file is a directory, |
b42074ab | 77 | .Nm mkproto |
f25e9191 | 78 | makes the entries |
b42074ab | 79 | .Ql \&. |
f25e9191 | 80 | and |
b42074ab | 81 | .Ql \&.. |
f25e9191 KM |
82 | and then |
83 | reads a list of names and | |
84 | (recursively) | |
85 | file specifications for the entries | |
86 | in the directory. | |
87 | The scan is terminated with the | |
88 | token | |
b42074ab CL |
89 | .Cm $ . |
90 | .Pp | |
f25e9191 | 91 | A sample prototype specification follows: |
b42074ab | 92 | .Bd -literal -offset indent |
f25e9191 KM |
93 | d\-\-777 3 1 |
94 | usr 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 | $ | |
b42074ab CL |
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 | |
f25e9191 | 109 | There should be some way to specify links. |
b42074ab | 110 | .Pp |
f25e9191 | 111 | There should be some way to specify bad blocks. |
b42074ab CL |
112 | .Pp |
113 | .Nm Mkproto | |
114 | can only be run on virgin file systems. | |
f25e9191 | 115 | It should be possible to copy files into existent file systems. |
b42074ab CL |
116 | .Sh HISTORY |
117 | The | |
118 | .Nm | |
119 | command appeared in | |
120 | .Bx 4.2 . |