Sync usage with man page, merge single letter options. Limit program usage line length.diff -r1.13 -r1.14 src/usr.bin/mkubootimage/mkubootimage.1
(wiz)
--- src/usr.bin/mkubootimage/mkubootimage.1 2019/12/04 11:21:34 1.13
+++ src/usr.bin/mkubootimage/mkubootimage.1 2019/12/07 12:34:17 1.14
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | .\" $NetBSD: mkubootimage.1,v 1.13 2019/12/04 11:21:34 jmcneill Exp $ | 1 | .\" $NetBSD: mkubootimage.1,v 1.14 2019/12/07 12:34:17 wiz Exp $ | |
2 | .\" | 2 | .\" | |
3 | .\" Copyright (c) 2012 The NetBSD Foundation, Inc. | 3 | .\" Copyright (c) 2012 The NetBSD Foundation, Inc. | |
4 | .\" All rights reserved. | 4 | .\" All rights reserved. | |
5 | .\" | 5 | .\" | |
6 | .\" This code is derived from software contributed to The NetBSD Foundation | 6 | .\" This code is derived from software contributed to The NetBSD Foundation | |
7 | .\" by Jeremy C. Reed | 7 | .\" by Jeremy C. Reed | |
8 | .\" | 8 | .\" | |
9 | .\" Redistribution and use in source and binary forms, with or without | 9 | .\" Redistribution and use in source and binary forms, with or without | |
10 | .\" modification, are permitted provided that the following conditions | 10 | .\" modification, are permitted provided that the following conditions | |
11 | .\" are met: | 11 | .\" are met: | |
12 | .\" 1. Redistributions of source code must retain the above copyright | 12 | .\" 1. Redistributions of source code must retain the above copyright | |
13 | .\" notice, this list of conditions and the following disclaimer. | 13 | .\" notice, this list of conditions and the following disclaimer. | |
14 | .\" 2. Redistributions in binary form must reproduce the above copyright | 14 | .\" 2. Redistributions in binary form must reproduce the above copyright | |
@@ -25,51 +25,50 @@ | @@ -25,51 +25,50 @@ | |||
25 | .\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | 25 | .\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | |
26 | .\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | 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 | 27 | .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | |
28 | .\" POSSIBILITY OF SUCH DAMAGE. | 28 | .\" POSSIBILITY OF SUCH DAMAGE. | |
29 | .\" | 29 | .\" | |
30 | .Dd December 4, 2019 | 30 | .Dd December 4, 2019 | |
31 | .Dt MKUBOOTIMAGE 1 | 31 | .Dt MKUBOOTIMAGE 1 | |
32 | .Os | 32 | .Os | |
33 | .Sh NAME | 33 | .Sh NAME | |
34 | .Nm mkubootimage | 34 | .Nm mkubootimage | |
35 | .Nd create U-Boot loader image | 35 | .Nd create U-Boot loader image | |
36 | .Sh SYNOPSIS | 36 | .Sh SYNOPSIS | |
37 | .Nm | 37 | .Nm | |
38 | .Op Fl h | 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 ) | 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 | 40 | .Fl a Ar address | |
41 | .Op Fl C Po bz2 Ns | Ns gz Ns | Ns lzma Ns | Ns lzo Ns | Ns none Pc | 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 | 42 | .Op Fl E Ar address | |
43 | .Op Fl e Ar address | 43 | .Op Fl e Ar address | |
44 | .Op Fl f Po arm64 Ns | Ns uimg Pc | 44 | .Op Fl f Po arm64 Ns | Ns uimg Pc | |
45 | .Op Fl m Ar magic | 45 | .Op Fl m Ar magic | |
46 | .Fl n Ar image | 46 | .Fl n Ar image | |
47 | .Op Fl O Po freebsd Ns | Ns linux Ns | Ns netbsd Ns | Ns openbsd Pc | 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 standalone ) | 48 | .Fl T No ( fs Ns | Ns kernel Ns | Ns kernel_noload Ns | Ns ramdisk Ns | Ns script Ns | Ns standalone ) | |
49 | .Op Fl u | |||
50 | .Ar source destination | 49 | .Ar source destination | |
51 | .\" | 50 | .\" | |
52 | .Sh DESCRIPTION | 51 | .Sh DESCRIPTION | |
53 | The | 52 | The | |
54 | .Nm | 53 | .Nm | |
55 | utility is used to create an image for Das U-Boot, the | 54 | utility is used to create an image for Das U-Boot, the | |
56 | .Qq Universal Boot Loader . | 55 | .Qq Universal Boot Loader . | |
57 | .Pp | 56 | .Pp | |
58 | The arguments are as follows: | 57 | The arguments are as follows: | |
59 | .Bl -tag -width indent | 58 | .Bl -tag -width indent | |
60 | .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 ) | 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 ) | |
61 | Defines the architecture. | 60 | Defines the architecture. | |
62 | This is required for | 61 | This is required for | |
63 | .Qq uimg | 62 | .Qq uimg | |
64 | format images. | 63 | format images. | |
65 | .It Fl a Ar address | 64 | .It Fl a Ar address | |
66 | Sets the image load address. | 65 | Sets the image load address. | |
67 | This is an integer between 0 and | 66 | This is an integer between 0 and | |
68 | .Dv UINT32_MAX . | 67 | .Dv UINT32_MAX . | |
69 | This is required for all | 68 | This is required for all | |
70 | .Qq uimg | 69 | .Qq uimg | |
71 | image types except for script, ramdisk, and kernel_noload. | 70 | image types except for script, ramdisk, and kernel_noload. | |
72 | .It Fl C No ( bz2 Ns | Ns gz Ns | Ns lzma Ns | Ns lzo Ns | Ns none ) | 71 | .It Fl C No ( bz2 Ns | Ns gz Ns | Ns lzma Ns | Ns lzo Ns | Ns none ) | |
73 | Defines the compression. | 72 | Defines the compression. | |
74 | The default is | 73 | The default is | |
75 | .Qq none . | 74 | .Qq none . | |
@@ -110,27 +109,27 @@ Set the magic used for | @@ -110,27 +109,27 @@ Set the magic used for | |||
110 | .Qq uimg | 109 | .Qq uimg | |
111 | format images. | 110 | format images. | |
112 | This is an integer between 0 and | 111 | This is an integer between 0 and | |
113 | .Dv UINT32_MAX . | 112 | .Dv UINT32_MAX . | |
114 | The default is | 113 | The default is | |
115 | .Qq 0x27051956 . | 114 | .Qq 0x27051956 . | |
116 | .It Fl n Ar image | 115 | .It Fl n Ar image | |
117 | Defines the image name. | 116 | Defines the image name. | |
118 | This is required. | 117 | This is required. | |
119 | .It Fl O No ( freebsd Ns | Ns linux Ns | Ns netbsd Ns | Ns openbsd ) | 118 | .It Fl O No ( freebsd Ns | Ns linux Ns | Ns netbsd Ns | Ns openbsd ) | |
120 | Defines the operating system type. | 119 | Defines the operating system type. | |
121 | The default OS name is | 120 | The default OS name is | |
122 | .Qq netbsd . | 121 | .Qq netbsd . | |
123 | .It Fl T No ( fs Ns | Ns kernel Ns | Ns kernel_noload Ns | Ns ramdisk Ns | Ns standalone Ns | Ns script ) | 122 | .It Fl T No ( fs Ns | Ns kernel Ns | Ns kernel_noload Ns | Ns ramdisk Ns | Ns script Ns | Ns standalone ) | |
124 | Defines the image type. | 123 | Defines the image type. | |
125 | This is required for | 124 | This is required for | |
126 | .Qq uimg | 125 | .Qq uimg | |
127 | format images. | 126 | format images. | |
128 | .It Fl u | 127 | .It Fl u | |
129 | Update the header in an existing file instead of creating a new one. | 128 | Update the header in an existing file instead of creating a new one. | |
130 | .El | 129 | .El | |
131 | .Pp | 130 | .Pp | |
132 | The required | 131 | The required | |
133 | .Ar source | 132 | .Ar source | |
134 | argument is the filename of the kernel that is read. | 133 | argument is the filename of the kernel that is read. | |
135 | The required | 134 | The required | |
136 | .Ar destination | 135 | .Ar destination |
--- src/usr.bin/mkubootimage/mkubootimage.c 2019/12/04 14:09:47 1.26
+++ src/usr.bin/mkubootimage/mkubootimage.c 2019/12/07 12:34:17 1.27
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: mkubootimage.c,v 1.26 2019/12/04 14:09:47 jmcneill Exp $ */ | 1 | /* $NetBSD: mkubootimage.c,v 1.27 2019/12/07 12:34:17 wiz Exp $ */ | |
2 | 2 | |||
3 | /*- | 3 | /*- | |
4 | * Copyright (c) 2010 Jared D. McNeill <jmcneill@invisible.ca> | 4 | * Copyright (c) 2010 Jared D. McNeill <jmcneill@invisible.ca> | |
5 | * All rights reserved. | 5 | * All rights reserved. | |
6 | * | 6 | * | |
7 | * Redistribution and use in source and binary forms, with or without | 7 | * Redistribution and use in source and binary forms, with or without | |
8 | * modification, are permitted provided that the following conditions | 8 | * modification, are permitted provided that the following conditions | |
9 | * are met: | 9 | * are met: | |
10 | * 1. Redistributions of source code must retain the above copyright | 10 | * 1. Redistributions of source code must retain the above copyright | |
11 | * notice, this list of conditions and the following disclaimer. | 11 | * notice, this list of conditions and the following disclaimer. | |
12 | * 2. The name of the author may not be used to endorse or promote products | 12 | * 2. The name of the author may not be used to endorse or promote products | |
13 | * derived from this software without specific prior written permission. | 13 | * derived from this software without specific prior written permission. | |
14 | * | 14 | * | |
@@ -20,27 +20,27 @@ | @@ -20,27 +20,27 @@ | |||
20 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | 20 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | |
21 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED | 21 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED | |
22 | * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | 22 | * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | |
23 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | 23 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | |
24 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | 24 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | |
25 | * SUCH DAMAGE. | 25 | * SUCH DAMAGE. | |
26 | */ | 26 | */ | |
27 | 27 | |||
28 | #if HAVE_NBTOOL_CONFIG_H | 28 | #if HAVE_NBTOOL_CONFIG_H | |
29 | #include "nbtool_config.h" | 29 | #include "nbtool_config.h" | |
30 | #endif | 30 | #endif | |
31 | 31 | |||
32 | #include <sys/cdefs.h> | 32 | #include <sys/cdefs.h> | |
33 | __RCSID("$NetBSD: mkubootimage.c,v 1.26 2019/12/04 14:09:47 jmcneill Exp $"); | 33 | __RCSID("$NetBSD: mkubootimage.c,v 1.27 2019/12/07 12:34:17 wiz Exp $"); | |
34 | 34 | |||
35 | #include <sys/mman.h> | 35 | #include <sys/mman.h> | |
36 | #include <sys/stat.h> | 36 | #include <sys/stat.h> | |
37 | #include <sys/endian.h> | 37 | #include <sys/endian.h> | |
38 | #include <sys/param.h> | 38 | #include <sys/param.h> | |
39 | #include <sys/uio.h> | 39 | #include <sys/uio.h> | |
40 | #include <err.h> | 40 | #include <err.h> | |
41 | #include <errno.h> | 41 | #include <errno.h> | |
42 | #include <fcntl.h> | 42 | #include <fcntl.h> | |
43 | #include <inttypes.h> | 43 | #include <inttypes.h> | |
44 | #include <limits.h> | 44 | #include <limits.h> | |
45 | #include <stdint.h> | 45 | #include <stdint.h> | |
46 | #include <stdio.h> | 46 | #include <stdio.h> | |
@@ -254,34 +254,32 @@ get_comp_name(enum uboot_image_comp comp | @@ -254,34 +254,32 @@ get_comp_name(enum uboot_image_comp comp | |||
254 | unsigned int i; | 254 | unsigned int i; | |
255 | 255 | |||
256 | for (i = 0; i < __arraycount(uboot_comp); i++) { | 256 | for (i = 0; i < __arraycount(uboot_comp); i++) { | |
257 | if (uboot_comp[i].comp == comp) | 257 | if (uboot_comp[i].comp == comp) | |
258 | return uboot_comp[i].name; | 258 | return uboot_comp[i].name; | |
259 | } | 259 | } | |
260 | 260 | |||
261 | return "Unknown"; | 261 | return "Unknown"; | |
262 | } | 262 | } | |
263 | 263 | |||
264 | __dead static void | 264 | __dead static void | |
265 | usage(void) | 265 | usage(void) | |
266 | { | 266 | { | |
267 | fprintf(stderr, "usage: mkubootimage -A " | 267 | fprintf(stderr, "usage: mkubootimage [-hu] -A " | |
268 | "<arm|arm64|i386|mips|mips64|or1k|powerpc|sh>"); | 268 | "<arm|arm64|i386|mips|mips64|or1k|powerpc|sh> -a address\n"); | |
269 | fprintf(stderr, " -C <none|bz2|gz|lzma|lzo>"); | 269 | fprintf(stderr, "\t-C <bz2|gz|lzma|lzo|none> [-E address] [-e address]\n"); | |
270 | fprintf(stderr, " -O <openbsd|netbsd|freebsd|linux>"); | 270 | fprintf(stderr, "\t[-f <arm64|uimg>] [-m magic] -n image -O <freebsd|linux|netbsd|openbsd>\n"); | |
271 | fprintf(stderr, " -T <standalone|kernel|kernel_noload|ramdisk|fs|script>"); | 271 | fprintf(stderr, "\t-T <fs|kernel|kernel_noload|ramdisk|script|standalone>\n"); | |
272 | fprintf(stderr, " -a <addr> [-e <ep>] [-m <magic>] -n <name>"); | 272 | fprintf(stderr, "\tsource destination\n"); | |
273 | fprintf(stderr, " [-f <uimg|arm64>] [-u]"); | |||
274 | fprintf(stderr, " <srcfile> <dstfile>\n"); | |||
275 | 273 | |||
276 | exit(EXIT_FAILURE); | 274 | exit(EXIT_FAILURE); | |
277 | } | 275 | } | |
278 | 276 | |||
279 | static void | 277 | static void | |
280 | dump_header_uimg(struct uboot_image_header *hdr) | 278 | dump_header_uimg(struct uboot_image_header *hdr) | |
281 | { | 279 | { | |
282 | time_t tm = ntohl(hdr->ih_time); | 280 | time_t tm = ntohl(hdr->ih_time); | |
283 | 281 | |||
284 | printf(" magic: 0x%08x\n", ntohl(hdr->ih_magic)); | 282 | printf(" magic: 0x%08x\n", ntohl(hdr->ih_magic)); | |
285 | printf(" time: %s", ctime(&tm)); | 283 | printf(" time: %s", ctime(&tm)); | |
286 | printf(" size: %u\n", ntohl(hdr->ih_size)); | 284 | printf(" size: %u\n", ntohl(hdr->ih_size)); | |
287 | printf(" load addr: 0x%08x\n", ntohl(hdr->ih_load)); | 285 | printf(" load addr: 0x%08x\n", ntohl(hdr->ih_load)); |