doc: mkimage: Rework and refactor the man page; add long options
v2 cover doc: mkimage: Rework and refactor the man page; add long options
This gives a facelift for the mkimage man page, bringing it in line with the style perscribed by man-pages(7) and groff_man_style(7). I have tried to remove typographical and grammatical errors and inconsistencies wherever possible. The man page now both looks and feels closer to other Linux man pages. As a bonus, I also added a man page for dumpimage in the same style.
To address the impending exhaustion of short options, this also adds long options for each short option.
Changes in v2:
- Add long options
- Better document multi images
- Document -h and -V
- Ensure comments are requests
- Escape minus signs in examples
- Fix -B not being bolded in the description for -R
- Fix extra quote in -E synopsis
- Fix spacing for -F
- Further document -o and -R
- Indent things more robustly
- Italicize parameter for -d
- Make lists of valid algos bold
- Rearrange more options
- Remove spaces around pipes
- Rename first subsection to "General options"
- Use escape-sequences for options width all three of B/I/R. This renders better with mandoc.
- Use paired quotation marks
Sean Anderson (14):
doc: mkimage: Use standard style for synopsis
doc: mkimage: Use empty request instead of blank lines
doc: mkimage: Reformat examples
doc: mkimage: Regularize option documentation
doc: mkimage: Use subsection macro
doc: mkimage: Rearrange/remove some options
doc: mkimage: Use correct capitalization for NAME
doc: mkimage: Edit options for style and consistency
doc: mkimage: Add BUGS section
doc: mkimage: Add SEE ALSO section
doc: mkimage: Remove AUTHORS section
mkimage: Add long options
doc: mkimage: Further document -o and -R
doc: Add man page for dumpimage
doc/dumpimage.1 | 103 ++++++ doc/mkimage.1 | 933 ++++++++++++++++++++++++++++++++++-------------- tools/mkimage.c | 45 ++- 3 files changed, 811 insertions(+), 270 deletions(-) create mode 100644 doc/dumpimage.1
Signature · 1 line
2.35.1
PATCH v2 1/14 doc: mkimage: Use standard style for synopsis
The synopsis section is a bit messy. As an example, "uimage file name" is printed in italics, bold, and roman (depending on the line). This cleans things up and converts the synopsis section to use standard style. The .SY/.YS macros set up appropriate fomatting for command synopsis sections (such as disabling hyphenation and setting a hanging indent). All parts of the synopsis now use the following style:
- Bold for parts of the command which should be typed in by the user (such as the program name and flags)
- Italic for parts which should be replaced (such as uimage-file-name)
- Roman for parts which should not be typed at all (such as brackets)
Multi-word variables now use hyphens to connect their words instead of spaces. This makes it clearer that all the words are part of the same variable. Additionally, "option ..." is used to denote where other options may be specified, as this appears to be standard style.
---
Changes in v2:
- Fix spacing for -F
doc/mkimage.1 | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-)
doc/mkimage.1 +18 -8
@@ -3,17 +3,27 @@ .SH NAME mkimage \- Generate image for U-Boot .SH SYNOPSIS -.B mkimage -.RB [ \-T " \fItype\fP] " \-l " [\fIuimage file name\fP]" +.SY mkimage +.OP \-T type +.BI \-l\~ image-file-name +.YS -.B mkimage -.RB [\fIoptions\fP] " \-f [" "image tree source file" "]" " [" "uimage file name" "]" +.SY mkimage +.RI [ option\~ .\|.\|.\&] +.BI \-f\~ image-tree-source-file\c +.RB | auto +.I image-file-name +.YS -.B mkimage -.RB [\fIoptions\fP] " \-F [" "uimage file name" "]" +.SY mkimage +.RI [ option\~ .\|.\|.\&] +.BI \-F\~ image-file-name +.YS -.B mkimage -.RB [\fIoptions\fP] " (legacy mode)" +.SY mkimage +.RI [ option\~ .\|.\|.\&] +.R (legacy mode) +.YS .SH "DESCRIPTION" The
Signature · 1 line
2.35.1
Re: [PATCH v2 01/14] doc: mkimage: Use standard style for synopsis
Quoted 4 lines · Sean Anderson
The synopsis section is a bit messy. As an example, "uimage file name" is printed in italics, bold, and roman (depending on the line). This cleans things up and converts the synopsis section to use standard style. The .SY/.YS macros set up appropriate fomatting for command synopsis sections
nits:
%s/fomatting/formatting/
Quoted 27 lines
(such as disabling hyphenation and setting a hanging indent). All parts of the synopsis now use the following style:
- Bold for parts of the command which should be typed in by the user (such as the program name and flags)
- Italic for parts which should be replaced (such as uimage-file-name)
- Roman for parts which should not be typed at all (such as brackets)Multi-word variables now use hyphens to connect their words instead of spaces. This makes it clearer that all the words are part of the same variable. Additionally, "option ..." is used to denote where other options may be specified, as this appears to be standard style.
Signed-off-by Sean Anderson <[email protected]>---
Changes in v2:
- Fix spacing for -Fdoc/mkimage.1 | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-)doc/mkimage.1 +0
-0
doc/mkimage.1 line 7
Quoted 5 lines
doc/mkimage.1 +0
-2@@ -3,17 +3,27 @@ .SH NAME mkimage \- Generate image for U-Boot .SH SYNOPSIS -.B mkimage -.RB [ \-T " \fItype\fP] " \-l " [\fIuimage file name\fP]"
mkimage -T script -l boot.scr
is illegal. Why did you add '-T type'?
doc/mkimage.1 line 8
Quoted 3 lines
doc/mkimage.1 +3
-0+.SY mkimage +.OP \-T type +.BI \-l\~ image-file-name
Replacing uimage by image seems to be correct. But you could mention it in the commit message.
doc/mkimage.1 line 14
Quoted 8 lines
doc/mkimage.1 +5
-2+.YS -.B mkimage -.RB [\fIoptions\fP] " \-f [" "image tree source file" "]" " [" "uimage file name" "]" +.SY mkimage +.RI [ option\~ .\|.\|.\&] +.BI \-f\~ image-tree-source-file\c +.RB | auto
Adding 'auto' is also not mentioned in the commit message.
Quoted 5 lines
doc/mkimage.1 +2
-2+.I image-file-name +.YS -.B mkimage -.RB [\fIoptions\fP] " \-F [" "uimage file name" "]"
doc/mkimage.1 line 25
Quoted 10 lines
doc/mkimage.1 +7
-2+.SY mkimage +.RI [ option\~ .\|.\|.\&] +.BI \-F\~ image-file-name +.YS -.B mkimage -.RB [\fIoptions\fP] " (legacy mode)" +.SY mkimage +.RI [ option\~ .\|.\|.\&] +.R (legacy mode)
(legacy mode) is not an argument. So it should not appear in the synopsis
The last addition of an image type has commit date 2022-04-04 (IH_TYPE_SUNXI_TOC0). The term 'legacy mode' for everything that is not FIT is misleading and should be avoided.
doc/mkimage.1 line 29
Quoted 4 lines
doc/mkimage.1 +1
-0+.YS .SH "DESCRIPTION" The
The following command is not covered by any entry in the synopsis:
mkimage -T script -n GRUB -d boot.txt boot.scr
The synopsis lacks an entry
mkimage -T type [options] image-file-name
Best regards
Heinrich
Re: [PATCH v2 01/14] doc: mkimage: Use standard style for synopsis
Quoted 44 lines · Heinrich Schuchardt
Quoted 4 lines · Sean Anderson
The synopsis section is a bit messy. As an example, "uimage file name" is printed in italics, bold, and roman (depending on the line). This cleans things up and converts the synopsis section to use standard style. The .SY/.YS macros set up appropriate fomatting for command synopsis sections
nits:
%s/fomatting/formatting/Quoted 27 lines
(such as disabling hyphenation and setting a hanging indent). All parts of the synopsis now use the following style:
- Bold for parts of the command which should be typed in by the user (such as the program name and flags)
- Italic for parts which should be replaced (such as uimage-file-name)
- Roman for parts which should not be typed at all (such as brackets)Multi-word variables now use hyphens to connect their words instead of spaces. This makes it clearer that all the words are part of the same variable. Additionally, "option ..." is used to denote where other options may be specified, as this appears to be standard style.
Signed-off-by Sean Anderson <[email protected]>---
Changes in v2:
- Fix spacing for -Fdoc/mkimage.1 | 26 ++++++++++++++++++--------
1 file changed, 18 insertions(+), 8 deletions(-)doc/mkimage.1 +0
-0@@ -3,17 +3,27 @@Quoted 5 lines
.SH NAME
mkimage \- Generate image for U-Boot
.SH SYNOPSIS
-.B mkimage
-.RB [ \-T " \fItype\fP] " \-l " [\fIuimage file name\fP]"mkimage -T script -l boot.scr
Quoted 1 line
is illegal. Why did you add '-T type'?
This is the original synopsis. I have kept it as-is. -T type is necessary for some types which are not autodetected, e.g. pblimage.
Quoted 6 lines
Quoted 3 lines
+.SY mkimage
+.OP \-T type
+.BI \-l\~ image-file-nameReplacing uimage by image seems to be correct. But you could mention it in the commit message.
Sure.
Quoted 10 lines
Quoted 8 lines
+.YS
-.B mkimage
-.RB [\fIoptions\fP] " \-f [" "image tree source file" "]" " [" "uimage file name" "]" +.SY mkimage
+.RI [ option\~ .\|.\|.\&]
+.BI \-f\~ image-tree-source-file\c
+.RB | autoAdding 'auto' is also not mentioned in the commit message.
Will mention.
Quoted 10 lines
Quoted 10 lines
+.I image-file-name
+.YS-.B mkimage
-.RB [\fIoptions\fP] " \-F [" "uimage file name" "]" +.SY mkimage
+.RI [ option\~ .\|.\|.\&]
+.BI \-F\~ image-file-name
+.YS
Quoted 7 lines
Quoted 5 lines
-.B mkimage
-.RB [\fIoptions\fP] " (legacy mode)"
+.SY mkimage
+.RI [ option\~ .\|.\|.\&]
+.R (legacy mode)(legacy mode) is not an argument. So it should not appear in the synopsis
That's why it's not in italics/bold.
Quoted 3 lines
The last addition of an image type has commit date 2022-04-04 (
IH_TYPE_SUNXI_TOC0). The term 'legacy mode' for everything that is not FIT is misleading and should be avoided.
I agree. I will remove it.
Quoted 9 lines
Quoted 4 lines
+.YS
.SH "DESCRIPTION"
TheThe following command is not covered by any entry in the synopsis:
mkimage -T script -n GRUB -d boot.txt boot.scr
The synopsis lacks an entry
I believe this is covered by the "legacy" mode.
Quoted 1 line
mkimage -T type [options] image-file-name
But perhaps it would be better to list "legacy" mode as
mkimage [options...] [-T type] image-file-name
--Sean
PATCH v2 2/14 doc: mkimage: Use empty request instead of blank lines
In reply to Sean AndersonBlank lines do not have well-defined semantics in fill mode (the default). Instead, use empty requests (.) where vertical space is necessary for readability. There are a few places where we use a paragraph instead.
---
(no changes since v1)
doc/mkimage.1 | 110 +++++++++++++++++++++++++------------------------- 1 file changed, 55 insertions(+), 55 deletions(-)
doc/mkimage.1 +55 -55
@@ -1,5 +1,5 @@ .TH MKIMAGE 1 "2022-02-07" - +. .SH NAME mkimage \- Generate image for U-Boot .SH SYNOPSIS
@@ -7,34 +7,34 @@ mkimage \- Generate image for U-Boot .OP \-T type .BI \-l\~ image-file-name .YS - +. .SY mkimage .RI [ option\~ .\|.\|.\&] .BI \-f\~ image-tree-source-file\c .RB | auto .I image-file-name .YS - +. .SY mkimage .RI [ option\~ .\|.\|.\&] .BI \-F\~ image-file-name .YS - +. .SY mkimage .RI [ option\~ .\|.\|.\&] -.R (legacy mode) +(legacy mode) .YS - +. .SH "DESCRIPTION" The .B mkimage command is used to create images for use with the U-Boot boot loader. These images can contain the linux kernel, device tree blob, root file system image, firmware images etc., either separate or combined. - +.P .B mkimage supports two different formats: - +.P The old .I legacy image format concatenates the individual parts (for example, kernel image,
@@ -42,69 +42,69 @@ device tree blob and ramdisk image) and adds a 64 bytes header containing information about target architecture, operating system, image type, compression method, entry points, time stamp, checksums, etc. - +.P The new .I FIT (Flattened Image Tree) format allows for more flexibility in handling images of various types and also enhances integrity protection of images with stronger checksums. It also supports verified boot. - +. .SH "OPTIONS" - +. .B List image information: - +. .TP .BI "\-l [" "uimage file name" "]" mkimage lists the information contained in the header of an existing U-Boot image. - +. .TP .BI "\-T [" "image type" "]" Parse image file as type. Pass \-h as the image to see the list of supported image type. Without this option image type is autodetected. - +. .TP .BI "\-q" Quiet. Don't print the image header on successful verification. - +. .P .B Create old legacy image: - +. .TP .BI "\-A [" "architecture" "]" Set architecture. Pass \-h as the architecture to see the list of supported architectures. - +. .TP .BI "\-O [" "os" "]" Set operating system. bootm command of u-boot changes boot method by os type. Pass \-h as the OS to see the list of supported OS. - +. .TP .BI "\-T [" "image type" "]" Set image type. Pass \-h as the image to see the list of supported image type. - +. .TP .BI "\-C [" "compression type" "]" Set compression type. Pass \-h as the compression to see the list of supported compression type. - +. .TP .BI "\-a [" "load address" "]" Set load address with a hex number. - +. .TP .BI "\-e [" "entry point" "]" Set entry point with a hex number. - +. .TP .BI "\-l" List the contents of an image. - +. .TP .BI "\-n [" "image name" "]" Set image name to 'image name'. - +. .TP .BI "\-R [" "secondary image name" "]" Some image types support a second image for additional data. For these types,
@@ -133,42 +133,42 @@ when loading the image. At most 256 parameters may be specified in this manner. T} .TE - +. .TP .BI "\-d [" "image data file" "]" Use image data from 'image data file'. - +. .TP .BI "\-x" Set XIP (execute in place) flag. - +. .TP .BI "\-s" Don't copy in the image data. Depending on the image type, this may create just the header, everything but the image data, or nothing at all. - +. .TP .BI "\-v" Verbose. Print file names as they are added to the image. - +. .P .B Create FIT image: - +. .TP .BI "\-b [" "device tree file" "] Appends the device tree binary file (.dtb) to the FIT. - +. .TP .BI "\-c [" "comment" "]" Specifies a comment to be added when signing. This is typically a useful message which describes how the image was signed or some other useful information. - +. .TP .BI "\-D [" "dtc options" "]" Provide special options to the device tree compiler that is used to create the image. - +. .TP .BI "\-E After processing, move the image data outside the FIT and store a data offset
@@ -177,44 +177,44 @@ FIT, with each one aligned to a 4-byte boundary. The existing 'data' property in each image will be replaced with 'data-offset' and 'data-size' properties. A 'data-offset' of 0 indicates that it starts in the first (4-byte aligned) byte after the FIT. - +. .TP .BI "\-B [" "alignment" "]" The alignment, in hexadecimal, that external data will be aligned to. This option only has an effect when \-E is specified. - +. .TP .BI "\-f [" "image tree source file" " | " "auto" "]" Image tree source file that describes the structure and contents of the FIT image. - +.IP This can be automatically generated for some simple cases. Use "-f auto" for this. In that case the arguments -d, -A, -O, -T, -C, -a and -e are used to specify the image to include in the FIT and its attributes. No .its file is required. - +. .TP .BI "\-F" Indicates that an existing FIT image should be modified. No dtc compilation is performed and the \-f flag should not be given. This can be used to sign images with additional keys after initial image creation. - +. .TP .BI "\-i [" "ramdisk_file" "]" Appends the ramdisk file to the FIT. - +. .TP .BI "\-k [" "key_directory" "]" Specifies the directory containing keys to use for signing. This directory should contain a private key file <name>.key for use with signing and a certificate <name>.crt (containing the public key) for use with verification. - +. .TP .BI "\-G [" "key_file" "]" Specifies the private key file to use when signing. This option may be used instead of \-k. - +. .TP .BI "\-K [" "key_destination" "]" Specifies a compiled device tree binary file (typically .dtb) to write
@@ -222,53 +222,53 @@ public key information into. When a private key is used to sign an image, the corresponding public key is written into this file for for run-time verification. Typically the file here is the device tree binary used by CONFIG_OF_CONTROL in U-Boot. - +. .TP .BI "\-G [" "key_file" "]" Specifies the private key file to use when signing. This option may be used instead of \-k. - +. .TP .BI "\-g [" "key_name_hint" "]" Sets the key-name-hint property when used with \-f auto. This is the <name> part of the key. The directory part is set by \-k. This option also indicates that the images included in the FIT should be signed. If this option is specified, \-o must be specified as well. - +. .TP .BI "\-o [" "signing algorithm" "]" Specifies the algorithm to be used for signing a FIT image. The default is taken from the signature node's 'algo' property. - +. .TP .BI "\-p [" "external position" "]" Place external data at a static external position. See \-E. Instead of writing a 'data-offset' property defining the offset from the end of the FIT, \-p will use 'data-position' as the absolute position from the base of the FIT. - +. .TP .BI "\-r" Specifies that keys used to sign the FIT are required. This means that they must be verified for the image to boot. Without this option, the verification will be optional (useful for testing but not for release). - +. .TP .BI "\-N [" "engine" "]" The openssl engine to use when signing and verifying the image. For a complete list of available engines, refer to .BR engine (1). - +. .TP .BI "\-t Update the timestamp in the FIT. - +.IP Normally the FIT timestamp is created the first time mkimage is run on a FIT, when converting the source .its to the binary .fit file. This corresponds to using the -f flag. But if the original input to mkimage is a binary file (already compiled) then the timestamp is assumed to have been set previously. - +. .SH EXAMPLES - +. List image information: .nf .B mkimage -l uImage
@@ -294,7 +294,7 @@ skipping those for which keys cannot be found. Also add a comment. .br .B -c """Kernel 3.8 image for production devices""" kernel.itb .fi - +. .P Add public keys to u-boot.dtb without needing a FIT to sign. This will also create a FIT containing an images node with no data named unused.itb.
@@ -303,7 +303,7 @@ create a FIT containing an images node with no data named unused.itb. .br .B -o sha256,rsa2048 -K u-boot.dtb unused.itb .fi - +. .P Update an existing FIT image, signing it with additional keys. Add corresponding public keys into u-boot.dtb. This will resign all images
@@ -314,7 +314,7 @@ with unavailable keys are skipped. .br .B -c """Kernel 3.8 image for production devices""" kernel.itb .fi - +. .P Create a FIT image containing a kernel, using automatic mode. No .its file is required.
@@ -340,7 +340,7 @@ file is required. .br .B -d vmlinuz -k /secret/signing-keys -g dev -o sha256,rsa2048 kernel.itb .fi - +. .SH HOMEPAGE http://www.denx.de/wiki/U-Boot/WebHome .PP
Signature · 1 line
2.35.1
PATCH v2 3/14 doc: mkimage: Reformat examples
In reply to Sean AndersonThis puts each example in a new paragraph and uses a hanging indent for continued lines to increase clarity. We use tabs instead of .in or .RS for the indent because it renders properly in both man and mandoc (which is what many common HTML man pages use). The only nit is that the tab stops in man default to something like 2", so reduce that to 1". We also escape every "minus" as recommended by man-pages(7).
---
Changes in v2:
- Escape minus signs in examples
- Indent things more robustly
doc/mkimage.1 | 116 +++++++++++++++++++++++++++++--------------------- 1 file changed, 67 insertions(+), 49 deletions(-)
doc/mkimage.1 +67 -49
@@ -268,78 +268,96 @@ using the -f flag. But if the original input to mkimage is a binary file (already compiled) then the timestamp is assumed to have been set previously. . .SH EXAMPLES -. +.\" Reduce the width of the tab stops to something reasonable +.ta T 1i List image information: -.nf -.B mkimage -l uImage -.fi +.RS +.P +.EX +\fBmkimage \-l uImage +.EE +.RE .P Create legacy image with compressed PowerPC Linux kernel: -.nf -.B mkimage -A powerpc -O linux -T kernel -C gzip \\\\ -.br -.B -a 0 -e 0 -n Linux -d vmlinux.gz uImage -.fi +.RS +.P +.EX +\fBmkimage \-A powerpc \-O linux \-T kernel \-C gzip \\ + \-a 0 \-e 0 \-n Linux \-d vmlinux.gz uImage +.EE +.RE .P Create FIT image with compressed PowerPC Linux kernel: -.nf -.B mkimage -f kernel.its kernel.itb -.fi +.RS +.P +.EX +\fBmkimage \-f kernel.its kernel.itb +.EE +.RE .P Create FIT image with compressed kernel and sign it with keys in the -/public/signing-keys directory. Add corresponding public keys into u-boot.dtb, +/public/signing\-keys directory. Add corresponding public keys into u\-boot.dtb, skipping those for which keys cannot be found. Also add a comment. -.nf -.B mkimage -f kernel.its -k /public/signing-keys -K u-boot.dtb \\\\ -.br -.B -c """Kernel 3.8 image for production devices""" kernel.itb -.fi -. +.RS .P -Add public keys to u-boot.dtb without needing a FIT to sign. This will also +.EX +\fBmkimage \-f kernel.its \-k /public/signing\-keys \-K u\-boot.dtb \\ + \-c \(dqKernel 3.8 image for production devices\(dq kernel.itb +.EE +.RE +.P +Add public keys to u\-boot.dtb without needing a FIT to sign. This will also create a FIT containing an images node with no data named unused.itb. -.nf -.B mkimage -f auto -d /dev/null -k /public/signing-keys -g dev \\\\ -.br -.B -o sha256,rsa2048 -K u-boot.dtb unused.itb -.fi -. +.RS +.P +.EX +\fBmkimage \-f auto \-d /dev/null \-k /public/signing\-keys \-g dev \\ + \-o sha256,rsa2048 \-K u\-boot.dtb unused.itb +.EE +.RE .P Update an existing FIT image, signing it with additional keys. -Add corresponding public keys into u-boot.dtb. This will resign all images +Add corresponding public keys into u\-boot.dtb. This will resign all images with keys that are available in the new directory. Images that request signing with unavailable keys are skipped. -.nf -.B mkimage -F -k /secret/signing-keys -K u-boot.dtb \\\\ -.br -.B -c """Kernel 3.8 image for production devices""" kernel.itb -.fi -. +.RS +.P +.EX +\fBmkimage \-F \-k /secret/signing\-keys \-K u\-boot.dtb \\ + \-c \(dqKernel 3.8 image for production devices\(dq kernel.itb +.EE +.RE .P Create a FIT image containing a kernel, using automatic mode. No .its file is required. -.nf -.B mkimage -f auto -A arm -O linux -T kernel -C none -a 43e00000 -e 0 \\\\ -.br -.B -c """Kernel 4.4 image for production devices""" -d vmlinuz kernel.itb -.fi +.RS +.P +.EX +\fBmkimage \-f auto \-A arm \-O linux \-T kernel \-C none \-a 43e00000 \-e 0 \\ + \-c \(dqKernel 4.4 image for production devices\(dq \-d vmlinuz kernel.itb +.EE +.RE .P Create a FIT image containing a kernel and some device tree files, using automatic mode. No .its file is required. -.nf -.B mkimage -f auto -A arm -O linux -T kernel -C none -a 43e00000 -e 0 \\\\ -.br -.B -c """Kernel 4.4 image for production devices""" -d vmlinuz \\\\ -.B -b /path/to/rk3288-firefly.dtb -b /path/to/rk3288-jerry.dtb kernel.itb -.fi +.RS +.P +.EX +\fBmkimage \-f auto \-A arm \-O linux \-T kernel \-C none \-a 43e00000 \-e 0 \\ + \-c \(dqKernel 4.4 image for production devices\(dq \-d vmlinuz \\ + \-b /path/to/rk3288\-firefly.dtb \-b /path/to/rk3288\-jerry.dtb kernel.itb +.EE +.RE .P Create a FIT image containing a signed kernel, using automatic mode. No .its file is required. -.nf -.B mkimage -f auto -A arm -O linux -T kernel -C none -a 43e00000 -e 0 \\\\ -.br -.B -d vmlinuz -k /secret/signing-keys -g dev -o sha256,rsa2048 kernel.itb -.fi +.RS +.P +.EX +\fBmkimage \-f auto \-A arm \-O linux \-T kernel \-C none \-a 43e00000 \-e 0 \\ + \-d vmlinuz \-k /secret/signing\-keys \-g dev \-o sha256,rsa2048 kernel.itb +.EE +.RE . .SH HOMEPAGE http://www.denx.de/wiki/U-Boot/WebHome
Signature · 1 line
2.35.1
PATCH v2 4/14 doc: mkimage: Regularize option documentation
In reply to Sean AndersonSquare brackets are commonly used to denote optional parts of a command. However, all option arguments are mandatory. Remove these brackets. This also removes some unnecessary quotation marks, and uses hyphens to connect words in option arguments.
---
Changes in v2:
- Fix extra quote in -E synopsis
doc/mkimage.1 | 72 +++++++++++++++++++++++++-------------------------- 1 file changed, 36 insertions(+), 36 deletions(-)
doc/mkimage.1 +36 -36
@@ -25,7 +25,7 @@ mkimage \- Generate image for U-Boot (legacy mode) .YS . -.SH "DESCRIPTION" +.SH DESCRIPTION The .B mkimage command is used to create images for use with the U-Boot boot loader.
@@ -49,64 +49,64 @@ allows for more flexibility in handling images of various types and also enhances integrity protection of images with stronger checksums. It also supports verified boot. . -.SH "OPTIONS" +.SH OPTIONS . .B List image information: . .TP -.BI "\-l [" "uimage file name" "]" +.BI \-l " uimage-file-name" mkimage lists the information contained in the header of an existing U-Boot image. . .TP -.BI "\-T [" "image type" "]" +.BI \-T " image-type" Parse image file as type. Pass \-h as the image to see the list of supported image type. Without this option image type is autodetected. . .TP -.BI "\-q" +.B \-q Quiet. Don't print the image header on successful verification. . .P .B Create old legacy image: . .TP -.BI "\-A [" "architecture" "]" +.BI \-A " architecture" Set architecture. Pass \-h as the architecture to see the list of supported architectures. . .TP -.BI "\-O [" "os" "]" +.BI \-O " os" Set operating system. bootm command of u-boot changes boot method by os type. Pass \-h as the OS to see the list of supported OS. . .TP -.BI "\-T [" "image type" "]" +.BI \-T " image-type" Set image type. Pass \-h as the image to see the list of supported image type. . .TP -.BI "\-C [" "compression type" "]" +.BI \-C " compression-type" Set compression type. Pass \-h as the compression to see the list of supported compression type. . .TP -.BI "\-a [" "load address" "]" +.BI \-a " load-address" Set load address with a hex number. . .TP -.BI "\-e [" "entry point" "]" +.BI \-e " entry-point" Set entry point with a hex number. . .TP -.BI "\-l" +.B \-l List the contents of an image. . .TP -.BI "\-n [" "image name" "]" +.BI \-n " image-name" Set image name to 'image name'. . .TP -.BI "\-R [" "secondary image name" "]" +.BI \-R " secondary-image-name" Some image types support a second image for additional data. For these types, use \-R to specify this second image. .TS
@@ -135,42 +135,42 @@ T} .TE . .TP -.BI "\-d [" "image data file" "]" +.BI \-d " image-data-file" Use image data from 'image data file'. . .TP -.BI "\-x" +.B \-x Set XIP (execute in place) flag. . .TP -.BI "\-s" +.B \-s Don't copy in the image data. Depending on the image type, this may create just the header, everything but the image data, or nothing at all. . .TP -.BI "\-v" +.B \-v Verbose. Print file names as they are added to the image. . .P .B Create FIT image: . .TP -.BI "\-b [" "device tree file" "] +.BI \-b " device-tree-file" Appends the device tree binary file (.dtb) to the FIT. . .TP -.BI "\-c [" "comment" "]" +.BI \-c " comment" Specifies a comment to be added when signing. This is typically a useful message which describes how the image was signed or some other useful information. . .TP -.BI "\-D [" "dtc options" "]" +.BI \-D " dtc-options" Provide special options to the device tree compiler that is used to create the image. . .TP -.BI "\-E +.BI \-E After processing, move the image data outside the FIT and store a data offset in the FIT. Images will be placed one after the other immediately after the FIT, with each one aligned to a 4-byte boundary. The existing 'data' property
@@ -179,12 +179,12 @@ A 'data-offset' of 0 indicates that it starts in the first (4-byte aligned) byte after the FIT. . .TP -.BI "\-B [" "alignment" "]" +.BI \-B " alignment" The alignment, in hexadecimal, that external data will be aligned to. This option only has an effect when \-E is specified. . .TP -.BI "\-f [" "image tree source file" " | " "auto" "]" +.BI \-f " image-tree-source-file" Image tree source file that describes the structure and contents of the FIT image. .IP
@@ -194,29 +194,29 @@ and -e are used to specify the image to include in the FIT and its attributes. No .its file is required. . .TP -.BI "\-F" +.B \-F Indicates that an existing FIT image should be modified. No dtc compilation is performed and the \-f flag should not be given. This can be used to sign images with additional keys after initial image creation. . .TP -.BI "\-i [" "ramdisk_file" "]" +.BI \-i " ramdisk-file" Appends the ramdisk file to the FIT. . .TP -.BI "\-k [" "key_directory" "]" +.BI \-k " key-directory" Specifies the directory containing keys to use for signing. This directory should contain a private key file <name>.key for use with signing and a certificate <name>.crt (containing the public key) for use with verification. . .TP -.BI "\-G [" "key_file" "]" +.BI \-G " key-file" Specifies the private key file to use when signing. This option may be used instead of \-k. . .TP -.BI "\-K [" "key_destination" "]" +.BI \-K " key-destination" Specifies a compiled device tree binary file (typically .dtb) to write public key information into. When a private key is used to sign an image, the corresponding public key is written into this file for for run-time
@@ -224,42 +224,42 @@ verification. Typically the file here is the device tree binary used by CONFIG_OF_CONTROL in U-Boot. . .TP -.BI "\-G [" "key_file" "]" +.BI \-G " key-file" Specifies the private key file to use when signing. This option may be used instead of \-k. . .TP -.BI "\-g [" "key_name_hint" "]" +.BI \-g " key-name-hint" Sets the key-name-hint property when used with \-f auto. This is the <name> part of the key. The directory part is set by \-k. This option also indicates that the images included in the FIT should be signed. If this option is specified, \-o must be specified as well. . .TP -.BI "\-o [" "signing algorithm" "]" +.BI \-o " signing-algorithm" Specifies the algorithm to be used for signing a FIT image. The default is taken from the signature node's 'algo' property. . .TP -.BI "\-p [" "external position" "]" +.BI \-p " external-position" Place external data at a static external position. See \-E. Instead of writing a 'data-offset' property defining the offset from the end of the FIT, \-p will use 'data-position' as the absolute position from the base of the FIT. . .TP -.BI "\-r" +.B \-r Specifies that keys used to sign the FIT are required. This means that they must be verified for the image to boot. Without this option, the verification will be optional (useful for testing but not for release). . .TP -.BI "\-N [" "engine" "]" +.BI \-N " engine" The openssl engine to use when signing and verifying the image. For a complete list of available engines, refer to .BR engine (1). . .TP -.BI "\-t +.B \-t Update the timestamp in the FIT. .IP Normally the FIT timestamp is created the first time mkimage is run on a FIT,
Signature · 1 line
2.35.1
Re: [PATCH v2 04/14] doc: mkimage: Regularize option documentation
Quoted 29 lines · Sean Anderson
Square brackets are commonly used to denote optional parts of a command. However, all option arguments are mandatory. Remove these brackets. This also removes some unnecessary quotation marks, and uses hyphens to connect words in option arguments.
Signed-off-by Sean Anderson <[email protected]>---
Changes in v2:
- Fix extra quote in -E synopsisdoc/mkimage.1 | 72 +++++++++++++++++++++++++-------------------------- 1 file changed, 36 insertions(+), 36 deletions(-)doc/mkimage.1 +1
-1@@ -25,7 +25,7 @@ mkimage \- Generate image for U-Boot (legacy mode) .YS . -.SH "DESCRIPTION" +.SH DESCRIPTION The .B mkimage command is used to create images for use with the U-Boot boot loader.@@ -49,64 +49,64 @@ allows for more flexibility in handling images of various types and also enhances integrity protection of images with stronger checksums. It also
doc/mkimage.1 allows for more flexibility in handling images of various types and also · line 57
Quoted 10 lines
doc/mkimage.1 +2
-2supports verified boot. . -.SH "OPTIONS" +.SH OPTIONS . .B List image information: . .TP -.BI "\-l [" "uimage file name" "]" +.BI \-l " uimage-file-name"
You have renamed this in the synopsis to image-file-name. Please, keep the argument names consistent.
Best regards
Heinrich
Quoted 217 lines
doc/mkimage.1 +33
-33mkimage lists the information contained in the header of an existing U-Boot image. . .TP -.BI "\-T [" "image type" "]" +.BI \-T " image-type" Parse image file as type. Pass \-h as the image to see the list of supported image type. Without this option image type is autodetected. . .TP -.BI "\-q" +.B \-q Quiet. Don't print the image header on successful verification. . .P .B Create old legacy image: . .TP -.BI "\-A [" "architecture" "]" +.BI \-A " architecture" Set architecture. Pass \-h as the architecture to see the list of supported architectures. . .TP -.BI "\-O [" "os" "]" +.BI \-O " os" Set operating system. bootm command of u-boot changes boot method by os type. Pass \-h as the OS to see the list of supported OS. . .TP -.BI "\-T [" "image type" "]" +.BI \-T " image-type" Set image type. Pass \-h as the image to see the list of supported image type. . .TP -.BI "\-C [" "compression type" "]" +.BI \-C " compression-type" Set compression type. Pass \-h as the compression to see the list of supported compression type. . .TP -.BI "\-a [" "load address" "]" +.BI \-a " load-address" Set load address with a hex number. . .TP -.BI "\-e [" "entry point" "]" +.BI \-e " entry-point" Set entry point with a hex number. . .TP -.BI "\-l" +.B \-l List the contents of an image. . .TP -.BI "\-n [" "image name" "]" +.BI \-n " image-name" Set image name to 'image name'. . .TP -.BI "\-R [" "secondary image name" "]" +.BI \-R " secondary-image-name" Some image types support a second image for additional data. For these types, use \-R to specify this second image. .TS@@ -135,42 +135,42 @@ T} .TE . .TP -.BI "\-d [" "image data file" "]" +.BI \-d " image-data-file" Use image data from 'image data file'. . .TP -.BI "\-x" +.B \-x Set XIP (execute in place) flag. . .TP -.BI "\-s" +.B \-s Don't copy in the image data. Depending on the image type, this may create just the header, everything but the image data, or nothing at all. . .TP -.BI "\-v" +.B \-v Verbose. Print file names as they are added to the image. . .P .B Create FIT image: . .TP -.BI "\-b [" "device tree file" "] +.BI \-b " device-tree-file" Appends the device tree binary file (.dtb) to the FIT. . .TP -.BI "\-c [" "comment" "]" +.BI \-c " comment" Specifies a comment to be added when signing. This is typically a useful message which describes how the image was signed or some other useful information. . .TP -.BI "\-D [" "dtc options" "]" +.BI \-D " dtc-options" Provide special options to the device tree compiler that is used to create the image. . .TP -.BI "\-E +.BI \-E After processing, move the image data outside the FIT and store a data offset in the FIT. Images will be placed one after the other immediately after the FIT, with each one aligned to a 4-byte boundary. The existing 'data' property@@ -179,12 +179,12 @@ A 'data-offset' of 0 indicates that it starts in the first (4-byte aligned) byte after the FIT. . .TP -.BI "\-B [" "alignment" "]" +.BI \-B " alignment" The alignment, in hexadecimal, that external data will be aligned to. This option only has an effect when \-E is specified. . .TP -.BI "\-f [" "image tree source file" " | " "auto" "]" +.BI \-f " image-tree-source-file" Image tree source file that describes the structure and contents of the FIT image. .IP@@ -194,29 +194,29 @@ and -e are used to specify the image to include in the FIT and its attributes. No .its file is required. . .TP -.BI "\-F" +.B \-F Indicates that an existing FIT image should be modified. No dtc compilation is performed and the \-f flag should not be given. This can be used to sign images with additional keys after initial image creation. . .TP -.BI "\-i [" "ramdisk_file" "]" +.BI \-i " ramdisk-file" Appends the ramdisk file to the FIT. . .TP -.BI "\-k [" "key_directory" "]" +.BI \-k " key-directory" Specifies the directory containing keys to use for signing. This directory should contain a private key file <name>.key for use with signing and a certificate <name>.crt (containing the public key) for use with verification. . .TP -.BI "\-G [" "key_file" "]" +.BI \-G " key-file" Specifies the private key file to use when signing. This option may be used instead of \-k. . .TP -.BI "\-K [" "key_destination" "]" +.BI \-K " key-destination" Specifies a compiled device tree binary file (typically .dtb) to write public key information into. When a private key is used to sign an image, the corresponding public key is written into this file for for run-time@@ -224,42 +224,42 @@ verification. Typically the file here is the device tree binary used by CONFIG_OF_CONTROL in U-Boot. . .TP -.BI "\-G [" "key_file" "]" +.BI \-G " key-file" Specifies the private key file to use when signing. This option may be used instead of \-k. . .TP -.BI "\-g [" "key_name_hint" "]" +.BI \-g " key-name-hint" Sets the key-name-hint property when used with \-f auto. This is the <name> part of the key. The directory part is set by \-k. This option also indicates that the images included in the FIT should be signed. If this option is specified, \-o must be specified as well. . .TP -.BI "\-o [" "signing algorithm" "]" +.BI \-o " signing-algorithm" Specifies the algorithm to be used for signing a FIT image. The default is taken from the signature node's 'algo' property. . .TP -.BI "\-p [" "external position" "]" +.BI \-p " external-position" Place external data at a static external position. See \-E. Instead of writing a 'data-offset' property defining the offset from the end of the FIT, \-p will use 'data-position' as the absolute position from the base of the FIT. . .TP -.BI "\-r" +.B \-r Specifies that keys used to sign the FIT are required. This means that they must be verified for the image to boot. Without this option, the verification will be optional (useful for testing but not for release). . .TP -.BI "\-N [" "engine" "]" +.BI \-N " engine" The openssl engine to use when signing and verifying the image. For a complete list of available engines, refer to .BR engine (1). . .TP -.BI "\-t +.B \-t Update the timestamp in the FIT. .IP Normally the FIT timestamp is created the first time mkimage is run on a FIT,
Re: [PATCH v2 04/14] doc: mkimage: Regularize option documentation
Quoted 35 lines · Heinrich Schuchardt
Quoted 34 lines · Sean Anderson
Square brackets are commonly used to denote optional parts of a command. However, all option arguments are mandatory. Remove these brackets. This also removes some unnecessary quotation marks, and uses hyphens to connect words in option arguments.
Signed-off-by Sean Anderson <[email protected]>---
Changes in v2:
- Fix extra quote in -E synopsisdoc/mkimage.1 | 72 +++++++++++++++++++++++++--------------------------
1 file changed, 36 insertions(+), 36 deletions(-)doc/mkimage.1 +0
-0@@ -25,7 +25,7 @@ mkimage \- Generate image for U-Boot (legacy mode).YS
.
-.SH "DESCRIPTION"
+.SH DESCRIPTION
The
.B mkimage
command is used to create images for use with the U-Boot boot loader.doc/mkimage.1 +0
-0@@ -49,64 +49,64 @@ allows for more flexibility in handling images of various types and alsoenhances integrity protection of images with stronger checksums. It also supports verified boot.
.
-.SH "OPTIONS"
+.SH OPTIONS
.
Quoted 8 lines
Quoted 5 lines
.B List image information:
.
.TP
-.BI "\-l [" "uimage file name" "]"
+.BI \-l " uimage-file-name"You have renamed this in the synopsis to image-file-name. Please, keep the argument names consistent.
This is fixed in patch 6. I have tried to keep this patch to just a mechanical removal of quotes.
--Sean
Quoted 218 lines
Quoted 217 lines
mkimage lists the information contained in the header of an existing U-Boot image. .
.TP
-.BI "\-T [" "image type" "]"
+.BI \-T " image-type"
Parse image file as type.
Pass \-h as the image to see the list of supported image type.
Without this option image type is autodetected.
.
.TP
-.BI "\-q"
+.B \-q
Quiet. Don't print the image header on successful verification.
.
.P
.B Create old legacy image:
.
.TP
-.BI "\-A [" "architecture" "]"
+.BI \-A " architecture"
Set architecture. Pass \-h as the architecture to see the list of supported architectures. .
.TP
-.BI "\-O [" "os" "]"
+.BI \-O " os"
Set operating system. bootm command of u-boot changes boot method by os type. Pass \-h as the OS to see the list of supported OS.
.
.TP
-.BI "\-T [" "image type" "]"
+.BI \-T " image-type"
Set image type.
Pass \-h as the image to see the list of supported image type.
.
.TP
-.BI "\-C [" "compression type" "]"
+.BI \-C " compression-type"
Set compression type.
Pass \-h as the compression to see the list of supported compression type. .
.TP
-.BI "\-a [" "load address" "]"
+.BI \-a " load-address"
Set load address with a hex number.
.
.TP
-.BI "\-e [" "entry point" "]"
+.BI \-e " entry-point"
Set entry point with a hex number.
.
.TP
-.BI "\-l"
+.B \-l
List the contents of an image.
.
.TP
-.BI "\-n [" "image name" "]"
+.BI \-n " image-name"
Set image name to 'image name'.
.
.TP
-.BI "\-R [" "secondary image name" "]"
+.BI \-R " secondary-image-name"
Some image types support a second image for additional data. For these types, use \-R to specify this second image.
.TSdoc/mkimage.1 +0
-0@@ -135,42 +135,42 @@ T}.TE
.
.TP
-.BI "\-d [" "image data file" "]"
+.BI \-d " image-data-file"
Use image data from 'image data file'.
.
.TP
-.BI "\-x"
+.B \-x
Set XIP (execute in place) flag.
.
.TP
-.BI "\-s"
+.B \-s
Don't copy in the image data. Depending on the image type, this may create just the header, everything but the image data, or nothing at all. .
.TP
-.BI "\-v"
+.B \-v
Verbose. Print file names as they are added to the image.
.
.P
.B Create FIT image:
.
.TP
-.BI "\-b [" "device tree file" "]
+.BI \-b " device-tree-file"
Appends the device tree binary file (.dtb) to the FIT.
.
.TP
-.BI "\-c [" "comment" "]"
+.BI \-c " comment"
Specifies a comment to be added when signing. This is typically a useful message which describes how the image was signed or some other useful information.
.
.TP
-.BI "\-D [" "dtc options" "]"
+.BI \-D " dtc-options"
Provide special options to the device tree compiler that is used to create the image.
.
.TP
-.BI "\-E
+.BI \-E
After processing, move the image data outside the FIT and store a data offset in the FIT. Images will be placed one after the other immediately after the FIT, with each one aligned to a 4-byte boundary. The existing 'data' propertydoc/mkimage.1 +0
-0@@ -179,12 +179,12 @@ A 'data-offset' of 0 indicates that it starts in the first (4-byte aligned)byte after the FIT.
.
.TP
-.BI "\-B [" "alignment" "]"
+.BI \-B " alignment"
The alignment, in hexadecimal, that external data will be aligned to. This option only has an effect when \-E is specified.
.
.TP
-.BI "\-f [" "image tree source file" " | " "auto" "]"
+.BI \-f " image-tree-source-file"
Image tree source file that describes the structure and contents of the FIT image.
.IPdoc/mkimage.1 +0
-0@@ -194,29 +194,29 @@ and -e are used to specify the image to include in the FIT and its attributes.No .its file is required.
.
.TP
-.BI "\-F"
+.B \-F
Indicates that an existing FIT image should be modified. No dtc compilation is performed and the \-f flag should not be given. This can be used to sign images with additional keys after initial image creation.
.
.TP
-.BI "\-i [" "ramdisk_file" "]"
+.BI \-i " ramdisk-file"
Appends the ramdisk file to the FIT.
.
.TP
-.BI "\-k [" "key_directory" "]"
+.BI \-k " key-directory"
Specifies the directory containing keys to use for signing. This directory should contain a private key file <name>.key for use with signing and a certificate <name>.crt (containing the public key) for use with verification. .
.TP
-.BI "\-G [" "key_file" "]"
+.BI \-G " key-file"
Specifies the private key file to use when signing. This option may be used instead of \-k.
.
.TP
-.BI "\-K [" "key_destination" "]"
+.BI \-K " key-destination"
Specifies a compiled device tree binary file (typically .dtb) to write public key information into. When a private key is used to sign an image, the corresponding public key is written into this file for for run-timedoc/mkimage.1 +0
-0@@ -224,42 +224,42 @@ verification. Typically the file here is the device tree binary used by
CONFIG_OF_CONTROLin U-Boot.
.
.TP
-.BI "\-G [" "key_file" "]"
+.BI \-G " key-file"
Specifies the private key file to use when signing. This option may be used instead of \-k.
.
.TP
-.BI "\-g [" "key_name_hint" "]"
+.BI \-g " key-name-hint"
Sets the key-name-hint property when used with \-f auto. This is the <name> part of the key. The directory part is set by \-k. This option also indicates that the images included in the FIT should be signed. If this option is specified, \-o must be specified as well.
.
.TP
-.BI "\-o [" "signing algorithm" "]"
+.BI \-o " signing-algorithm"
Specifies the algorithm to be used for signing a FIT image. The default is taken from the signature node's 'algo' property.
.
.TP
-.BI "\-p [" "external position" "]"
+.BI \-p " external-position"
Place external data at a static external position. See \-E. Instead of writing a 'data-offset' property defining the offset from the end of the FIT, \-p will use 'data-position' as the absolute position from the base of the FIT.
.
.TP
-.BI "\-r"
+.B \-r
Specifies that keys used to sign the FIT are required. This means that they must be verified for the image to boot. Without this option, the verification will be optional (useful for testing but not for release).
.
.TP
-.BI "\-N [" "engine" "]"
+.BI \-N " engine"
The openssl engine to use when signing and verifying the image. For a complete list of available engines, refer to
.BR engine (1).
.
.TP
-.BI "\-t
+.B \-t
Update the timestamp in the FIT.
.IP
Normally the FIT timestamp is created the first time mkimage is run on a FIT,
PATCH v2 5/14 doc: mkimage: Use subsection macro
In reply to Sean AndersonThe options are divided up into several subsections. Use the appropriate macro. While we're at it, rename the headings to better reflect the contents of their sections.
---
Changes in v2:
- Rename first subsection to "General options"
- Use paired quotation marks
doc/mkimage.1 | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-)
doc/mkimage.1 +3 -5
@@ -51,7 +51,7 @@ supports verified boot. . .SH OPTIONS . -.B List image information: +.SS General options . .TP .BI \-l " uimage-file-name"
@@ -67,8 +67,7 @@ Without this option image type is autodetected. .B \-q Quiet. Don't print the image header on successful verification. . -.P -.B Create old legacy image: +.SS Options for creating legacy or \(lqauto\(rq images . .TP .BI \-A " architecture"
@@ -151,8 +150,7 @@ just the header, everything but the image data, or nothing at all. .B \-v Verbose. Print file names as they are added to the image. . -.P -.B Create FIT image: +.SS Options for creating FIT images . .TP .BI \-b " device-tree-file"
Signature · 1 line
2.35.1
Re: [PATCH v2 05/14] doc: mkimage: Use subsection macro
Quoted 28 lines · Sean Anderson
The options are divided up into several subsections. Use the appropriate macro. While we're at it, rename the headings to better reflect the contents of their sections.
Signed-off-by Sean Anderson <[email protected]>---
Changes in v2:
- Rename first subsection to "General options"
- Use paired quotation marksdoc/mkimage.1 | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-)doc/mkimage.1 +1
-1@@ -51,7 +51,7 @@ supports verified boot. . .SH OPTIONS . -.B List image information: +.SS General options . .TP .BI \-l " uimage-file-name"
doc/mkimage.1 Without this option image type is autodetected. · line 70
Quoted 6 lines
doc/mkimage.1 +1
-2@@ -67,8 +67,7 @@ Without this option image type is autodetected. .B \-q Quiet. Don't print the image header on successful verification. . -.P -.B Create old legacy image: +.SS Options for creating legacy or \(lqauto\(rq images
An image type (IH_TYPE_SUNXI_TOC0) introduced in 2022 cannot be legacy. Please, remove this misleading and derogatory term. I guess you mean anything but FIT. Should the whole paragraph be move down below the descriptions of the creation of FIT images? Then you could say "Options for creating other image types".
I have no clue what an "auto" image might refer to. The man-page is not of any help here.
Best regards
Heinrich
Quoted 13 lines
doc/mkimage.1 +1
-2. .TP .BI \-A " architecture"@@ -151,8 +150,7 @@ just the header, everything but the image data, or nothing at all. .B \-v Verbose. Print file names as they are added to the image. . -.P -.B Create FIT image: +.SS Options for creating FIT images . .TP .BI \-b " device-tree-file"
Re: [PATCH v2 05/14] doc: mkimage: Use subsection macro
Quoted 30 lines · Heinrich Schuchardt
Quoted 29 lines · Sean Anderson
The options are divided up into several subsections. Use the appropriate macro. While we're at it, rename the headings to better reflect the contents of their sections.
Signed-off-by Sean Anderson <[email protected]>---
Changes in v2:
- Rename first subsection to "General options"
- Use paired quotation marksdoc/mkimage.1 | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)doc/mkimage.1 +0
-0@@ -51,7 +51,7 @@ supports verified boot..
.SH OPTIONS
.
-.B List image information:
+.SS General options
.
.TP
.BI \-l " uimage-file-name"doc/mkimage.1 +0
-0@@ -67,8 +67,7 @@ Without this option image type is autodetected..B \-q
Quoted 8 lines
Quoted 5 lines
Quiet. Don't print the image header on successful verification. .
-.P
-.B Create old legacy image:
+.SS Options for creating legacy or \(lqauto\(rq imagesAn image type (
IH_TYPE_SUNXI_TOC0) introduced in 2022 cannot be legacy. Please, remove this misleading and derogatory term. I guess you mean anything but FIT.
This is really Simon's usage. I agree that it doesn't really apply.
Quoted 6 lines
Should the whole paragraph be move down below the descriptions of the creation of FIT images? Then you could say "Options for creating other image types".
I have no clue what an "auto" image might refer to. The man-page is not of any help here.
See the documentation for -f
The problem is that we really should have an image type of "fit" and -n should be used instead of -f. But what's done is done.
--Sean
Quoted 18 lines
Best regards
Heinrich
Quoted 13 lines
.
.TP
.BI \-A " architecture"doc/mkimage.1 +0
-0@@ -151,8 +150,7 @@ just the header, everything but the image data, or nothing at all..B \-v
Verbose. Print file names as they are added to the image. .
-.P
-.B Create FIT image:
+.SS Options for creating FIT images
.
.TP
.BI \-b " device-tree-file"
PATCH v2 6/14 doc: mkimage: Rearrange/remove some options
In reply to Sean AndersonThis moves some options which work in any mode to the general options section. -p is moved to after -E/-B since those options are related. This also adds documentation for -h and -V.
The -F, -l, and -G options are documented twice. Remove the second documentation in each case. The synopsis for -l also suggests an implied second uimage-file-name parameter. E.g.
mkimage [-l uimage-file-name] uimage-file-name
This is misleading, so remove it. Wrap a few lines to 80 characters as well.
---
Changes in v2:
- Document -h and -V
- Rearrange more options
doc/mkimage.1 | 62 ++++++++++++++++++++++++--------------------------- 1 file changed, 29 insertions(+), 33 deletions(-)
doc/mkimage.1 +29 -33
@@ -54,8 +54,18 @@ supports verified boot. .SS General options . .TP -.BI \-l " uimage-file-name" -mkimage lists the information contained in the header of an existing U-Boot image. +.B \-h +Print a help message and exit. +. +.TP +.B \-l +mkimage lists the information contained in the header of an existing U-Boot +image. +. +.TP +.B \-s +Don't copy in the image data. Depending on the image type, this may create +just the header, everything but the image data, or nothing at all. . .TP .BI \-T " image-type"
@@ -65,13 +75,22 @@ Without this option image type is autodetected. . .TP .B \-q -Quiet. Don't print the image header on successful verification. +Quiet. Don't print the image header. +. +.TP +.B \-v +Verbose. Print file names as they are added to the image. +. +.TP +.B \-V +Print version information and exit. . .SS Options for creating legacy or \(lqauto\(rq images . .TP .BI \-A " architecture" -Set architecture. Pass \-h as the architecture to see the list of supported architectures. +Set architecture. Pass \-h as the architecture to see the list of supported +architectures. . .TP .BI \-O " os"
@@ -79,11 +98,6 @@ Set operating system. bootm command of u-boot changes boot method by os type. Pass \-h as the OS to see the list of supported OS. . .TP -.BI \-T " image-type" -Set image type. -Pass \-h as the image to see the list of supported image type. -. -.TP .BI \-C " compression-type" Set compression type. Pass \-h as the compression to see the list of supported compression type.
@@ -97,10 +111,6 @@ Set load address with a hex number. Set entry point with a hex number. . .TP -.B \-l -List the contents of an image. -. -.TP .BI \-n " image-name" Set image name to 'image name'. .
@@ -141,15 +151,6 @@ Use image data from 'image data file'. .B \-x Set XIP (execute in place) flag. . -.TP -.B \-s -Don't copy in the image data. Depending on the image type, this may create -just the header, everything but the image data, or nothing at all. -. -.TP -.B \-v -Verbose. Print file names as they are added to the image. -. .SS Options for creating FIT images . .TP
@@ -182,6 +183,12 @@ The alignment, in hexadecimal, that external data will be aligned to. This option only has an effect when \-E is specified. . .TP +.BI \-p " external-position" +Place external data at a static external position. See \-E. Instead of writing +a 'data-offset' property defining the offset from the end of the FIT, \-p will +use 'data-position' as the absolute position from the base of the FIT. +. +.TP .BI \-f " image-tree-source-file" Image tree source file that describes the structure and contents of the FIT image.
@@ -222,11 +229,6 @@ verification. Typically the file here is the device tree binary used by CONFIG_OF_CONTROL in U-Boot. . .TP -.BI \-G " key-file" -Specifies the private key file to use when signing. This option may be used -instead of \-k. -. -.TP .BI \-g " key-name-hint" Sets the key-name-hint property when used with \-f auto. This is the <name> part of the key. The directory part is set by \-k. This option also indicates
@@ -239,12 +241,6 @@ Specifies the algorithm to be used for signing a FIT image. The default is taken from the signature node's 'algo' property. . .TP -.BI \-p " external-position" -Place external data at a static external position. See \-E. Instead of writing -a 'data-offset' property defining the offset from the end of the FIT, \-p will -use 'data-position' as the absolute position from the base of the FIT. -. -.TP .B \-r Specifies that keys used to sign the FIT are required. This means that they must be verified for the image to boot. Without this option, the verification
Signature · 1 line
2.35.1
PATCH v2 7/14 doc: mkimage: Use correct capitalization for NAME
In reply to Sean AndersonThe description in NAME should not be capitalized. Fix a grammatical error as well.
---
(no changes since v1)
doc/mkimage.1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
doc/mkimage.1 +1 -1
@@ -1,7 +1,7 @@ .TH MKIMAGE 1 "2022-02-07" . .SH NAME -mkimage \- Generate image for U-Boot +mkimage \- generate images for U-Boot .SH SYNOPSIS .SY mkimage .OP \-T type
Signature · 1 line
2.35.1
PATCH v2 8/14 doc: mkimage: Edit options for style and consistency
In reply to Sean AndersonThis makes a variety of changes for the options to make them typographically consistent, clarify their meaning, and fix grammatical (or other) errors. Many of the changes here are stylistic, though there are a few fixes. The main changes I made across the board were:
- All options are bolded and parameters italicised
- All single quotes are properly matched (instead of using apostrophes)
- Minor background info has been added to clarify many underdocument options
---
Changes in v2:
- Better document multi images
- Fix -B not being bolded in the description for -R
- Italicize parameter for -d
- Make lists of valid algos bold
- Remove spaces around pipes
- Use escape-sequences for options width all three of B/I/R. This renders better with mandoc.
doc/mkimage.1 | 230 +++++++++++++++++++++++++++++++++++--------------- 1 file changed, 163 insertions(+), 67 deletions(-)
doc/mkimage.1 +163 -67
@@ -28,26 +28,23 @@ mkimage \- generate images for U-Boot .SH DESCRIPTION The .B mkimage -command is used to create images for use with the U-Boot boot loader. -These images can contain the linux kernel, device tree blob, root file -system image, firmware images etc., either separate or combined. +command is used to create images for use with the U-Boot boot loader. These +images can contain the Linux kernel, device tree blob, root file system image, +firmware images etc., either separate or combined. .P .B mkimage supports two different formats: .P -The old -.I legacy image -format concatenates the individual parts (for example, kernel image, -device tree blob and ramdisk image) and adds a 64 bytes header -containing information about target architecture, operating system, -image type, compression method, entry points, time stamp, checksums, -etc. +The legacy image format concatenates the individual parts (for example, kernel +image, device tree blob and ramdisk image) and adds a 64 byte header containing +information about the target architecture, operating system, image type, +compression method, entry points, time stamp, checksums, etc. .P The new -.I FIT (Flattened Image Tree) format -allows for more flexibility in handling images of various types and also -enhances integrity protection of images with stronger checksums. It also -supports verified boot. +.I FIT +(Flattened Image Tree) format allows for more flexibility in handling images of +various types and also enhances integrity protection of images with stronger +checksums. It also supports verified boot. . .SH OPTIONS .
@@ -59,8 +56,8 @@ Print a help message and exit. . .TP .B \-l -mkimage lists the information contained in the header of an existing U-Boot -image. +.B mkimage +lists the information contained in the header of an existing U-Boot image. . .TP .B \-s
@@ -69,9 +66,14 @@ just the header, everything but the image data, or nothing at all. . .TP .BI \-T " image-type" -Parse image file as type. -Pass \-h as the image to see the list of supported image type. -Without this option image type is autodetected. +Parse image file as +.IR image-type . +Pass +.B \-h +as +.I image-type +to see the list of supported image types. Without this option, the image type is +autodetected. . .TP .B \-q
@@ -89,35 +91,58 @@ Print version information and exit. . .TP .BI \-A " architecture" -Set architecture. Pass \-h as the architecture to see the list of supported -architectures. +Set the architecture. Pass +.B \-h +as the architecture to see the list of supported architectures. . .TP .BI \-O " os" -Set operating system. bootm command of u-boot changes boot method by os type. -Pass \-h as the OS to see the list of supported OS. +Set the operating system. The U-Boot +.I bootm +command changes boot method based on the OS type. +Pass +.B \-h +as the +.I os +to see the list of supported OSs. . .TP .BI \-C " compression-type" -Set compression type. -Pass \-h as the compression to see the list of supported compression type. +Set the compression type. The image data should have already been compressed +using this compression type. +.B mkimage +will not automatically compress image data. +Pass +.B \-h +as the +.I compression-type +to see the list of supported compression types. . .TP .BI \-a " load-address" -Set load address with a hex number. +Set the absolute address to load the image data to. +.I load-address +will be interpreted as a hexadecimal number. . .TP .BI \-e " entry-point" -Set entry point with a hex number. +Set the absolute address of the image entry point. The U-Boot +.I bootm +command will jump to this address after loading the image. +.I entry-point +will be interpreted as a hexadecimal number. . .TP .BI \-n " image-name" -Set image name to 'image name'. +Set the image name to +.IR image-name . . .TP .BI \-R " secondary-image-name" Some image types support a second image for additional data. For these types, -use \-R to specify this second image. +use +.B \-R +to specify this second image. .TS allbox; lb lbx
@@ -145,11 +170,26 @@ T} . .TP .BI \-d " image-data-file" -Use image data from 'image data file'. +Use image data from +.IR image-data-file . +If the +.I image-type +is +.BR multi , +then multiple images may be specified, separated by colons: +.RS +.IP +.IR image-data-file [\fB:\fP image-data-file .\|.\|.] +.RE . .TP .B \-x -Set XIP (execute in place) flag. +Set the +.I XIP +(execute in place) flag. The U-Boot +.I bootm +command will not load the image data, and instead will assume it is already +accessible at the load address (such as via memory-mapped flash). . .SS Options for creating FIT images .
@@ -159,23 +199,24 @@ Appends the device tree binary file (.dtb) to the FIT. . .TP .BI \-c " comment" -Specifies a comment to be added when signing. This is typically a useful -message which describes how the image was signed or some other useful -information. +Specifies a comment to be added when signing. This is typically a message which +describes how the image was signed or some other useful information. . .TP .BI \-D " dtc-options" -Provide special options to the device tree compiler that is used to -create the image. +Provide additional options to the device tree compiler when creating the image. +See +.BR dtc (1) +for documentation of possible options. . .TP .BI \-E After processing, move the image data outside the FIT and store a data offset -in the FIT. Images will be placed one after the other immediately after the -FIT, with each one aligned to a 4-byte boundary. The existing 'data' property -in each image will be replaced with 'data-offset' and 'data-size' properties. -A 'data-offset' of 0 indicates that it starts in the first (4-byte aligned) -byte after the FIT. +in the FIT. Images will be placed one after the other immediately after the FIT, +with each one aligned to a 4-byte boundary. The existing \(oqdata\(cq property +in each image will be replaced with \(oqdata-offset\(cq and \(oqdata-size\(cq +properties. A \(oqdata-offset\(cq of 0 indicates that it starts in the first +(4-byte-aligned) byte after the FIT. . .TP .BI \-B " alignment"
@@ -184,36 +225,55 @@ option only has an effect when \-E is specified. . .TP .BI \-p " external-position" -Place external data at a static external position. See \-E. Instead of writing -a 'data-offset' property defining the offset from the end of the FIT, \-p will -use 'data-position' as the absolute position from the base of the FIT. +Place external data at a static external position. Instead of writing a +\(oqdata-offset\(cq property defining the offset from the end of the FIT, +.B \-p +will use \(oqdata-position\(cq as the absolute position from the base of the +FIT. See +.B \-E +for details on using external data. . .TP -.BI \-f " image-tree-source-file" +\fB\-f \fIimage-tree-source-file\fR | \fBauto Image tree source file that describes the structure and contents of the FIT image. .IP -This can be automatically generated for some simple cases. -Use "-f auto" for this. In that case the arguments -d, -A, -O, -T, -C, -a -and -e are used to specify the image to include in the FIT and its attributes. -No .its file is required. +In some simple cases, the image tree source can be generated automatically. To +use this feature, pass +.BR "\-f auto" . +The +.BR \-d ", " \-A ", " \-O ", " \-T ", " \-C ", " \-a ", and " \-e +options may be used to specify the image to include in the FIT and its +attributes. No +.I image-tree-source-file +is required. . .TP .B \-F -Indicates that an existing FIT image should be modified. No dtc -compilation is performed and the \-f flag should not be given. -This can be used to sign images with additional keys after initial image -creation. +Indicates that an existing FIT image should be modified. No dtc compilation will +be performed and +.B \-f +should not be passed. This can be used to sign images with additional keys +after initial image creation. . .TP .BI \-i " ramdisk-file" -Appends the ramdisk file to the FIT. +Append a ramdisk or initramfs file to the image. . .TP .BI \-k " key-directory" Specifies the directory containing keys to use for signing. This directory -should contain a private key file <name>.key for use with signing and a -certificate <name>.crt (containing the public key) for use with verification. +should contain a private key file +.IR name .key +for use with signing, and a certificate +.IR name .crt +(containing the public key) for use with verification. The public key is only +necessary when embedding it into another device tree using +.BR \-K . +.I name +defaults to the value of the signature node's \(oqkey-name-hint\(cq property, +but may be overridden using +.BR \-g . . .TP .BI \-G " key-file"
@@ -230,15 +290,49 @@ CONFIG_OF_CONTROL in U-Boot. . .TP .BI \-g " key-name-hint" -Sets the key-name-hint property when used with \-f auto. This is the <name> -part of the key. The directory part is set by \-k. This option also indicates -that the images included in the FIT should be signed. If this option is -specified, \-o must be specified as well. +Overrides the signature node's \(oqkey-name-hint\(cq property. This is +especially useful when signing an image with +.BR "\-f auto" . +This is the +.I name +part of the key. The directory part is set by +.BR \-k . +This option also indicates that the images included in the FIT should be signed. +If this option is specified, then +.B \-o +must be specified as well. . .TP -.BI \-o " signing-algorithm" +.BI \-o " crypto" , checksum Specifies the algorithm to be used for signing a FIT image. The default is -taken from the signature node's 'algo' property. +taken from the signature node's \(oqalgo\(cq property. +The valid values for +.I crypto +are: +.RS +.IP +.TS +lb. +rsa2048 +rsa3072 +rsa4096 +ecdsa256 +.TE +.RE +.IP +The valid values for +.I checksum +are +.RS +.IP +.TS +lb. +sha1 +sha256 +sha384 +sha512 +.TE +.RE . .TP .B \-r
@@ -248,18 +342,20 @@ will be optional (useful for testing but not for release). . .TP .BI \-N " engine" -The openssl engine to use when signing and verifying the image. For a complete list of -available engines, refer to +The openssl engine to use when signing and verifying the image. For a complete +list of available engines, refer to .BR engine (1). . .TP .B \-t Update the timestamp in the FIT. .IP -Normally the FIT timestamp is created the first time mkimage is run on a FIT, +Normally the FIT timestamp is created the first time mkimage runs, when converting the source .its to the binary .fit file. This corresponds to -using the -f flag. But if the original input to mkimage is a binary file -(already compiled) then the timestamp is assumed to have been set previously. +using +.BR -f . +But if the original input to mkimage is a binary file (already compiled), then +the timestamp is assumed to have been set previously. . .SH EXAMPLES .\" Reduce the width of the tab stops to something reasonable
Signature · 1 line
2.35.1
PATCH v2 9/14 doc: mkimage: Add BUGS section
In reply to Sean AndersonIn leiu of a non-standard HOMEPAGE section, add a BUGS section with a link to the issue tracker.
---
(no changes since v1)
doc/mkimage.1 | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
doc/mkimage.1 +5 -2
@@ -357,6 +357,11 @@ using But if the original input to mkimage is a binary file (already compiled), then the timestamp is assumed to have been set previously. . +.SH BUGS +Please report bugs to the +.UR https://\:source\:.denx\:.de/\:u-boot/\:u-boot/\:issues +U-Boot bug tracker +.UE . .SH EXAMPLES .\" Reduce the width of the tab stops to something reasonable .ta T 1i
@@ -449,8 +454,6 @@ file is required. .EE .RE . -.SH HOMEPAGE -http://www.denx.de/wiki/U-Boot/WebHome .PP .SH AUTHOR This manual page was written by Nobuhiro Iwamatsu <[email protected]>
Signature · 1 line
2.35.1
PATCH v2 10/14 doc: mkimage: Add SEE ALSO section
In reply to Sean AndersonThis adds a SEE ALSO section to link to similar man pages, as well as to the U-Boot documentation.
---
(no changes since v1)
doc/mkimage.1 | 8 ++++++++ 1 file changed, 8 insertions(+)
doc/mkimage.1 +8 -0
@@ -459,3 +459,11 @@ file is required. This manual page was written by Nobuhiro Iwamatsu <[email protected]> and Wolfgang Denk <[email protected]>. It was updated for image signing by Simon Glass <[email protected]>. +.SH SEE ALSO +.BR dtc (1), +.BR dumpimage (1), +.BR openssl (1), +the\~ +.UR https://\:u-boot\:.readthedocs\:.io/\:en/\:latest/\:index.html +U-Boot documentation +.UE
Signature · 1 line
2.35.1
PATCH v2 11/14 doc: mkimage: Remove AUTHORS section
In reply to Sean AndersonPer man-pages(7), "use of an AUTHORS section is strongly discouraged." Remove it, and instead add some copyright notices and an SPDX. The default license for U-Boot is GPL2, so that's what I put. The copyright dates are based on the commit dates.
---
Changes in v2:
- Ensure comments are requests
doc/mkimage.1 | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)
doc/mkimage.1 +6 -6
@@ -1,4 +1,9 @@ -.TH MKIMAGE 1 "2022-02-07" +.\" SPDX-License-Identifier: GPL-2.0 +.\" Copyright (C) 2022 Sean Anderson <[email protected]> +.\" Copyright (C) 2013-20 Simon Glass <[email protected]> +.\" Copyright (C) 2010 Nobuhiro Iwamatsu <[email protected]> +.\" Copyright (C) 2010 Wolfgang Denk <[email protected]> +.TH MKIMAGE 1 2022-06-11 U-Boot . .SH NAME mkimage \- generate images for U-Boot
@@ -454,11 +459,6 @@ file is required. .EE .RE . -.PP -.SH AUTHOR -This manual page was written by Nobuhiro Iwamatsu <[email protected]> -and Wolfgang Denk <[email protected]>. It was updated for image signing by -Simon Glass <[email protected]>. .SH SEE ALSO .BR dtc (1), .BR dumpimage (1),
Signature · 1 line
2.35.1
PATCH v2 12/14 mkimage: Add long options
In reply to Sean AndersonThe mkimage command has had many options added over the years. Unfortunately, we are starting to run out of short options. Recent options don't have any obvious relation to their meaning (e.g. -o/-g). Fortunately, long options exist. Add long options for each current short option.
For the curious, the remaining short options are HIkLmMPQSuUwWXyYzZ.
---
Changes in v2:
- New
doc/mkimage.1 | 66 +++++++++++++++++++++++++++++++++++++++++++++++++ tools/mkimage.c | 45 +++++++++++++++++++++++++++++++-- 2 files changed, 109 insertions(+), 2 deletions(-)
doc/mkimage.1 +66 -0
@@ -57,20 +57,28 @@ checksums. It also supports verified boot. . .TP .B \-h +.TQ +.B \-\-help Print a help message and exit. . .TP .B \-l +.TQ +.B \-\-list .B mkimage lists the information contained in the header of an existing U-Boot image. . .TP .B \-s +.TQ +.B \-\-no\-copy Don't copy in the image data. Depending on the image type, this may create just the header, everything but the image data, or nothing at all. . .TP .BI \-T " image-type" +.TQ +.BI \-\-type " image-type" Parse image file as .IR image-type . Pass
@@ -82,26 +90,36 @@ autodetected. . .TP .B \-q +.TQ +.B \-\-quiet Quiet. Don't print the image header. . .TP .B \-v +.TQ +.B \-\-verbose Verbose. Print file names as they are added to the image. . .TP .B \-V +.TQ +.B \-\-version Print version information and exit. . .SS Options for creating legacy or \(lqauto\(rq images . .TP .BI \-A " architecture" +.TQ +.BI \-\-architecture " architecture" Set the architecture. Pass .B \-h as the architecture to see the list of supported architectures. . .TP .BI \-O " os" +.TQ +.BI \-\-os " os" Set the operating system. The U-Boot .I bootm command changes boot method based on the OS type.
@@ -113,6 +131,8 @@ to see the list of supported OSs. . .TP .BI \-C " compression-type" +.TQ +.BI \-\-compression " compression-type" Set the compression type. The image data should have already been compressed using this compression type. .B mkimage
@@ -125,12 +145,16 @@ to see the list of supported compression types. . .TP .BI \-a " load-address" +.TQ +.BI \-\-load\-address " load-address" Set the absolute address to load the image data to. .I load-address will be interpreted as a hexadecimal number. . .TP .BI \-e " entry-point" +.TQ +.BI \-\-entry\-point " entry-point" Set the absolute address of the image entry point. The U-Boot .I bootm command will jump to this address after loading the image.
@@ -139,11 +163,15 @@ will be interpreted as a hexadecimal number. . .TP .BI \-n " image-name" +.TQ +.BI \-\-primary\-image " image-name" Set the image name to .IR image-name . . .TP .BI \-R " secondary-image-name" +.TQ +.BI \-\-secondary\-image " image-name" Some image types support a second image for additional data. For these types, use .B \-R
@@ -175,6 +203,8 @@ T} . .TP .BI \-d " image-data-file" +.TQ +.BI \-\-image " image-data-file" Use image data from .IR image-data-file . If the
@@ -189,6 +219,8 @@ then multiple images may be specified, separated by colons: . .TP .B \-x +.TQ +.B \-\-xip Set the .I XIP (execute in place) flag. The U-Boot
@@ -200,15 +232,21 @@ accessible at the load address (such as via memory-mapped flash). . .TP .BI \-b " device-tree-file" +.TQ +.BI \-\-device\-tree " device-tree-file" Appends the device tree binary file (.dtb) to the FIT. . .TP .BI \-c " comment" +.TQ +.BI \-\-comment " comment" Specifies a comment to be added when signing. This is typically a message which describes how the image was signed or some other useful information. . .TP .BI \-D " dtc-options" +.TQ +.BI \-\-dtcopts " dtc-options" Provide additional options to the device tree compiler when creating the image. See .BR dtc (1)
@@ -216,6 +254,8 @@ for documentation of possible options. . .TP .BI \-E +.TQ +.BI \-\-external After processing, move the image data outside the FIT and store a data offset in the FIT. Images will be placed one after the other immediately after the FIT, with each one aligned to a 4-byte boundary. The existing \(oqdata\(cq property
@@ -225,11 +265,15 @@ properties. A \(oqdata-offset\(cq of 0 indicates that it starts in the first . .TP .BI \-B " alignment" +.TQ +.BI \-\-alignment " alignment" The alignment, in hexadecimal, that external data will be aligned to. This option only has an effect when \-E is specified. . .TP .BI \-p " external-position" +.TQ +.BI \-\-position " external-position" Place external data at a static external position. Instead of writing a \(oqdata-offset\(cq property defining the offset from the end of the FIT, .B \-p
@@ -240,6 +284,8 @@ for details on using external data. . .TP \fB\-f \fIimage-tree-source-file\fR | \fBauto +.TQ +\fB\-\-fit \fIimage-tree-source-file\fR | \fBauto Image tree source file that describes the structure and contents of the FIT image. .IP
@@ -255,6 +301,8 @@ is required. . .TP .B \-F +.TQ +.B \-\-update Indicates that an existing FIT image should be modified. No dtc compilation will be performed and .B \-f
@@ -263,10 +311,14 @@ after initial image creation. . .TP .BI \-i " ramdisk-file" +.TQ +.BI \-\-initramfs " ramdisk-file" Append a ramdisk or initramfs file to the image. . .TP .BI \-k " key-directory" +.TQ +.BI \-\-key\-dir " key-directory" Specifies the directory containing keys to use for signing. This directory should contain a private key file .IR name .key
@@ -282,11 +334,15 @@ but may be overridden using . .TP .BI \-G " key-file" +.TQ +.BI \-\-key\-file " key-file" Specifies the private key file to use when signing. This option may be used instead of \-k. . .TP .BI \-K " key-destination" +.TQ +.BI \-\-key\-dest " key-destination" Specifies a compiled device tree binary file (typically .dtb) to write public key information into. When a private key is used to sign an image, the corresponding public key is written into this file for for run-time
@@ -295,6 +351,8 @@ CONFIG_OF_CONTROL in U-Boot. . .TP .BI \-g " key-name-hint" +.TQ +.BI \-\-key\-name\-hint " key-name-hint" Overrides the signature node's \(oqkey-name-hint\(cq property. This is especially useful when signing an image with .BR "\-f auto" .
@@ -309,6 +367,8 @@ must be specified as well. . .TP .BI \-o " crypto" , checksum +.TQ +.BI \-\-algo " crypto" , checksum Specifies the algorithm to be used for signing a FIT image. The default is taken from the signature node's \(oqalgo\(cq property. The valid values for
@@ -341,18 +401,24 @@ sha512 . .TP .B \-r +.TQ +.B \-\-key\-required Specifies that keys used to sign the FIT are required. This means that they must be verified for the image to boot. Without this option, the verification will be optional (useful for testing but not for release). . .TP .BI \-N " engine" +.TQ +.BI \-\-engine " engine" The openssl engine to use when signing and verifying the image. For a complete list of available engines, refer to .BR engine (1). . .TP .B \-t +.TQ +.B \-\-touch Update the timestamp in the FIT. .IP Normally the FIT timestamp is created the first time mkimage runs,
tools/mkimage.c +43 -2
69 lines not on this page · raw message
Signature · 1 line
2.35.1
PATCH v2 13/14 doc: mkimage: Further document -o and -R
In reply to Sean AndersonDespite the original description of these options, they are not always image names, or even files. Some image types use these options to convey configuration directly. Re-document these options as configuration options.
Additionally, add a new section documenting the format of the configuration for each image type which uses it. In general, if configuration is used directly (without a separate file) I have added documentation for it. If the configuration points to a separate file, I have referenced that file's documentation. Where there is no such documentation, I have added it.
---
Changes in v2:
- New
doc/mkimage.1 | 270 +++++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 236 insertions(+), 34 deletions(-)
doc/mkimage.1 +236 -34
@@ -162,44 +162,22 @@ command will jump to this address after loading the image. will be interpreted as a hexadecimal number. . .TP -.BI \-n " image-name" +.BI \-n " primary-configuration" .TQ -.BI \-\-primary\-image " image-name" -Set the image name to -.IR image-name . +.BI \-\-config " primary-configuration" +Images may require additional configuration not specified with other options, +often in a image-type-specific format. The image types which support this +option and the format of their configuration are listed in +.BR CONFIGURATION . . .TP -.BI \-R " secondary-image-name" +.BI \-R " secondary-configuration" .TQ -.BI \-\-secondary\-image " image-name" -Some image types support a second image for additional data. For these types, -use -.B \-R -to specify this second image. -.TS -allbox; -lb lbx -l l. -Image Type Secondary Image Description -pblimage Additional RCW-style header, typically used for PBI commands. -zynqimage, zynqmpimage T{ -Initialization parameters, one per line. Each parameter has the form -.sp -.ti 4 -.I address data -.sp -where -.I address -and -.I data -are hexadecimal integers. The boot ROM will write each -.I data -to -.I address -when loading the image. At most 256 parameters may be specified in this -manner. -T} -.TE +.BI \-\-secondary\-config " secondary-configuration" +Some image types support a second set of configuration data. The image types +which support secondary configuration and the formap of their configuration are +listed in +.BR CONFIGURATION . . .TP .BI \-d " image-data-file"
@@ -428,6 +406,230 @@ using But if the original input to mkimage is a binary file (already compiled), then the timestamp is assumed to have been set previously. . +.SH CONFIGURATION +This section documents the formats of the primary and secondary configuration +options for each image type which supports them. +. +.SS aisimage +The primary configuration is a file containing a series of +.I AIS +(Application Image Script) commands, one per line. Each command has the form +.RS +.P +.IR "command argument " .\|.\|. +.RE +.P +See +.UR https://\:www\:.ti\:.com/\:lit/\:pdf/\:spraag0 +TI application report SPRAAG0E +.UE +for details. +. +.SS atmelimage +The primary configuration is a comma-separated list of NAND Flash parameters of +the form +.RS +.P +\fIparameter\fB=\fIvalue\fR[\fB,\fIparameter\fB=\fIvalue\fR.\|.\|.\&] +.RE +.P +Valid +.IR parameter s +are +.RS +.P +.TS +lb. +usePmecc +nbSectorPerPage +spareSize +eccBitReq +sectorSize +eccOffset +.TE +.RE +.P +and valid +.IR value s +are decimal numbers. See section 11.4.4.1 of the SAMA5D3 Series Data Sheet for +valid values for each parameter. +. +.SS imximage +The primary configuration is a file containing configuration commands, as +documented in doc/\:imx/\:mkimage/\:imximage.txt of the U-Boot source. +. +.SS imx8image and imx8mimage +The primary configuration is a file containing configuration commands, as +documented in doc/\:imx/\:mkimage/\:imx8image.txt of the U-Boot source. +. +.SS kwbimage +The primary configuration is a file containing configuration commands, as +documented in doc/\:imx/\:mkimage/\:kwbimage.txt of the U-Boot source. +. +.SS mtk_image +The primary configuration is a semicolon-separated list of header options of the +form +.RS +.P +\fIkey\fB=\fIvalue\fR[\fB;\fIkey\fB=\fIvalue\fR.\|.\|.\&] +.RE +.P +where the valid keys are: +.RS +.P +.TS +lb lbx +lb l. +Key Description +_ +lk T{ +If \fB1\fP, then an \fILK\fP (legacy) image header is used. Otherwise, a +\fIBootROM\fP image header is used. +T} +lkname T{ +The name of the LK image header. The maximum length is 32 ASCII characters. If +not specified, the default value is \fBU-Boot\fP. +T} +media The boot device. See below for valid values. +nandinfo The desired NAND device type. See below for valid values. +arm64 If \fB1\fP, then this denotes an AArch64 image. +hdroffset Increase the reported size of the BRLYT header by this amount. +.TE +.RE +.P +Valid values for +.B media +are: +.RS +.P +.TS +lb lb +lb l. +Value Description +_ +nand Parallel NAND flash +snand Serial NAND flash +nor Serial NOR flash +emmc \fIeMMC\fP (Embedded Multi-Media Card) +sdmmc \fISD\fP (Secure Digital) card +.TE +.RE +.P +Valid values for +.B nandinfo +are: +.RS +.P +.TS +lb lb lb lb lb +lb l l l l. +Value NAND type Page size OOB size Total size +_ +2k+64 Serial 2KiB 64B +2k+120 Serial 2KiB 120B +2k+128 Serial 2KiB 128B +4k+256 Serial 4KiB 256B +1g:2k+64 Parallel 2KiB 64B 1Gbit +2g:2k+64 Parallel 2KiB 64B 2Gbit +4g:2k+64 Parallel 2KiB 64B 4Gbit +2g:2k+128 Parallel 2KiB 128B 2Gbit +4g:2k+128 Parallel 2KiB 128B 4Gbit +.TE +.RE +. +.SS mxsimage +The primary configuration is a file containing configuration commands, as +documented in doc/\:imx/\:mkimage/\:mxsimage.txt of the U-Boot source. +. +.SS omapimage +The primary configuration is the optional value +.BR byteswap . +If present, each 32-bit word of the image will have its bytes swapped +(converting from little-endian to big-endian, or vice versa). +. +.SS pblimage +The primary configuration is a file containing the +.I PBI +(Pre-Boot Image) header. Each line of the configuration has the format +.RS +.P +.IR value "[ " value .\|.\|.\&] +.RE +.P +Where +.I value +is a 32-bit hexadecimal integer. Each +.I value +will, after being converted to raw bytes, be literally prepended to the PBI. +.P +The secondary configuration is a file with the same format as the primary +configuration file. It will be inserted into the image after the primary +configuration data and before the image data. +.P +It is traditional to use the primary configuration file for the +.I RCW +(Reset Configuration Word), and the secondary configuration file for any +additional PBI commands. However, it is also possible to convert an existing PBI +to the above format and \(lqchain\(rq additional data onto the end of the +image. This may be especially useful for creating secure boot images. +. +.SS rkimage +The primary configuration is the name of the processor to generate the image +for. Valid values are: +.RS +.P +.TS +lb. +px30 +rk3036 +rk3066 +rk3128 +rk3188 +rk322x +rk3288 +rk3308 +rk3328 +rk3368 +rk3399 +rv1108 +rk3568 +.TE +.RE +. +.SS sunxi_egon +The primary configuration is the name to use for the device tree. +. +.SS ublimage +The primary configuration is a file containing configuration commands, as +documented in doc/\:README.ublimage of the U-Boot source. +. +.SS zynqimage and zynqmpimage +For +.BR zynqmpimage , +the primary configuration is a file containing the +.I PMUFW +(Power Management Unit Firmware). +.B zynqimage +does not use the primary configuration. +.P +For both image types, the secondary configuration is a file containinig +initialization parameters, one per line. Each parameter has the form +.RS +.P +.I address data +.RE +.P +where +.I address +and +.I data +are hexadecimal integers. The boot ROM will write each +.I data +to +.I address +when loading the image. At most 256 parameters may be specified in this +manner. +. .SH BUGS Please report bugs to the .UR https://\:source\:.denx\:.de/\:u-boot/\:u-boot/\:issues
Signature · 1 line
2.35.1
PATCH v2 14/14 doc: Add man page for dumpimage
In reply to Sean AndersonThis tool seems a bit underloved. Unfortunately, it seems to be missing support for FIT images. Alas...
Add a man page documenting it. The example is taken from commit a804b5ce2d ("Add dumpimage, a tool to extract data from U-Boot images").
---
Changes in v2:
- Ensure comments are requests
doc/dumpimage.1 | 103 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 103 insertions(+) create mode 100644 doc/dumpimage.1
doc/dumpimage.1 new file +103 -0
@@ -0,0 +1,103 @@ +.\" SPDX-License-Identifier: GPL-2.0 +.\" Copyright (C) 2022 Sean Anderson <[email protected]> +.TH DUMPIMAGE 1 2022-06-11 U-Boot +.SH NAME +dumpimage \- extract data from U-Boot images +. +.SH SYNOPSIS +.SY dumpimage +.OP \-T type +.BI \-l\~ image +.YS +.SY dumpimage +.OP \-T type +.OP \-p position +.BI \-o\~ outfile +.I image +.YS +.SY dumpimage +.B \-h +.YS +.SY dumpimage +.B \-V +.YS +. +.SH DESCRIPTION +.B dumpimage +lists and extracts data from U-Boot images. If +.B \-l +is specified, +.B dumpimage +lists the components in +.IR image . +Otherwise, +.B dumpimage +extracts the component at +.IR position " to " outfile . +. +.SH OPTIONS +.TP +.B \-h +Print usage information and exit. +. +.TP +.B \-l +Print the header information for +.IR image , +including a list of components. +. +.TP +.BI \-o " outfile" +The file to write the dumped component to. +.TP +.BI \-p " position" +Specify the +.I position +of the component to dump. This should be a numeric index, starting at 0. If not +specified, the default +.I position +is 0. +. +.TP +.BI \-T " type" +Specify the +.I type +of the image. If not specified, the image type will be automatically detected. A +list of supported image types may be printed by running +.BR "mkimage\~\-T\~list" . +. +.TP +.B \-V +Print version information and exit. +. +.SH BUGS +Please report bugs to the +.UR https://\:source\:.denx\:.de/\:u-boot/\:u-boot/\:issues +U-Boot bug tracker +.UE . +.SH EXAMPLES +Create a multi-file image and then extract part of that image +.PP +.EX +.in +4 +$ \c +.B mkimage \-A x86 \-O linux \-T multi \-n x86 \\\\\& +.in +4 +.B \-d vmlinuz:initrd.img:System.map multi.img +.in +Image Name: x86 +Created: Thu Jul 25 10:29:13 2013 +Image Type: Intel x86 Linux Multi-File Image (gzip compressed) +Data Size: 13722956 Bytes = 13401.32 kB = 13.09 MB +Load Address: 00000000 +Entry Point: 00000000 +Contents: + Image 0: 4040128 Bytes = 3945.44 kB = 3.85 MB + Image 1: 7991719 Bytes = 7804.41 kB = 7.62 MB + Image 2: 1691092 Bytes = 1651.46 kB = 1.61 MB +$ \c +.B dumpimage -p 2 -o System.map multi.img +.EE +.in +.SH SEE ALSO +.BR mkimage (1)
Signature · 1 line
2.35.1
Re: [PATCH v2 14/14] doc: Add man page for dumpimage
Quoted 25 lines · Sean Anderson
This tool seems a bit underloved. Unfortunately, it seems to be missing support for FIT images. Alas...
Add a man page documenting it. The example is taken from commit
a804b5ce2d("Add dumpimage, a tool to extract data from U-Boot images").Signed-off-by Sean Anderson <[email protected]>---
Changes in v2:
- Ensure comments are requestsdoc/dumpimage.1 | 103 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 103 insertions(+)create mode 100644 doc/dumpimage.1
doc/dumpimage.1 new file +3
-0@@ -0,0 +1,103 @@ +.\" SPDX-License-Identifier: GPL-2.0 +.\" Copyright (C) 2022 Sean Anderson <[email protected]> +.TH DUMPIMAGE 1 2022-06-11 U-Boot
doc/dumpimage.1 line 13
Quoted 10 lines
doc/dumpimage.1 new file +10
-0+.SH NAME +dumpimage \- extract data from U-Boot images +. +.SH SYNOPSIS +.SY dumpimage +.OP \-T type +.BI \-l\~ image +.YS +.SY dumpimage +.OP \-T type
The online help shows this parameter as optional.
doc/dumpimage.1 line 14
Quoted 1 line
doc/dumpimage.1 new file +1
-0+.OP \-p position
-p is optional so it should be in brackets.
doc/dumpimage.1 line 15
Quoted 1 line
doc/dumpimage.1 new file +1
-0+.BI \-o\~ outfile
-o is optional.
Best regards
Heinrich
Quoted 88 lines
doc/dumpimage.1 new file +88
-0+.I image +.YS +.SY dumpimage +.B \-h +.YS +.SY dumpimage +.B \-V +.YS +. +.SH DESCRIPTION +.B dumpimage +lists and extracts data from U-Boot images. If +.B \-l +is specified, +.B dumpimage +lists the components in +.IR image . +Otherwise, +.B dumpimage +extracts the component at +.IR position " to " outfile . +. +.SH OPTIONS +.TP +.B \-h +Print usage information and exit. +. +.TP +.B \-l +Print the header information for +.IR image , +including a list of components. +. +.TP +.BI \-o " outfile" +The file to write the dumped component to. +.TP +.BI \-p " position" +Specify the +.I position +of the component to dump. This should be a numeric index, starting at 0. If not +specified, the default +.I position +is 0. +. +.TP +.BI \-T " type" +Specify the +.I type +of the image. If not specified, the image type will be automatically detected. A +list of supported image types may be printed by running +.BR "mkimage\~\-T\~list" . +. +.TP +.B \-V +Print version information and exit. +. +.SH BUGS +Please report bugs to the +.UR https://\:source\:.denx\:.de/\:u-boot/\:u-boot/\:issues +U-Boot bug tracker +.UE . +.SH EXAMPLES +Create a multi-file image and then extract part of that image +.PP +.EX +.in +4 +$ \c +.B mkimage \-A x86 \-O linux \-T multi \-n x86 \\\\\& +.in +4 +.B \-d vmlinuz:initrd.img:System.map multi.img +.in +Image Name: x86 +Created: Thu Jul 25 10:29:13 2013 +Image Type: Intel x86 Linux Multi-File Image (gzip compressed) +Data Size: 13722956 Bytes = 13401.32 kB = 13.09 MB +Load Address: 00000000 +Entry Point: 00000000 +Contents: + Image 0: 4040128 Bytes = 3945.44 kB = 3.85 MB + Image 1: 7991719 Bytes = 7804.41 kB = 7.62 MB + Image 2: 1691092 Bytes = 1651.46 kB = 1.61 MB +$ \c +.B dumpimage -p 2 -o System.map multi.img +.EE +.in +.SH SEE ALSO +.BR mkimage (1)
Re: [PATCH v2 14/14] doc: Add man page for dumpimage
Quoted 39 lines · Heinrich Schuchardt
Quoted 25 lines · Sean Anderson
This tool seems a bit underloved. Unfortunately, it seems to be missing support for FIT images. Alas...
Add a man page documenting it. The example is taken from commit
a804b5ce2d("Add dumpimage, a tool to extract data from U-Boot images").Signed-off-by Sean Anderson <[email protected]>---
Changes in v2:
- Ensure comments are requestsdoc/dumpimage.1 | 103 ++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 103 insertions(+)create mode 100644 doc/dumpimage.1
doc/dumpimage.1 new file +3
-0@@ -0,0 +1,103 @@ +.\" SPDX-License-Identifier: GPL-2.0 +.\" Copyright (C) 2022 Sean Anderson <[email protected]> +.TH DUMPIMAGE 1 2022-06-11 U-Bootdoc/dumpimage.1 line 13
Quoted 10 lines
doc/dumpimage.1 new file +10
-0+.SH NAME +dumpimage \- extract data from U-Boot images +. +.SH SYNOPSIS +.SY dumpimage +.OP \-T type +.BI \-l\~ image +.YS +.SY dumpimage +.OP \-T typeThe online help shows this parameter as optional.
Quoted 3 lines
doc/dumpimage.1 line 14
Quoted 1 line
doc/dumpimage.1 new file +1
-0+.OP \-p position-p is optional so it should be in brackets.
.OP automatically adds brackets
Quoted 3 lines
doc/dumpimage.1 line 15
Quoted 1 line
doc/dumpimage.1 new file +1
-0+.BI \-o\~ outfile-o is optional.
It's only optional for -l, which is listed separately. See line 141 of tools/dumpimage.c.
--Sean
Quoted 89 lines
Quoted 88 lines
doc/dumpimage.1 new file +88
-0+.I image +.YS +.SY dumpimage +.B \-h +.YS +.SY dumpimage +.B \-V +.YS +. +.SH DESCRIPTION +.B dumpimage +lists and extracts data from U-Boot images. If +.B \-l +is specified, +.B dumpimage +lists the components in +.IR image . +Otherwise, +.B dumpimage +extracts the component at +.IR position " to " outfile . +. +.SH OPTIONS +.TP +.B \-h +Print usage information and exit. +. +.TP +.B \-l +Print the header information for +.IR image , +including a list of components. +. +.TP +.BI \-o " outfile" +The file to write the dumped component to. +.TP +.BI \-p " position" +Specify the +.I position +of the component to dump. This should be a numeric index, starting at 0. If not +specified, the default +.I position +is 0. +. +.TP +.BI \-T " type" +Specify the +.I type +of the image. If not specified, the image type will be automatically detected. A +list of supported image types may be printed by running +.BR "mkimage\~\-T\~list" . +. +.TP +.B \-V +Print version information and exit. +. +.SH BUGS +Please report bugs to the +.UR https://\:source\:.denx\:.de/\:u-boot/\:u-boot/\:issues +U-Boot bug tracker +.UE . +.SH EXAMPLES +Create a multi-file image and then extract part of that image +.PP +.EX +.in +4 +$ \c +.B mkimage \-A x86 \-O linux \-T multi \-n x86 \\\\\& +.in +4 +.B \-d vmlinuz:initrd.img:System.map multi.img +.in +Image Name: x86 +Created: Thu Jul 25 10:29:13 2013 +Image Type: Intel x86 Linux Multi-File Image (gzip compressed) +Data Size: 13722956 Bytes = 13401.32 kB = 13.09 MB +Load Address: 00000000 +Entry Point: 00000000 +Contents: + Image 0: 4040128 Bytes = 3945.44 kB = 3.85 MB + Image 1: 7991719 Bytes = 7804.41 kB = 7.62 MB + Image 2: 1691092 Bytes = 1651.46 kB = 1.61 MB +$ \c +.B dumpimage -p 2 -o System.map multi.img +.EE +.in +.SH SEE ALSO +.BR mkimage (1)