From: Simon Glass <sjg@chromium.org>
Date: Wed, 31 Jul 2024 14:49:02 +0000 (-0600)
Subject: binman: Deal with mkeficapsule being missing
X-Git-Tag: v2025.01-rc5-pxa1908~346^2~5
X-Git-Url: http://git.dujemihanovic.xyz/%22http:/www.sics.se/static/%7B%7B%20%24.Site.BaseURL%20%7D%7Dposts/%7B%7B%20%24style.Permalink%20%7D%7D?a=commitdiff_plain;h=2e658c18096bc62840e081055a4e35f28c50ec2f;p=u-boot.git

binman: Deal with mkeficapsule being missing

Tools cannot be assumed to be present. Add a check for this with the
mkeficpasule tool.

Signed-off-by: Simon Glass <sjg@chromium.org>
Fixes: b617611b27a ("binman: capsule: Add support for generating...")
---

diff --git a/tools/binman/etype/efi_capsule.py b/tools/binman/etype/efi_capsule.py
index 751f654bf3..1c4d1bb0e2 100644
--- a/tools/binman/etype/efi_capsule.py
+++ b/tools/binman/etype/efi_capsule.py
@@ -150,6 +150,10 @@ class Entry_efi_capsule(Entry_section):
         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')