993336d65c
geom_uzip module. This is based on utility I wrote some 3 years ago for a hack for md(4), which functionally was close to what geom_uzip does today. Since I don't have a time to test that it compiles/works on other arches, stick it to i386 only. Will do it later. Unlike original cloop util, this one embedds FreeBSD-compatible shell code into the generated image, not Linux one. Unfortunately severe space restriction imposed by the CLOOP format doesn't allow to put conditional code which will work both on Linux and FreeBSD. In fact it was quite a challenge to fit necessary FreeBSD code into 127 bytes. ;-)
85 lines
2.3 KiB
Groff
85 lines
2.3 KiB
Groff
.\" ----------------------------------------------------------------------------
|
|
.\" "THE BEER-WARE LICENSE" (Revision 42):
|
|
.\" <sobomax@FreeBSD.ORG> wrote this file. As long as you retain this notice you
|
|
.\" can do whatever you want with this stuff. If we meet some day, and you think
|
|
.\" this stuff is worth it, you can buy me a beer in return. Maxim Sobolev
|
|
.\" ----------------------------------------------------------------------------
|
|
.\"
|
|
.\" $FreeBSD$
|
|
.\"
|
|
.Dd July 29, 2001
|
|
.Dt MDGZIP 8
|
|
.Os
|
|
.Sh NAME
|
|
.Nm mkuzip
|
|
.Nd compress a
|
|
.Xr geom_uzip 4
|
|
image
|
|
.Sh SYNOPSIS
|
|
.Nm
|
|
.Op Fl v
|
|
.Op Fl o Ar outfile
|
|
.Op Fl s Ar cluster_size
|
|
.Ar infile
|
|
.Sh DESCRIPTION
|
|
The
|
|
.Nm
|
|
utility compresses a disk image file in such a way that the
|
|
.Xr geom_uzip 4
|
|
class will be able to decompress resulting image in run-time
|
|
when it loaded into memory. This allows for significant reduction
|
|
of memory footprint of memory-based filesystem at the expense of
|
|
some CPU time required to decompress the data each time it is
|
|
read. Internally, operation is done in two phases as follows:
|
|
.Bl -enum
|
|
.It
|
|
An
|
|
.Ar infile
|
|
image is split into clusters and each cluster compressed using
|
|
.Xr zlib 3 .
|
|
.It
|
|
Resulting set of clusters along with headers allowing to
|
|
independently locate each individual cluster is written into
|
|
output file.
|
|
.El
|
|
.Pp
|
|
The options are:
|
|
.Bl -tag -width Fl
|
|
.It Fl o Ar outfile
|
|
Name the output file
|
|
.Ar outfile .
|
|
The default is to use the input name with the suffix
|
|
.Sq .uzip .
|
|
.It Fl s Ar cluster_size
|
|
Use
|
|
.Ar cluster_size
|
|
as the size of chunks the file being split up into. Default value
|
|
is 16K. The
|
|
.Ar cluster_size
|
|
should be multiple of block size of the
|
|
.Xr geom_uzip 4
|
|
device (usually 512 bytes).
|
|
.It Fl v
|
|
Display verbose messages.
|
|
.El
|
|
.Sh NOTES
|
|
Compression ratio largely depends on the cluster size used. For
|
|
large cluster sizes of (16K and higher) typical compression ratios
|
|
are only 1-2% less than those achieved with the
|
|
.Xr gzip 1
|
|
utlity. However, it should be kept in mind that larger cluster
|
|
sizes lead to higher overhead in the
|
|
.Xr geom_uzip 4
|
|
class, as the class has to decompress the whole cluster even if
|
|
literally only several bytes from that cluster have to be read.
|
|
.Sh SEE ALSO
|
|
.Xr gzip 1 ,
|
|
.Xr zlib 3 ,
|
|
.Xr geom_uzip 4 ,
|
|
.Xr boot 8 ,
|
|
.Xr loader 8
|
|
.Sh DIAGNOSTICS
|
|
Exit status is 0 on success and >0 on error.
|
|
.Sh AUTHORS
|
|
.An Maxim Sobolev Aq sobomax@FreeBSD.org .
|