diff options
author | Simon Glass <sjg@chromium.org> | 2024-07-31 08:49:00 -0600 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2024-08-05 12:15:29 -0600 |
commit | 8436282e24df315a37bb0392fcf6212458239432 (patch) | |
tree | 71a1ff49bcd2944bd96db8e6f96ad76db0e50c68 /tools | |
parent | 59ca3a2f20f37fd45e4ccf266ae2df9379c7af91 (diff) | |
download | u-boot-8436282e24df315a37bb0392fcf6212458239432.tar.gz u-boot-8436282e24df315a37bb0392fcf6212458239432.tar.bz2 u-boot-8436282e24df315a37bb0392fcf6212458239432.zip |
mkeficapsule: Add a --version argument
Tools should have an option to obtain the version, so add this to the
mkeficapsule tool.
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/mkeficapsule.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/tools/mkeficapsule.c b/tools/mkeficapsule.c index 6a261ff549..c112ae2de8 100644 --- a/tools/mkeficapsule.c +++ b/tools/mkeficapsule.c @@ -21,6 +21,8 @@ #include <gnutls/pkcs7.h> #include <gnutls/abstract.h> +#include <version.h> + #include "eficapsule.h" static const char *tool_name = "mkeficapsule"; @@ -28,7 +30,7 @@ static const char *tool_name = "mkeficapsule"; efi_guid_t efi_guid_fm_capsule = EFI_FIRMWARE_MANAGEMENT_CAPSULE_ID_GUID; efi_guid_t efi_guid_cert_type_pkcs7 = EFI_CERT_TYPE_PKCS7_GUID; -static const char *opts_short = "g:i:I:v:p:c:m:o:dhARD"; +static const char *opts_short = "g:i:I:v:p:c:m:o:dhARDV"; enum { CAPSULE_NORMAL_BLOB = 0, @@ -70,6 +72,7 @@ static void print_usage(void) "\t-R, --fw-revert firmware revert capsule, takes no GUID, no image blob\n" "\t-o, --capoemflag Capsule OEM Flag, an integer between 0x0000 and 0xffff\n" "\t-D, --dump-capsule dump the contents of the capsule headers\n" + "\t-V, --version show version number\n" "\t-h, --help print a help message\n", tool_name); } @@ -969,6 +972,9 @@ int main(int argc, char **argv) case 'D': capsule_dump = true; break; + case 'V': + printf("mkeficapsule version %s\n", PLAIN_VERSION); + exit(EXIT_SUCCESS); default: print_usage(); exit(EXIT_SUCCESS); |