summaryrefslogtreecommitdiffstats
path: root/usr.bin/mkuzip/mkuzip.8
blob: 35bd2e808da7c385c88e324438649001319396c8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
.\" ----------------------------------------------------------------------------
.\" "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 September 10, 2004
.Dt MKUZIP 8
.Os
.Sh NAME
.Nm mkuzip
.Nd compress disk image for use with
.Xr geom_uzip 4
class
.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.
This allows for significant reduction of size of disk image 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 compressed clusters along with headers allowing to
independently locate each individual cluster is written into
output file.
.El
.Pp
The options are:
.Bl -tag -width indent
.It Fl o Ar outfile
Name the output file
.Ar outfile .
The default is to use the input name with the suffix
.Pa .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 16384 bytes.
The
.Ar cluster_size
should be a multiple of 512 bytes.
.It Fl v
Display verbose messages.
.El
.Sh NOTES
Compression ratio largely depends on the cluster size used.
For large cluster sizes (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
only several bytes from that cluster have to be read.
.Pp
The
.Nm
inserts tiny shell script at the beginning of the generated image,
which makes it possible to
.Dq run
the image just like any other shell script.
This script tries
to load
.Xr geom_uzip 4
class if it is not loaded, configure image as an
.Xr md 4
disk device using
.Xr mdconfig 8
utility, and automatically mount it using
.Xr mount_cd9660 8
utility to the mount point provided as a first argument.
.Sh EXIT STATUS
.Ex -std
.Sh SEE ALSO
.Xr gzip 1 ,
.Xr zlib 3 ,
.Xr geom 4 ,
.Xr geom_uzip 4 ,
.Xr md 4 ,
.Xr mdconfig 8 ,
.Xr mount_cd9660 8
.Sh AUTHORS
.An Maxim Sobolev Aq sobomax@FreeBSD.org
OpenPOWER on IntegriCloud