Add support to the mkeficapsule bintool for generating EFI capsules
through a config file.

Signed-off-by: Sughosh Ganu <sughosh.g...@linaro.org>
---
 tools/binman/btool/mkeficapsule.py | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/tools/binman/btool/mkeficapsule.py 
b/tools/binman/btool/mkeficapsule.py
index 61179747ff..b0599aa506 100644
--- a/tools/binman/btool/mkeficapsule.py
+++ b/tools/binman/btool/mkeficapsule.py
@@ -20,6 +20,7 @@ Options:
        -A, --fw-accept  firmware accept capsule, requires GUID, no image blob
        -R, --fw-revert  firmware revert capsule, takes no GUID, no image blob
        -o, --capoemflag Capsule OEM Flag, an integer between 0x0000 and 0xffff
+       -f, --cfg-file <config file> config file with capsule parameters
        -h, --help                  print a help message
 """
 
@@ -80,6 +81,21 @@ class Bintoolmkeficapsule(bintool.Bintool):
 
         return self.run_cmd(*args)
 
+    def generate_capsule_cfg_file(self, cfg_file):
+        """Generate a capsule reading parameters from config file
+
+        Args:
+            cfg_file (str): Path to the config file
+
+        Returns:
+            None
+        """
+        args = [
+            f'--cfg-file={cfg_file}'
+        ]
+
+        self.run_cmd(*args)
+
     def fetch(self, method):
         """Fetch handler for mkeficapsule
 
-- 
2.34.1

Reply via email to