diff mbox series

[2/8] btool: mkeficapsule: Generate capsule through a config file

Message ID 20230908120002.29851-3-sughosh.ganu@linaro.org
State New
Headers show
Series Add some more EFI capsule tooling support | expand

Commit Message

Sughosh Ganu Sept. 8, 2023, 11:59 a.m. UTC
Add support to the mkeficapsule bintool for generating EFI capsules
through a config file.

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

Patch

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