summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
Diffstat (limited to 'tools')
-rw-r--r--tools/binman/btool/mkeficapsule.py3
-rw-r--r--tools/binman/etype/efi_capsule.py5
-rw-r--r--tools/mkeficapsule.c10
3 files changed, 14 insertions, 4 deletions
diff --git a/tools/binman/btool/mkeficapsule.py b/tools/binman/btool/mkeficapsule.py
index ef1da638df1..f7e5a886849 100644
--- a/tools/binman/btool/mkeficapsule.py
+++ b/tools/binman/btool/mkeficapsule.py
@@ -33,7 +33,8 @@ class Bintoolmkeficapsule(bintool.Bintool):
commandline, or through a config file.
"""
def __init__(self, name):
- super().__init__(name, 'mkeficapsule tool for generating capsules')
+ super().__init__(name, 'mkeficapsule tool for generating capsules',
+ r'mkeficapsule version (.*)')
def generate_capsule(self, image_index, image_guid, hardware_instance,
payload, output_fname, priv_key, pub_key,
diff --git a/tools/binman/etype/efi_capsule.py b/tools/binman/etype/efi_capsule.py
index 751f654bf31..5941545d0b2 100644
--- a/tools/binman/etype/efi_capsule.py
+++ b/tools/binman/etype/efi_capsule.py
@@ -148,8 +148,11 @@ class Entry_efi_capsule(Entry_section):
self.fw_version,
self.oem_flags)
if ret is not None:
- os.remove(payload)
return tools.read_file(capsule_fname)
+ else:
+ # Bintool is missing; just use the input data as the output
+ self.record_missing_bintool(self.mkeficapsule)
+ return data
def AddBintools(self, btools):
self.mkeficapsule = self.AddBintool(btools, 'mkeficapsule')
diff --git a/tools/mkeficapsule.c b/tools/mkeficapsule.c
index 6a261ff549d..f28008a0829 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,9 +972,12 @@ 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);
+ exit(EXIT_FAILURE);
}
}