xref: /csrg-svn/usr.sbin/mkproto/mkproto.8 (revision 61855)
1*61855Sbostic.\" Copyright (c) 1983, 1991, 1993
2*61855Sbostic.\"	The Regents of the University of California.  All rights reserved.
318988Smckusick.\"
447469Scael.\" %sccs.include.redist.man%
518988Smckusick.\"
6*61855Sbostic.\"     @(#)mkproto.8	8.1 (Berkeley) 06/06/93
747469Scael.\"
847469Scael.Dd
947469Scael.Dt MKPROTO 8
1047469Scael.Os BSD 4.2
1147469Scael.Sh NAME
1247469Scael.Nm mkproto
1347469Scael.Nd construct a prototype file system
1447469Scael.Sh SYNOPSIS
1547469Scael.Nm mkproto
1647469Scael.Ar special proto
1747469Scael.Sh DESCRIPTION
1847469Scael.Nm Mkproto
1918988Smckusickis used to bootstrap a new file system.
2018988SmckusickFirst a new file system is created using
2147469Scael.Xr newfs 8 .
2247469Scael.Nm Mkproto
2318988Smckusickis then used to copy files from the old file system into the new
2418988Smckusickfile system according to the directions found in the prototype file
2547469Scael.Ar proto .
2618988SmckusickThe prototype file
2718988Smckusickcontains tokens separated by spaces or
2818988Smckusicknew lines.
2918988SmckusickThe first tokens comprise the specification
3018988Smckusickfor the root directory.
3118988SmckusickFile specifications consist of tokens
3218988Smckusickgiving the mode,
3318988Smckusickthe user-id,
3418988Smckusickthe group id,
3518988Smckusickand the initial contents of the file.
3618988SmckusickThe syntax of the contents field
3718988Smckusickdepends on the mode.
3847469Scael.Pp
3918988SmckusickThe mode token for a file is a 6 character string.
4018988SmckusickThe first character
4118988Smckusickspecifies the type of the file.
4218988Smckusick(The characters
4347469Scael.Fl bcd
4418988Smckusickspecify regular, block special,
4518988Smckusickcharacter special and directory files
4618988Smckusickrespectively.)
4718988SmckusickThe second character of the type
4818988Smckusickis either
4947469Scael.Cm u
5018988Smckusickor
5147469Scael.Ql Fl
5218988Smckusickto specify set-user-id mode or not.
5318988SmckusickThe third is
5447469Scael.Cm g
5518988Smckusickor
5647469Scael.Ql Fl
5718988Smckusickfor the set-group-id mode.
5818988SmckusickThe rest of the mode
5918988Smckusickis a three digit octal number giving the
6018988Smckusickowner, group, and other read, write, execute
6118988Smckusickpermissions, see
6247469Scael.Xr chmod 1 .
6347469Scael.Pp
6418988SmckusickTwo decimal number
6518988Smckusicktokens come after the mode; they specify the
6618988Smckusickuser and group ID's of the owner of the file.
6747469Scael.Pp
6818988SmckusickIf the file is a regular file,
6918988Smckusickthe next token is a pathname
7018988Smckusickwhence the contents and size are copied.
7147469Scael.Pp
7218988SmckusickIf the file is a block or character special file,
7318988Smckusicktwo decimal number tokens
7418988Smckusickfollow which give the major and minor device numbers.
7547469Scael.Pp
7618988SmckusickIf the file is a directory,
7747469Scael.Nm mkproto
7818988Smckusickmakes the entries
7947469Scael.Ql \&.
8018988Smckusickand
8147469Scael.Ql \&..
8218988Smckusickand then
8318988Smckusickreads a list of names and
8418988Smckusick(recursively)
8518988Smckusickfile specifications for the entries
8618988Smckusickin the directory.
8718988SmckusickThe scan is terminated with the
8818988Smckusicktoken
8947469Scael.Cm $ .
9047469Scael.Pp
9118988SmckusickA sample prototype specification follows:
9247469Scael.Bd -literal -offset indent
9318988Smckusickd\-\-777 3 1
9418988Smckusickusr	d\-\-777 3 1
9518988Smckusick	sh	\-\-\-755 3 1 /bin/sh
9618988Smckusick	ken	d\-\-755 6 1
9718988Smckusick		$
9818988Smckusick	b0	b\-\-644 3 1 0 0
9918988Smckusick	c0	c\-\-644 3 1 0 0
10018988Smckusick	$
10118988Smckusick$
10247469Scael.Ed
10347469Scael.Sh SEE ALSO
10447469Scael.Xr fs 5 ,
10547469Scael.Xr dir 5 ,
10647469Scael.Xr fsck 8 ,
10747469Scael.Xr newfs 8
10847469Scael.Sh BUGS
10918988SmckusickThere should be some way to specify links.
11047469Scael.Pp
11118988SmckusickThere should be some way to specify bad blocks.
11247469Scael.Pp
11347469Scael.Nm Mkproto
11447469Scaelcan only be run on virgin file systems.
11518988SmckusickIt should be possible to copy files into existent file systems.
11647469Scael.Sh HISTORY
11747469ScaelThe
11847469Scael.Nm
11947469Scaelcommand appeared in
12047469Scael.Bx 4.2 .
121