The utility
makefs
creates a file system image into
image-file
from the directory tree
directory
or from the mtree manifest
manifest.
If any optional directory trees are passed in the
extra-directory
arguments, then the directory tree of each argument will be merged
into the
directory
or
manifest
first before creating
image-file.
No special devices or privileges are required to perform this task.
The options are as follows:
-B endian
|
|
Set the byte order of the image to
endian.
Valid byte orders are
‘4321’,
‘big’,
or
‘be’
for big endian, and
‘1234’,
‘little’,
or
‘le’
for little endian.
Some file systems may have a fixed byte order; in those cases this
argument will be ignored.
|
-b free-blocks
|
|
Ensure that a minimum of
free-blocks
free blocks exist in the image.
An optional
‘%’
suffix may be provided to indicate that
free-blocks
indicates a percentage of the calculated image size.
|
-D
|
|
Treat duplicate paths in an mtree manifest as warnings not error.
|
-d debug-mask
|
|
Enable various levels of debugging, depending upon which bits are
set in
debug-mask.
XXX: document these
|
-F mtree-specfile
|
|
This is almost certainly not the option you are looking for.
To create an image from a list of files in an mtree format manifest,
specify it as the last argument on the command line, not as a the
argument to
-F.
Use
mtree-specfile
as an
mtree(8)
'specfile'
specification.
This option has no effect when the image is created from a mtree manifest
rather than a directory.
If a specfile entry exists in the underlying file system, its
permissions and modification time will be used unless specifically
overridden by the specfile.
An error will be raised if the type of entry in the specfile
conflicts with that of an existing entry.
In the opposite case (where a specfile entry does not have an entry
in the underlying file system) the following occurs:
If the specfile entry is marked
optional,
the specfile entry is ignored.
Otherwise, the entry will be created in the image, and it is
necessary to specify at least the following parameters in the
specfile:
type,
mode,
gname,
or
gid,
and
uname
or
uid,
and
link
(in the case of symbolic links).
If
time
is not provided, the current time will be used.
If
flags
is not provided, the current file flags will be used.
Missing regular file entries will be created as zero-length files.
|
-f free-files
|
|
Ensure that a minimum of
free-files
free files (inodes) exist in the image.
An optional
‘%’
suffix may be provided to indicate that
free-files
indicates a percentage of the calculated image size.
|
-M minimum-size
|
|
Set the minimum size of the file system image to
minimum-size.
|
-m maximum-size
|
|
Set the maximum size of the file system image to
maximum-size.
An error will be raised if the target file system needs to be larger
than this to accommodate the provided directory tree.
|
-N userdb-dir
|
|
Use the user database text file
master.passwd
and group database text file
group
from
userdb-dir,
rather than using the results from the system's
getpwnam(3)
and
getgrnam(3)
(and related) library calls.
|
-O offset
|
|
Instead of creating the filesystem at the beginning of the file, start
at offset.
Valid only for
ffs
and
msdos.
|
-o fs-options
|
|
Set file system specific options.
fs-options
is a comma separated list of options.
Valid file system specific options are detailed below.
|
-p
|
|
Deprecated.
See the
-Z
flag.
|
-R roundup-size
|
|
Round the image up to
roundup-size.
roundup-size
should be a multiple of the file system block size.
This option only applies to the
ffs
file system type.
|
-S sector-size
|
|
Set the file system sector size to
sector-size.
Defaults to 512.
|
-s image-size
|
|
Set the size of the file system image to
image-size.
This is equivalent to setting both the minimum
-( -M)
and the maximum
-( -m)
sizes to the same value.
For
ffs
and
msdos
the
image-size
does not include the
offset.
offset
is not included in that size.
|
-T timestamp
|
|
Specify a timestamp to be set for all filesystem files and directories
created so that repeatable builds are possible.
The
timestamp
can be a
pathname,
where the timestamps are derived from that file, or an integer
value interpreted as the number of seconds from the Epoch.
Note that timestamps specified in an
mtree(5)
spec file, override the default timestamp.
|
-t fs-type
|
|
Create an
fs-type
file system image.
The following file system types are supported:
|
ffs
|
BSD fast file system (default).
|
cd9660
|
|
ISO 9660 file system.
|
msdos
|
FAT12, FAT16, or FAT32 file system.
|
-x
|
|
Exclude file system nodes not explicitly listed in the specfile.
|
-Z
|
|
Create a sparse file for
ffs.
This is useful for virtual machine images.
|
Where sizes are specified, a decimal number of bytes is expected.
Two or more numbers may be separated by an
"x"
to indicate a product.
Each number may have one of the following optional suffixes:
b
|
Block; multiply by 512
|
k
|
Kibi; multiply by 1024 (1 KiB)
|
m
|
Mebi; multiply by 1048576 (1 MiB)
|
g
|
Gibi; multiply by 1073741824 (1 GiB)
|
t
|
Tebi; multiply by 1099511627776 (1 TiB)
|
w
|
Word; multiply by the number of bytes in an integer
|