2004-09-10 20:17:31 +00:00
|
|
|
.\" ----------------------------------------------------------------------------
|
|
|
|
.\" "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$
|
|
|
|
.\"
|
2006-09-29 15:20:48 +00:00
|
|
|
.Dd March 17, 2006
|
2004-09-11 18:39:01 +00:00
|
|
|
.Dt MKUZIP 8
|
2004-09-10 20:17:31 +00:00
|
|
|
.Os
|
|
|
|
.Sh NAME
|
|
|
|
.Nm mkuzip
|
2004-09-10 22:26:31 +00:00
|
|
|
.Nd compress disk image for use with
|
2004-09-10 20:17:31 +00:00
|
|
|
.Xr geom_uzip 4
|
2004-09-10 22:26:31 +00:00
|
|
|
class
|
2004-09-10 20:17:31 +00:00
|
|
|
.Sh SYNOPSIS
|
|
|
|
.Nm
|
|
|
|
.Op Fl v
|
|
|
|
.Op Fl o Ar outfile
|
|
|
|
.Op Fl s Ar cluster_size
|
|
|
|
.Ar infile
|
|
|
|
.Sh DESCRIPTION
|
|
|
|
The
|
|
|
|
.Nm
|
2006-03-17 20:48:10 +00:00
|
|
|
utility compresses a disk image file so that the
|
2004-09-10 20:17:31 +00:00
|
|
|
.Xr geom_uzip 4
|
2006-03-17 20:48:10 +00:00
|
|
|
class will be able to decompress the resulting image at run-time.
|
|
|
|
This allows for a significant reduction of size of disk image at
|
2004-09-10 22:26:31 +00:00
|
|
|
the expense of some CPU time required to decompress the data each
|
2004-09-11 18:39:01 +00:00
|
|
|
time it is read.
|
2006-09-29 15:20:48 +00:00
|
|
|
The
|
2006-03-17 20:48:10 +00:00
|
|
|
.Nm
|
2006-09-29 15:20:48 +00:00
|
|
|
utility
|
2006-03-17 20:48:10 +00:00
|
|
|
works in two phases:
|
2004-09-10 20:17:31 +00:00
|
|
|
.Bl -enum
|
|
|
|
.It
|
|
|
|
An
|
|
|
|
.Ar infile
|
2006-03-17 20:48:10 +00:00
|
|
|
image is split into clusters; each cluster is compressed using
|
2004-09-10 20:17:31 +00:00
|
|
|
.Xr zlib 3 .
|
|
|
|
.It
|
2006-03-17 20:48:10 +00:00
|
|
|
The resulting set of compressed clusters along with headers that allow
|
|
|
|
locating each individual cluster is written to the output file.
|
2004-09-10 20:17:31 +00:00
|
|
|
.El
|
|
|
|
.Pp
|
|
|
|
The options are:
|
2004-09-11 18:39:01 +00:00
|
|
|
.Bl -tag -width indent
|
2004-09-10 20:17:31 +00:00
|
|
|
.It Fl o Ar outfile
|
2006-03-17 20:48:10 +00:00
|
|
|
Name of the output file
|
2004-09-10 20:17:31 +00:00
|
|
|
.Ar outfile .
|
|
|
|
The default is to use the input name with the suffix
|
2004-09-11 18:39:01 +00:00
|
|
|
.Pa .uzip .
|
2004-09-10 20:17:31 +00:00
|
|
|
.It Fl s Ar cluster_size
|
2006-03-17 20:48:10 +00:00
|
|
|
Split the image into clusters of
|
2004-09-10 20:17:31 +00:00
|
|
|
.Ar cluster_size
|
2006-03-17 20:48:10 +00:00
|
|
|
bytes, 16384 bytes by default.
|
2004-09-11 18:39:01 +00:00
|
|
|
The
|
2004-09-10 20:17:31 +00:00
|
|
|
.Ar cluster_size
|
2004-09-11 18:39:01 +00:00
|
|
|
should be a multiple of 512 bytes.
|
2004-09-10 20:17:31 +00:00
|
|
|
.It Fl v
|
|
|
|
Display verbose messages.
|
|
|
|
.El
|
|
|
|
.Sh NOTES
|
2006-03-17 20:48:10 +00:00
|
|
|
The compression ratio largely depends on the cluster size used.
|
|
|
|
.\" The following two sentences are unclear: how can gzip(1) be
|
|
|
|
.\" used in a comparable fashion, and wouldn't a gzip-compressed
|
|
|
|
.\" image suffer from larger cluster sizes as well?
|
2004-09-11 18:39:01 +00:00
|
|
|
For large cluster sizes (16K and higher), typical compression ratios
|
2006-03-17 20:48:10 +00:00
|
|
|
are only 1-2% less than those achieved with
|
|
|
|
.Xr gzip 1 .
|
2004-09-11 18:39:01 +00:00
|
|
|
However, it should be kept in mind that larger cluster
|
2004-09-10 20:17:31 +00:00
|
|
|
sizes lead to higher overhead in the
|
|
|
|
.Xr geom_uzip 4
|
|
|
|
class, as the class has to decompress the whole cluster even if
|
2006-03-17 20:48:10 +00:00
|
|
|
only a few bytes from that cluster have to be read.
|
2004-09-10 22:26:31 +00:00
|
|
|
.Pp
|
2006-09-29 15:20:48 +00:00
|
|
|
The
|
2004-09-10 22:26:31 +00:00
|
|
|
.Nm
|
2006-09-29 15:20:48 +00:00
|
|
|
utility
|
2006-03-17 20:48:10 +00:00
|
|
|
inserts a short shell script at the beginning of the generated image,
|
2004-09-10 22:26:31 +00:00
|
|
|
which makes it possible to
|
2004-09-11 18:39:01 +00:00
|
|
|
.Dq run
|
|
|
|
the image just like any other shell script.
|
2006-03-17 20:48:10 +00:00
|
|
|
The script tries to load the
|
2004-09-10 22:26:31 +00:00
|
|
|
.Xr geom_uzip 4
|
2006-03-17 20:48:10 +00:00
|
|
|
class if it is not loaded, configure the image as an
|
2004-09-10 22:26:31 +00:00
|
|
|
.Xr md 4
|
|
|
|
disk device using
|
2006-03-17 20:48:10 +00:00
|
|
|
.Xr mdconfig 8 ,
|
|
|
|
and automatically mount it using
|
2004-09-10 22:26:31 +00:00
|
|
|
.Xr mount_cd9660 8
|
2006-03-17 20:48:10 +00:00
|
|
|
on the mount point provided as the first argument to the script.
|
2005-01-18 13:43:56 +00:00
|
|
|
.Sh EXIT STATUS
|
|
|
|
.Ex -std
|
2004-09-10 20:17:31 +00:00
|
|
|
.Sh SEE ALSO
|
|
|
|
.Xr gzip 1 ,
|
|
|
|
.Xr zlib 3 ,
|
2004-09-10 22:26:31 +00:00
|
|
|
.Xr geom 4 ,
|
2004-09-11 18:39:01 +00:00
|
|
|
.Xr geom_uzip 4 ,
|
2004-09-10 22:26:31 +00:00
|
|
|
.Xr md 4 ,
|
|
|
|
.Xr mdconfig 8 ,
|
2004-09-11 18:39:01 +00:00
|
|
|
.Xr mount_cd9660 8
|
2004-09-10 20:17:31 +00:00
|
|
|
.Sh AUTHORS
|
2004-09-11 18:39:01 +00:00
|
|
|
.An Maxim Sobolev Aq sobomax@FreeBSD.org
|