]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - usr.sbin/kgzip/kgzip.8
Fix insufficient cryptodev MAC key length check.
[FreeBSD/FreeBSD.git] / usr.sbin / kgzip / kgzip.8
1 .\" Copyright (c) 1999 Global Technology Associates, Inc.
2 .\" All rights reserved.
3 .\"
4 .\" Redistribution and use in source and binary forms, with or without
5 .\" modification, are permitted provided that the following conditions
6 .\" are met:
7 .\" 1. Redistributions of source code must retain the above copyright
8 .\"    notice, this list of conditions and the following disclaimer.
9 .\" 2. Redistributions in binary form must reproduce the above copyright
10 .\"    notice, this list of conditions and the following disclaimer in the
11 .\"    documentation and/or other materials provided with the distribution.
12 .\"
13 .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS``AS IS'' AND
14 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
16 .\" PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS
17 .\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
18 .\" OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
19 .\" OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
20 .\" BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
21 .\" WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
22 .\" OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
23 .\" EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24 .\"
25 .\" $FreeBSD$
26 .\"
27 .Dd August 2, 2016
28 .Dt KGZIP 8
29 .Os
30 .Sh NAME
31 .Nm kgzip
32 .Nd compress a kernel
33 .Sh SYNOPSIS
34 .Nm
35 .Op Fl cv
36 .Op Fl f Ar format
37 .Op Fl l Ar loader
38 .Op Fl o Ar output
39 .Ar file
40 .Sh DESCRIPTION
41 .Bf -symbolic
42 This utility is deprecated.
43 Users are advised to use
44 .Xr loader 8
45 and compress the kernel with
46 .Xr gzip 1 .
47 .Ef
48 .Pp
49 The
50 .Nm
51 utility compresses a kernel or some other bootable binary.
52 Operation
53 is in two phases as follows:
54 .Bl -enum
55 .It
56 A load image of the executable file is built which omits all but
57 the
58 .Sq text
59 and
60 .Sq data
61 segments.
62 This image is compressed using
63 .Xr gzip 1
64 and output as data in relocatable object format.
65 .It
66 The object file is linked with a special self-hosting loader, producing
67 an executable suitable for booting with either the second- or
68 third-level bootstraps.
69 .El
70 .Pp
71 Supported object formats are 32-bit ELF and a.out ZMAGIC.
72 .Pp
73 If the
74 .Ar file
75 operand has a
76 .Sq .o
77 suffix, input is assumed to be for the link phase, and the first phase
78 is omitted.
79 .Pp
80 The options are:
81 .Bl -tag -width Fl
82 .It Fl c
83 Omit the link phase.
84 .It Fl v
85 Display object file information.
86 .It Fl f Ar format
87 Use
88 .Ar format
89 as the output format, where
90 .Ar format
91 is
92 .Sq aout
93 or
94 .Sq elf .
95 The default format is ELF.
96 .It Fl l Ar loader
97 Link
98 .Ar loader
99 as the loader.
100 .It Fl o Ar output
101 Name the output file
102 .Ar output .
103 The default is to use the input name with the suffix
104 .Sq .o
105 (for relocatables) or
106 .Sq .kgz
107 (for executables).
108 .El
109 .Sh NOTES
110 Global variables equivalent to the following are defined in the output:
111 .Bd -literal
112 struct kgz_hdr {
113     char        ident[4];       /* identification: "KGZ" */
114     uint32_t    dload;          /* decoded image load address */
115     uint32_t    dsize;          /* decoded image size */
116     uint32_t    isize;          /* image size in memory */
117     uint32_t    entry;          /* entry point */
118     uint32_t    nsize;          /* encoded image size */
119 } kgz;
120
121 uint8_t kgz_ndata[];            /* encoded data */
122 .Ed
123 .Pp
124 The encoded data is simply
125 .Xr gzip 1
126 output: a header (with no optional fields); compressed data; and 32-bit
127 CRC and size values.
128 .Sh FILES
129 .Bl -tag -width /usr/lib/kgzldr.o -compact
130 .It Pa /usr/lib/kgzldr.o
131 The default loader
132 .El
133 .Sh EXIT STATUS
134 .Ex -std
135 .Sh SEE ALSO
136 .Xr gzip 1 ,
137 .Xr ld 1 ,
138 .Xr a.out 5 ,
139 .Xr elf 5 ,
140 .Xr boot 8 ,
141 .Xr loader 8
142 .Sh AUTHORS
143 .An Robert Nordier Aq Mt rnordier@FreeBSD.org
144 .Sh BUGS
145 As symbols are lost, the usefulness of this utility for compressing
146 kernels is limited to situations where
147 .Xr loader 8
148 cannot be used.
149 .Pp
150 .Pa kgzldr.o
151 is only available for the i386 architecture.
152 .Pp
153 The preferred method of compressing a kernel
154 is simply to
155 .Xr gzip 1
156 it.