xref: /freebsd/tools/tools/makeroot/makeroot.8 (revision 0957b409)
1.\"-
2.\" Copyright (c) 2013 SRI International
3.\" All rights reserved.
4.\"
5.\" This software was developed by SRI International and the University of
6.\" Cambridge Computer Laboratory under DARPA/AFRL contract (FA8750-10-C-0237)
7.\" ("CTSRD"), as part of the DARPA CRASH research programme.
8.\"
9.\" Redistribution and use in source and binary forms, with or without
10.\" modification, are permitted provided that the following conditions
11.\" are met:
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.
17.\"
18.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
19.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
22.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
24.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
25.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
26.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
27.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
28.\" SUCH DAMAGE.
29.\"
30.\" $FreeBSD$
31.Dd May 20, 2013
32.Dt MAKEROOT 8
33.Os
34.Sh NAME
35.Nm makeroot
36.Nd Tool to create root filesystem images given a tree containing a manifest
37.Sh SYNOPSIS
38.Nm
39.Op Fl d
40.Op Fl B Ar byte-order
41.Op Fl e Ar extras-manifest
42.Op Fl f Ar filelist
43.Op Fl k Ar keydir Op Fl K Ar user
44.Op Fl l Ar label
45.Op Fl p Ar master.passwd Op Fl g Ar group
46.Op Fl s Ar size
47.Ar image-file
48.Ar rootdir
49.Sh DESCRIPTION
50The
51.Nm
52script creates a UFS filesystem image into
53.Ar imagefile .
54By default,
55all filesystem objects listed in the
56.Pa METALOG
57file contained in the
58.Ar rootdir
59directory will be placed in the root of the UFS image
60.Ar image-file .
61.Pp
62Images can be customized with a number of different flags:
63.Bl -tag -width indent
64.It Fl B Ar byte-order
65Set the byte order of the image to
66.Ar byte-order .
67This argument is passed directly to
68.Xr makefs 8 .
69.It Fl d
70Enable debugging output.
71.It Fl e Ar manifest
72Extra files listed in the
73.Xr nmtree 8
74format
75.Ar manifest
76file are added to the filesystem image.
77If no contents= tag is specified or a contents= tag is relative then
78files are found relative to the basename of the full path of the
79manifest.
80If a contents= tag is provided and it is an absolute path then the file
81will be from that path.
82.It Fl f Ar filelist
83Constrain set of filesystem objects included from
84.Ar rootdir
85to those listed (one per line) in the
86.Ar filelist
87plus any required directories.
88.It Fl k Ar keydir Op Fl K Ar user
89Create a .ssh/authorized_keys file from a collection of public key files
90stored in
91.Ar keydir
92and install it in the home directory of
93.Ar user .
94If no
95.Fl K
96argument is supplied then the files will be installed in the root user's
97directory.
98.It Fl l Ar label
99Set the file system volume label.
100.It Fl p Ar master.passwd Op Fl g Ar group
101Install an alternate
102.Ar master.passwd
103file and optionally an alternative
104.Ar group
105file.
106.It Fl s Ar size
107Set the size of the image to
108.Ar size .
109The
110.Fl s
111argument is passed directly to
112.Xr makefs 8 .
113.El
114.Sh FILES
115.Bl -tag -width METALOG -compact
116.It Pa METALOG
117.Xr mtree 5
1182.0 format manifest of permissions and ownership for files in the root
119directory.
120This file is generated by installworld, distribution, and installkernel.
121.El
122.Sh EXAMPLES
123.Dl $ makeroot.sh -k keys -K ctsrd -p extras/etc/master.passwd -g extras/etc/group -e extras/mdroot.mtree -e demo/demo.mtree -e extras/ctsrd.mtree -s 26112k -f demo.files cheribsd-demo.img /path/to/dist
124.Sh SEE ALSO
125.Xr mtree 5 ,
126.Xr makefs 8 ,
127.Xr nmtree 8
128.Sh AUTHORS
129This software and this manual page were developed by SRI International
130and the University of Cambridge Computer Laboratory under DARPA/AFRL
131contract
132.Pq FA8750-10-C-0237
133.Pq Do CTSRD Dc ,
134as part of the DARPA CRASH research programme.
135