xref: /openbsd/usr.sbin/makefs/makefs.8 (revision 09467b48)
1.\"	$OpenBSD: makefs.8,v 1.20 2017/11/07 00:22:40 yasuoka Exp $
2.\"	$NetBSD: makefs.8,v 1.55 2015/11/25 16:32:00 wiz Exp $
3.\"
4.\" Copyright (c) 2001-2003 Wasabi Systems, Inc.
5.\" All rights reserved.
6.\"
7.\" Written by Luke Mewburn for Wasabi Systems, Inc.
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.\" 3. All advertising materials mentioning features or use of this software
18.\"    must display the following acknowledgement:
19.\"      This product includes software developed for the NetBSD Project by
20.\"      Wasabi Systems, Inc.
21.\" 4. The name of Wasabi Systems, Inc. may not be used to endorse
22.\"    or promote products derived from this software without specific prior
23.\"    written permission.
24.\"
25.\" THIS SOFTWARE IS PROVIDED BY WASABI SYSTEMS, INC. ``AS IS'' AND
26.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
27.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
28.\" PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL WASABI SYSTEMS, INC
29.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
30.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
31.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
32.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
33.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
34.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
35.\" POSSIBILITY OF SUCH DAMAGE.
36.\"
37.Dd $Mdocdate: November 7 2017 $
38.Dt MAKEFS 8
39.Os
40.Sh NAME
41.Nm makefs
42.Nd create a file system image from a directory tree
43.Sh SYNOPSIS
44.Nm
45.Op Fl b Ar free-blocks
46.Op Fl f Ar free-files
47.Op Fl M Ar minimum-size
48.Op Fl m Ar maximum-size
49.Op Fl O Ar offset
50.Op Fl o Ar fs-options
51.Op Fl S Ar sector-size
52.Op Fl s Ar image-size
53.Op Fl T Ar timestamp
54.Op Fl t Ar fs-type
55.Ar image-file
56.Ar directory
57.Sh DESCRIPTION
58The utility
59.Nm
60creates a file system image into
61.Ar image-file
62from the directory tree
63.Ar directory .
64No special devices or privileges are required to perform this task.
65.Pp
66The options are as follows:
67.Bl -tag -width flag
68.It Fl b Ar free-blocks
69Ensure that a minimum of
70.Ar free-blocks
71exist in the image.
72An optional
73.Ql %
74suffix may be provided to indicate that
75.Ar free-blocks
76indicates a percentage of the calculated image size.
77.It Fl f Ar free-files
78Ensure that a minimum of
79.Ar free-files
80(inodes) exist in the image.
81An optional
82.Ql %
83suffix may be provided to indicate that
84.Ar free-files
85indicates a percentage of the calculated image size.
86.It Fl M Ar minimum-size
87Set the minimum size of the file system image to
88.Ar minimum-size .
89.It Fl m Ar maximum-size
90Set the maximum size of the file system image to
91.Ar maximum-size .
92An error will be raised if the target file system needs to be larger
93than this to accommodate the provided directory tree.
94.It Fl O Ar offset
95Instead of creating the file system at the beginning of the file, start
96at offset.
97Valid only for
98.Sy ffs
99and
100.Sy msdos .
101.It Fl o Ar fs-options
102Set file system specific options.
103.Ar fs-options
104is a comma separated list of options.
105Valid file system specific options are detailed below.
106.It Fl S Ar sector-size
107Set the file system sector size to
108.Ar sector-size .
109.\" XXX: next line also true for cd9660?
110Defaults to 512.
111.It Fl s Ar image-size
112Set the size of the file system image to
113.Ar image-size .
114.It Fl T Ar timestamp
115Specify a timestamp to be set for all file system files and directories
116created so that repeatable builds are possible.
117The
118.Ar timestamp
119is an integer value interpreted as the number of seconds from the Epoch.
120.It Fl t Ar fs-type
121Create an
122.Ar fs-type
123file system image.
124The following file system types are supported:
125.Pp
126.Bl -tag -width cd9660 -offset indent -compact
127.It Sy cd9660
128ISO 9660 file system.
129.It Sy ffs
130BSD Fast File System (the default).
131.It Sy msdos
132FAT12, FAT16, or FAT32 file system.
133.El
134.El
135.Pp
136Sizes are specified as a decimal number of bytes
137and may use a multiplier, as documented in
138.Xr scan_scaled 3 .
139Two or more numbers may be separated by an
140.Sq x
141to indicate a product.
142.Ss ffs options
143.Sy ffs
144images have ffs-specific optional parameters that may be provided.
145Each of the options consists of a keyword, an equal sign
146.Pq Ql = ,
147and a value.
148The following keywords are supported:
149.Pp
150.Bl -tag -width optimization -offset indent -compact
151.It Sy avgfilesize
152Expected average file size.
153.It Sy avgfpdir
154Expected number of files per directory.
155.It Sy bsize
156Block size.
157.It Sy density
158Bytes per inode.
159.It Sy disklabel
160Name of a disk described in
161.Xr disktab 5 .
162A disklabel with the information will be written at a machine dependent
163location in the image.
164The size of the file system image, the sector size and the
165.Sy bsize
166and
167.Sy fsize
168parameters are inferred from the disklabel.
169.It Sy extent
170Maximum extent size.
171.It Sy fsize
172Fragment size.
173.It Sy label
174Label name of the image.
175.It Sy maxbpcg
176Maximum total number of blocks in a cylinder group.
177.It Sy maxbpg
178Maximum blocks per file in a cylinder group.
179.It Sy minfree
180Minimum % free.
181.It Sy optimization
182Optimization preference: one of
183.Ql space
184(default)
185or
186.Ql time .
187.It Sy version
188UFS version.
1891 for FFS (default) or 2 for UFS2.
190.El
191.Ss cd9660 options
192.Sy cd9660
193images have ISO9660-specific optional parameters that may be
194provided.
195The arguments consist of a keyword and, optionally, an equal sign
196.Pq Ql = ,
197and a value.
198The following keywords are supported:
199.Pp
200.Bl -tag -width omit-trailing-period -offset indent -compact
201.It Sy allow-deep-trees
202Allow the directory structure to exceed the maximum specified in
203the spec.
204.It Sy allow-multidot
205Allow multiple dots in a filename.
206.It Sy applicationid
207Application ID of the image.
208.It Sy boot-load-segment
209Set load segment for the boot image.
210.It Sy bootimage
211Filename of a boot image in the format
212.Dq sysid;filename ,
213where
214.Dq sysid
215is one of
216.Ql i386 ,
217.Ql macppc ,
218.Ql powerpc ,
219or
220.Ql efi .
221.It Sy generic-bootimage
222Load a generic boot image into the first 32K of the CD9660 image.
223.It Sy hard-disk-boot
224Boot image is a hard disk image.
225.It Sy isolevel
226ISO Level.
227.It Sy label
228Label name of the image.
229.It Sy no-boot
230Boot image is not bootable.
231.It Sy no-emul-boot
232Boot image is a
233.Dq no emulation
234ElTorito image.
235.It Sy no-trailing-padding
236Do not pad the image (apparently Linux needs the padding).
237.It Sy omit-trailing-period
238Omit trailing periods in filenames.
239.It Sy preparer
240Preparer ID of the image.
241.It Sy publisher
242Publisher ID of the image.
243.It Sy rockridge
244Use RockRidge extensions (for longer filenames, etc.).
245.It Sy volumeid
246Volume set identifier of the image.
247.El
248.Ss msdos options
249.Sy msdos
250images have MS-DOS-specific optional parameters that may be
251provided.
252The arguments consist of a keyword, an equal sign
253.Pq Ql = ,
254and a value.
255The following keywords are supported:
256.Pp
257.Bl -tag -width omit-trailing-period -offset indent -compact
258.It Cm backup_sector
259Location of the backup boot sector.
260.It Cm block_size
261Block size.
262.It Cm bootstrap
263Bootstrap file.
264.It Cm bytes_per_sector
265Bytes per sector.
266.It Cm create_size
267Create file size.
268.It Cm directory_entries
269Directory entries.
270.It Cm drive_heads
271Drive heads.
272.It Cm fat_type
273FAT type (12, 16, or 32).
274.It Cm floppy
275Preset drive parameters for standard format floppy disks
276(160, 180, 320, 360, 640, 720, 1200, 1232, 1440, or 2880).
277.It Cm hidden_sectors
278Hidden sectors.
279.It Cm info_sector
280Location of the info sector.
281.It Cm media_descriptor
282Media descriptor.
283.It Cm num_FAT
284Number of FATs.
285.It Cm OEM_string
286OEM string.
287.It Cm offset
288Offset in device.
289.It Cm reserved_sectors
290Reserved sectors.
291.It Cm sectors_per_cluster
292Sectors per cluster.
293.It Cm sectors_per_fat
294Sectors per FAT.
295.It Cm sectors_per_track
296Sectors per track.
297.It Cm size
298File System size.
299.It Cm volume_id
300Volume ID.
301.It Cm volume_label
302Volume Label.
303.El
304.Sh SEE ALSO
305.Xr scan_scaled 3 ,
306.Xr installboot 8 ,
307.Xr newfs 8
308.Sh HISTORY
309The
310.Nm
311utility appeared in
312.Nx 1.6 .
313.Sh AUTHORS
314.An -nosplit
315.An Luke Mewburn
316.Aq lukem@NetBSD.org
317(original program),
318.An Daniel Watt ,
319.An Walter Deignan ,
320.An Ryan Gabrys ,
321.An Alan Perez-Rathke ,
322.An Ram Vedam
323(cd9660 support),
324and
325.An Christos Zoulas
326(msdos support).
327