summaryrefslogtreecommitdiff
path: root/static/netbsd/man1/mkubootimage.1
blob: 792f9e1143b7163373dbdf042f9873567a40dbfd (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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
.\"	$NetBSD: mkubootimage.1,v 1.20 2024/05/22 00:02:46 uwe Exp $
.\"
.\" Copyright (c) 2012 The NetBSD Foundation, Inc.
.\" All rights reserved.
.\"
.\" This code is derived from software contributed to The NetBSD Foundation
.\" by Jeremy C. Reed
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
.\" are met:
.\" 1. Redistributions of source code must retain the above copyright
.\"    notice, this list of conditions and the following disclaimer.
.\" 2. Redistributions in binary form must reproduce the above copyright
.\"    notice, this list of conditions and the following disclaimer in the
.\"    documentation and/or other materials provided with the distribution.
.\"
.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
.\" PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
.\" POSSIBILITY OF SUCH DAMAGE.
.\"
.Dd May 21, 2024
.Dt MKUBOOTIMAGE 1
.Os
.Sh NAME
.Nm mkubootimage
.Nd create U-Boot loader image
.Sh SYNOPSIS
.Nm
.
.Op Fl hu
.
.Fl A Po Xo
.Li arm     Ns \||\| Ns
.Li arm64   Ns \||\| Ns
.Li i386    Ns \||\| Ns
.Li mips    Ns \||\| Ns
.Li mips64  Ns \||\| Ns
.Li or1k    Ns \||\| Ns
.Li powerpc Ns \||\| Ns
.Li riscv   Ns \||\| Ns
.Li sh
.Xc Pc
.
.br
.Fl a Ar address
.
.Oo Fl C Po Xo
.Li bz2  Ns \||\| Ns
.Li gz   Ns \||\| Ns
.Li lzma Ns \||\| Ns
.Li lzo  Ns \||\| Ns
.Li none
.Xc Pc Oc
.
.Op Fl E Ar address
.
.Op Fl e Ar address
.
.Oo Fl f Po Xo
.Li arm64 Ns \||\| Ns
.Li uimg
.Xc Pc Oc
.
.Op Fl m Ar magic
.
.Fl n Ar name
.
.br
.Oo Fl O Po Xo
.Li freebsd Ns \||\| Ns
.Li linux   Ns \||\| Ns
.Li netbsd  Ns \||\| Ns
.Li openbsd
.Xc Pc Oc
.
.br
.Fl T Po Xo
.Li fs            Ns \||\| Ns
.Li kernel        Ns \||\| Ns
.Li kernel_noload Ns \||\| Ns
.Li ramdisk       Ns \||\| Ns
.Li script        Ns \||\| Ns
.Li standalone
.Xc Pc
.
.Op Fl t Ar epoch
.
.Ar source destination
.\"
.Sh DESCRIPTION
The
.Nm
utility is used to create an image for Das U-Boot, the
.Qq Universal Boot Loader .
.Pp
The arguments are as follows:
.Bl -tag -width Fl
.
.It Fl A Po Xo
.Li arm     Ns \||\| Ns
.Li arm64   Ns \||\| Ns
.Li i386    Ns \||\| Ns
.Li mips    Ns \||\| Ns
.Li mips64  Ns \||\| Ns
.Li or1k    Ns \||\| Ns
.Li powerpc Ns \||\| Ns
.Li riscv   Ns \||\| Ns
.Li sh
.Xc Pc
Defines the architecture.
This is required for
.Ql uimg
format images.
.
.It Fl a Ar address
Sets the image load address.
This is an integer between 0 and
.Dv UINT32_MAX .
This is required for all
.Ql uimg
image types except for
.Li script , ramdisk ,
and
.Li kernel_noload .
.
.It Fl C Po Xo
.Li bz2  Ns \||\| Ns
.Li gz   Ns \||\| Ns
.Li lzma Ns \||\| Ns
.Li lzo  Ns \||\| Ns
.Li none
.Xc Pc
Defines the compression.
The default is
.Ql none .
.
.It Fl E Ar address
Define the entry point.
This is an integer between 0 and
.Dv UINT32_MAX .
This option is the same as
.Fl e
but it inverts the bytes to convert the 32 bit integer
from little to big endian (or vice versa).
If
.Fl E
or
.Fl e
are not set, the entry point defaults to the
image load address
.Pq Fl a .
.
.It Fl e Ar address
Define the entry point.
This is an integer between 0 and
.Dv UINT32_MAX .
If
.Fl E
or
.Fl e
are not set, the entry point defaults to the
image load address
.Pq Fl a .
.
.It Fl f Po Xo
.Li arm64 Ns \||\| Ns
.Li uimg
.Xc Pc
Defines the output image format type.
The default is
.Ql uimg .
.
.It Fl h
Display the usage and exit.
.
.It Fl m Ar magic
Set the magic used for
.Ql uimg
format images.
This is an integer between 0 and
.Dv UINT32_MAX .
The default is
.Ql 0x27051956 .
.
.It Fl n Ar name
Defines the image name.
This is required.
.
.It Fl O Po Xo
.Li freebsd Ns \||\| Ns
.Li linux   Ns \||\| Ns
.Li netbsd  Ns \||\| Ns
.Li openbsd
.Xc Pc
Defines the operating system type.
The default OS name is
.Ql netbsd .
.
.It Fl T Po Xo
.Li fs            Ns \||\| Ns
.Li kernel        Ns \||\| Ns
.Li kernel_noload Ns \||\| Ns
.Li ramdisk       Ns \||\| Ns
.Li script        Ns \||\| Ns
.Li standalone
.Xc Pc
Defines the image type.
This is required for
.Ql uimg
format images.
.
.It Fl t Ar epoch
Use given epoch timestamp as image creation time.
.Pq This is only used for legacy U-Boot images.
.
.It Fl u
Update the header in an existing file instead of creating a new one.
.
.El
.Pp
The required
.Ar source
argument is the filename of the kernel that is read.
The required
.Ar destination
argument is the filename of the image file that is created.
.\"
.Sh EXIT STATUS
.Nm
returns 1 on failure to read the kernel,
generate a header, or create the image.
.\"
.Sh EXAMPLES
Before the image is written, the header is displayed to standard out;
for example:
.Bd -literal -offset indent
 image type:  uimg
 magic:       0x27051956
 time:        Tue May 21 18:05:09 2024
 size:        137
 load addr:   0x00000000
 entry point: 0x00000000
 data crc:    0xface05f2
 os:          2 (netbsd)
 arch:        2 (arm)
 type:        6 (script)
 comp:        0 (none)
 name:        NetBSD/armv7 boot
 header crc:  0x2164b567
.Ed
.\" .Sh FILES
.Sh SEE ALSO
.Rs
.%T Das U-Boot \(en the Universal Boot Loader
.%U http://www.denx.de/wiki/U-Boot/
.Re
.\"
.\" .Sh STANDARDS
.\"
.Sh HISTORY
The
.Nm
command first appeared in
.Nx 6.0 .
.\"
.Sh AUTHORS
.An -nosplit
The
.Nm
utility was originally written by
.An Jared McNeill .
This manual page was written by
.An Jeremy C. Reed .
.\" .Sh CAVEATS
.\" .Sh BUGS
.\" .Sh SECURITY CONSIDERATIONS