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.Dd May 20, 2013 30.Dt MAKEROOT 8 31.Os 32.Sh NAME 33.Nm makeroot 34.Nd Tool to create root filesystem images given a tree containing a manifest 35.Sh SYNOPSIS 36.Nm 37.Op Fl d 38.Op Fl B Ar byte-order 39.Op Fl e Ar extras-manifest 40.Op Fl f Ar filelist 41.Op Fl k Ar keydir Op Fl K Ar user 42.Op Fl l Ar label 43.Op Fl p Ar master.passwd Op Fl g Ar group 44.Op Fl s Ar size 45.Ar image-file 46.Ar rootdir 47.Sh DESCRIPTION 48The 49.Nm 50script creates a UFS filesystem image into 51.Ar imagefile . 52By default, 53all filesystem objects listed in the 54.Pa METALOG 55file contained in the 56.Ar rootdir 57directory will be placed in the root of the UFS image 58.Ar image-file . 59.Pp 60Images can be customized with a number of different flags: 61.Bl -tag -width indent 62.It Fl B Ar byte-order 63Set the byte order of the image to 64.Ar byte-order . 65This argument is passed directly to 66.Xr makefs 8 . 67.It Fl d 68Enable debugging output. 69.It Fl e Ar manifest 70Extra files listed in the 71.Xr nmtree 8 72format 73.Ar manifest 74file are added to the filesystem image. 75If no contents= tag is specified or a contents= tag is relative then 76files are found relative to the basename of the full path of the 77manifest. 78If a contents= tag is provided and it is an absolute path then the file 79will be from that path. 80.It Fl f Ar filelist 81Constrain set of filesystem objects included from 82.Ar rootdir 83to those listed (one per line) in the 84.Ar filelist 85plus any required directories. 86.It Fl k Ar keydir Op Fl K Ar user 87Create a .ssh/authorized_keys file from a collection of public key files 88stored in 89.Ar keydir 90and install it in the home directory of 91.Ar user . 92If no 93.Fl K 94argument is supplied then the files will be installed in the root user's 95directory. 96.It Fl l Ar label 97Set the file system volume label. 98.It Fl p Ar master.passwd Op Fl g Ar group 99Install an alternate 100.Ar master.passwd 101file and optionally an alternative 102.Ar group 103file. 104.It Fl s Ar size 105Set the size of the image to 106.Ar size . 107The 108.Fl s 109argument is passed directly to 110.Xr makefs 8 . 111.El 112.Sh FILES 113.Bl -tag -width METALOG -compact 114.It Pa METALOG 115.Xr mtree 5 1162.0 format manifest of permissions and ownership for files in the root 117directory. 118This file is generated by installworld, distribution, and installkernel. 119.El 120.Sh EXAMPLES 121.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 122.Sh SEE ALSO 123.Xr mtree 5 , 124.Xr makefs 8 , 125.Xr nmtree 8 126.Sh AUTHORS 127This software and this manual page were developed by SRI International 128and the University of Cambridge Computer Laboratory under DARPA/AFRL 129contract 130.Pq FA8750-10-C-0237 131.Pq Do CTSRD Dc , 132as part of the DARPA CRASH research programme. 133