xref: /freebsd/usr.bin/mkuzip/mkuzip.8 (revision cf7b3b6562abd4afb6488cab09e68cb1de32acef)
17f4caa8cSMaxim Sobolev.\" ----------------------------------------------------------------------------
27f4caa8cSMaxim Sobolev.\" "THE BEER-WARE LICENSE" (Revision 42):
37f4caa8cSMaxim Sobolev.\" <sobomax@FreeBSD.ORG> wrote this file. As long as you retain this notice you
47f4caa8cSMaxim Sobolev.\" can do whatever you want with this stuff. If we meet some day, and you think
57f4caa8cSMaxim Sobolev.\" this stuff is worth it, you can buy me a beer in return.       Maxim Sobolev
67f4caa8cSMaxim Sobolev.\" ----------------------------------------------------------------------------
77f4caa8cSMaxim Sobolev.\"
87f4caa8cSMaxim Sobolev.\" $FreeBSD$
97f4caa8cSMaxim Sobolev.\"
10cf7b3b65SRuslan Ermilov.Dd September 10, 2004
11cf7b3b65SRuslan Ermilov.Dt MKUZIP 8
127f4caa8cSMaxim Sobolev.Os
137f4caa8cSMaxim Sobolev.Sh NAME
147f4caa8cSMaxim Sobolev.Nm mkuzip
1542ecdf05SMaxim Sobolev.Nd compress disk image for use with
167f4caa8cSMaxim Sobolev.Xr geom_uzip 4
1742ecdf05SMaxim Sobolevclass
187f4caa8cSMaxim Sobolev.Sh SYNOPSIS
197f4caa8cSMaxim Sobolev.Nm
207f4caa8cSMaxim Sobolev.Op Fl v
217f4caa8cSMaxim Sobolev.Op Fl o Ar outfile
227f4caa8cSMaxim Sobolev.Op Fl s Ar cluster_size
237f4caa8cSMaxim Sobolev.Ar infile
247f4caa8cSMaxim Sobolev.Sh DESCRIPTION
257f4caa8cSMaxim SobolevThe
267f4caa8cSMaxim Sobolev.Nm
277f4caa8cSMaxim Sobolevutility compresses a disk image file in such a way that the
287f4caa8cSMaxim Sobolev.Xr geom_uzip 4
2942ecdf05SMaxim Sobolevclass will be able to decompress resulting image in run-time.
3042ecdf05SMaxim SobolevThis allows for significant reduction of size of disk image at
3142ecdf05SMaxim Sobolevthe expense of some CPU time required to decompress the data each
32cf7b3b65SRuslan Ermilovtime it is read.
33cf7b3b65SRuslan ErmilovInternally, operation is done in two phases as follows:
347f4caa8cSMaxim Sobolev.Bl -enum
357f4caa8cSMaxim Sobolev.It
367f4caa8cSMaxim SobolevAn
377f4caa8cSMaxim Sobolev.Ar infile
387f4caa8cSMaxim Sobolevimage is split into clusters and each cluster compressed using
397f4caa8cSMaxim Sobolev.Xr zlib 3 .
407f4caa8cSMaxim Sobolev.It
4142ecdf05SMaxim SobolevResulting set of compressed clusters along with headers allowing to
427f4caa8cSMaxim Sobolevindependently locate each individual cluster is written into
437f4caa8cSMaxim Sobolevoutput file.
447f4caa8cSMaxim Sobolev.El
457f4caa8cSMaxim Sobolev.Pp
467f4caa8cSMaxim SobolevThe options are:
47cf7b3b65SRuslan Ermilov.Bl -tag -width indent
487f4caa8cSMaxim Sobolev.It Fl o Ar outfile
497f4caa8cSMaxim SobolevName the output file
507f4caa8cSMaxim Sobolev.Ar outfile .
517f4caa8cSMaxim SobolevThe default is to use the input name with the suffix
52cf7b3b65SRuslan Ermilov.Pa .uzip .
537f4caa8cSMaxim Sobolev.It Fl s Ar cluster_size
547f4caa8cSMaxim SobolevUse
557f4caa8cSMaxim Sobolev.Ar cluster_size
56cf7b3b65SRuslan Ermilovas the size of chunks the file being split up into.
57cf7b3b65SRuslan ErmilovDefault value is 16384 bytes.
58cf7b3b65SRuslan ErmilovThe
597f4caa8cSMaxim Sobolev.Ar cluster_size
60cf7b3b65SRuslan Ermilovshould be a multiple of 512 bytes.
617f4caa8cSMaxim Sobolev.It Fl v
627f4caa8cSMaxim SobolevDisplay verbose messages.
637f4caa8cSMaxim Sobolev.El
647f4caa8cSMaxim Sobolev.Sh NOTES
65cf7b3b65SRuslan ErmilovCompression ratio largely depends on the cluster size used.
66cf7b3b65SRuslan ErmilovFor large cluster sizes (16K and higher), typical compression ratios
677f4caa8cSMaxim Sobolevare only 1-2% less than those achieved with the
687f4caa8cSMaxim Sobolev.Xr gzip 1
69cf7b3b65SRuslan Ermilovutlity.
70cf7b3b65SRuslan ErmilovHowever, it should be kept in mind that larger cluster
717f4caa8cSMaxim Sobolevsizes lead to higher overhead in the
727f4caa8cSMaxim Sobolev.Xr geom_uzip 4
737f4caa8cSMaxim Sobolevclass, as the class has to decompress the whole cluster even if
7442ecdf05SMaxim Sobolevonly several bytes from that cluster have to be read.
7542ecdf05SMaxim Sobolev.Pp
7642ecdf05SMaxim SobolevThe
7742ecdf05SMaxim Sobolev.Nm
7842ecdf05SMaxim Sobolevinserts tiny shell script at the beginning of the generated image,
7942ecdf05SMaxim Sobolevwhich makes it possible to
80cf7b3b65SRuslan Ermilov.Dq run
81cf7b3b65SRuslan Ermilovthe image just like any other shell script.
82cf7b3b65SRuslan ErmilovThis script tries
8342ecdf05SMaxim Sobolevto load
8442ecdf05SMaxim Sobolev.Xr geom_uzip 4
85cf7b3b65SRuslan Ermilovclass if it is not loaded, configure image as an
8642ecdf05SMaxim Sobolev.Xr md 4
8742ecdf05SMaxim Sobolevdisk device using
8842ecdf05SMaxim Sobolev.Xr mdconfig 8
89cf7b3b65SRuslan Ermilovutility, and automatically mount it using
9042ecdf05SMaxim Sobolev.Xr mount_cd9660 8
9142ecdf05SMaxim Sobolevutility to the mount point provided as a first argument.
927f4caa8cSMaxim Sobolev.Sh SEE ALSO
937f4caa8cSMaxim Sobolev.Xr gzip 1 ,
947f4caa8cSMaxim Sobolev.Xr zlib 3 ,
9542ecdf05SMaxim Sobolev.Xr geom 4 ,
96cf7b3b65SRuslan Ermilov.Xr geom_uzip 4 ,
9742ecdf05SMaxim Sobolev.Xr md 4 ,
9842ecdf05SMaxim Sobolev.Xr mdconfig 8 ,
99cf7b3b65SRuslan Ermilov.Xr mount_cd9660 8
1007f4caa8cSMaxim Sobolev.Sh DIAGNOSTICS
101cf7b3b65SRuslan Ermilov.Ex -std
1027f4caa8cSMaxim Sobolev.Sh AUTHORS
103cf7b3b65SRuslan Ermilov.An Maxim Sobolev Aq sobomax@FreeBSD.org
104