1.\" $NetBSD: mkubootimage.1,v 1.14 2019/12/07 12:34:17 wiz Exp $ 2.\" 3.\" Copyright (c) 2012 The NetBSD Foundation, Inc. 4.\" All rights reserved. 5.\" 6.\" This code is derived from software contributed to The NetBSD Foundation 7.\" by Jeremy C. Reed 8.\" 9.\" Redistribution and use in source and binary forms, with or without 10.\" modification, are permitted provided that the following conditions 11.\" are met: 12.\" 1. Redistributions of source code must retain the above copyright 13.\" notice, this list of conditions and the following disclaimer. 14.\" 2. Redistributions in binary form must reproduce the above copyright 15.\" notice, this list of conditions and the following disclaimer in the 16.\" documentation and/or other materials provided with the distribution. 17.\" 18.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS 19.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 20.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 21.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 22.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 23.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 24.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 26.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28.\" POSSIBILITY OF SUCH DAMAGE. 29.\" 30.Dd December 4, 2019 31.Dt MKUBOOTIMAGE 1 32.Os 33.Sh NAME 34.Nm mkubootimage 35.Nd create U-Boot loader image 36.Sh SYNOPSIS 37.Nm 38.Op Fl hu 39.Fl A No ( arm Ns | Ns arm64 Ns | Ns i386 Ns | Ns mips Ns | Ns mips64 Ns | Ns or1k Ns | Ns powerpc Ns | Ns sh ) 40.Fl a Ar address 41.Op Fl C Po bz2 Ns | Ns gz Ns | Ns lzma Ns | Ns lzo Ns | Ns none Pc 42.Op Fl E Ar address 43.Op Fl e Ar address 44.Op Fl f Po arm64 Ns | Ns uimg Pc 45.Op Fl m Ar magic 46.Fl n Ar image 47.Op Fl O Po freebsd Ns | Ns linux Ns | Ns netbsd Ns | Ns openbsd Pc 48.Fl T No ( fs Ns | Ns kernel Ns | Ns kernel_noload Ns | Ns ramdisk Ns | Ns script Ns | Ns standalone ) 49.Ar source destination 50.\" 51.Sh DESCRIPTION 52The 53.Nm 54utility is used to create an image for Das U-Boot, the 55.Qq Universal Boot Loader . 56.Pp 57The arguments are as follows: 58.Bl -tag -width indent 59.It Fl A No ( arm Ns | Ns arm64 Ns | Ns i386 Ns | Ns mips Ns | Ns mips64 Ns | Ns or1k Ns | Ns powerpc Ns | Ns sh ) 60Defines the architecture. 61This is required for 62.Qq uimg 63format images. 64.It Fl a Ar address 65Sets the image load address. 66This is an integer between 0 and 67.Dv UINT32_MAX . 68This is required for all 69.Qq uimg 70image types except for script, ramdisk, and kernel_noload. 71.It Fl C No ( bz2 Ns | Ns gz Ns | Ns lzma Ns | Ns lzo Ns | Ns none ) 72Defines the compression. 73The default is 74.Qq none . 75.It Fl E Ar address 76Define the entry point. 77This is an integer between 0 and 78.Dv UINT32_MAX . 79This option is the same as 80.Fl e 81but it inverts the bytes to convert the 32 bit integer 82from little to big endian (or vice versa). 83If 84.Fl E 85or 86.Fl e 87are not set, the entry point defaults to the 88image load address 89.Pq Fl a . 90.It Fl e Ar address 91Define the entry point. 92This is an integer between 0 and 93.Dv UINT32_MAX . 94If 95.Fl E 96or 97.Fl e 98are not set, the entry point defaults to the 99image load address 100.Pq Fl a . 101.It Fl f No ( arm64 Ns | Ns uimg ) 102Defines the output image format type. 103The default is 104.Qq uimg . 105.It Fl h 106Display the usage and exit. 107.It Fl m Ar magic 108Set the magic used for 109.Qq uimg 110format images. 111This is an integer between 0 and 112.Dv UINT32_MAX . 113The default is 114.Qq 0x27051956 . 115.It Fl n Ar image 116Defines the image name. 117This is required. 118.It Fl O No ( freebsd Ns | Ns linux Ns | Ns netbsd Ns | Ns openbsd ) 119Defines the operating system type. 120The default OS name is 121.Qq netbsd . 122.It Fl T No ( fs Ns | Ns kernel Ns | Ns kernel_noload Ns | Ns ramdisk Ns | Ns script Ns | Ns standalone ) 123Defines the image type. 124This is required for 125.Qq uimg 126format images. 127.It Fl u 128Update the header in an existing file instead of creating a new one. 129.El 130.Pp 131The required 132.Ar source 133argument is the filename of the kernel that is read. 134The required 135.Ar destination 136argument is the filename of the image file that is created. 137.\" 138.Sh EXIT STATUS 139.Nm 140returns 1 on failure to read the kernel, 141generate a header, or create the image. 142.\" 143.Sh EXAMPLES 144Before the image is written, the header is displayed to standard out; 145for example: 146.Bd -literal -offset 0 147 magic: 0x27051956 148 time: Tue Jun 7 15:58:41 2011 149 size: 2482203 150 load addr: 0x00020000 151 entry point: 0x00020000 152 data crc: 0x700fdf53 153 os: 2 (netbsd) 154 arch: 7 (powerpc) 155 type: 2 (kernel) 156 comp: 1 (gz) 157 name: NetBSD/evbppc 5.99.52 (INSTALL_PMPPC) 158 header crc: 0x94ea96cf 159.Ed 160.\" TODO: check the name line above 161.\" .Sh FILES 162.Sh SEE ALSO 163.Qq Das U-Boot - the Universal Boot Loader 164.Pa http://www.denx.de/wiki/U-Boot/ 165.\" 166.\" .Sh STANDARDS 167.\" 168.Sh HISTORY 169The 170.Nm 171command first appeared in 172.Nx 6.0 . 173.\" 174.Sh AUTHORS 175.An -nosplit 176The 177.Nm 178utility was originally written by 179.An Jared McNeill . 180This manual page was written by 181.An Jeremy C. Reed . 182.\" .Sh CAVEATS 183.\" .Sh BUGS 184.\" .Sh SECURITY CONSIDERATIONS 185