]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
binman: Override CheckOptional in fit entry
authorJonas Karlman <jonas@kwiboo.se>
Tue, 18 Jul 2023 20:34:36 +0000 (20:34 +0000)
committerSimon Glass <sjg@chromium.org>
Wed, 2 Aug 2023 18:05:57 +0000 (12:05 -0600)
Missing optional blobs was not reported for generated entries, e.g.
tee-os on rockchip targets. Implement a CheckOptional to fix this.

After this the following can be shown:

  Image 'simple-bin' is missing optional external blobs but is still functional: tee-os

  /binman/simple-bin/fit/images/@tee-SEQ/tee-os (tee-os):
     See the documentation for your board. You may need to build Open Portable
     Trusted Execution Environment (OP-TEE) and build with TEE=/path/to/tee.bin

Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Reviewed-by: Simon Glass <sjg@chromium.org>
tools/binman/etype/fit.py
tools/binman/ftest.py
tools/binman/test/264_tee_os_opt_fit.dts

index ef4d0667578d383b88b94b03b97ce6dfc9326827..2c14b15b03cdafdd8ca0f31ca12358d63657c342 100644 (file)
@@ -842,6 +842,13 @@ class Entry_fit(Entry_section):
         for entry in self._priv_entries.values():
             entry.CheckMissing(missing_list)
 
+    def CheckOptional(self, optional_list):
+        # We must use our private entry list for this since generator nodes
+        # which are removed from self._entries will otherwise not show up as
+        # optional
+        for entry in self._priv_entries.values():
+            entry.CheckOptional(optional_list)
+
     def CheckEntries(self):
         pass
 
index 36c72bed35f6424113e187d9650b67e0cbf6d532..a5ce44bbb2d4d09ffa136cc3044e79749949060a 100644 (file)
@@ -6358,6 +6358,13 @@ fdt         fdtmap                Extract the devicetree blob from the fdtmap
                          fdt_util.fdt32_to_cpu(node.props['entry'].value))
         self.assertEqual(U_BOOT_DATA, node.props['data'].bytes)
 
+        with test_util.capture_sys_output() as (stdout, stderr):
+            self.checkFitTee('264_tee_os_opt_fit.dts', '')
+        err = stderr.getvalue()
+        self.assertRegex(
+            err,
+            "Image '.*' is missing optional external blobs but is still functional: tee-os")
+
     def testFitTeeOsOptionalFitBad(self):
         """Test an image with a FIT with an optional OP-TEE binary"""
         with self.assertRaises(ValueError) as exc:
index ae44b433edf18629006ab42b14de3cdf21cb18c4..e9634d3ccdcd43264ad509720cf90874814b767f 100644 (file)
@@ -25,6 +25,7 @@
                                        fit,data;
 
                                        tee-os {
+                                               optional;
                                        };
                                };
                        };