Skip to contentSkip to conversation

binman: Show missing blob message when building U-Boot

PATCH Applied Jonas Karlman 3 participants 29 messages Feb 19, 2023 – Mar 16, 2023 Kbuild

v1 of 2 Applied Latest is v2 →

lore
Share & tools
lore
#0 lore raw

cover binman: Show missing blob message when building U-Boot

binman currently support showing a helpful missing blob message, but only when the --allow-missing flag is used.

This changes so that binman is invoked with the --allow-missing flag and the helpful message can be shown by default when building U-Boot.

Using the following:

make rockpro64-rk3399_defconfig
make CROSS_COMPILE="aarch64-linux-gnu-"

Before this series a build fails with:

binman: Filename 'atf-bl31' not found in input path (...)

After this series a build fails with:

Image 'simple-bin' is missing external blobs and is non-functional: atf-bl31

/binman/simple-bin/fit/images/@atf-SEQ/atf-bl31 (atf-bl31):
See the documentation for your board. You may need to build ARM Trusted Firmware and build with BL31=/path/to/bl31.bin

Image 'simple-bin' is missing 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) with TEE=/path/to/tee.bin

Some images are invalid

Builds will continue to fail when there is missing blobs, and the use of BINMAN_ALLOW_MISSING=1 now only enables the --ignore-missing flag.

This series also fixes a few minor issues that prevented some missing and optional blobs to be detected for fit and mkimage entries.

Patch 1-3 contains spelling fixes and code cleanup for related parts. Patch 4-6 improve missing/optional detection for fit and mkimage entries. Patch 7-8 improve the missing blob warning message output. Patch 9 finally update Makefile to always pass the --allow-missing flag.

The series is based on top of [1], and is the follow-up series meant to address the issue with missing blob message for mkimage entries.

[1] https://patchwork.ozlabs.org/project/uboot/cover/[email protected]/

Jonas Karlman (9):
binman: Remove redundant SetAllowFakeBlob from blob-ext entry
binman: Fix spelling of nodes in code comments
binman: Use correct argument name in docstrings
binman: Override CheckOptional in fit entry
binman: Implement missing check functions in mkimage entry
binman: Mark mkimage entry missing when its subnodes is missing
binman: Fix blank line usage for invalid images warning text
binman: Show filename in missing blob help message
Makefile: Show binman missing blob message

 Makefile                                      |  2 +-
 tools/binman/control.py                       | 24 ++++++---
 tools/binman/entry.py                         |  2 +-
 tools/binman/etype/blob.py                    |  2 +-
 tools/binman/etype/blob_ext.py                |  8 ---
 tools/binman/etype/fit.py                     |  9 +++-
 tools/binman/etype/mkimage.py                 | 54 ++++++++++++++++++-
 tools/binman/etype/section.py                 |  6 +--
 tools/binman/ftest.py                         |  9 ++++
 tools/binman/state.py                         |  2 +-
 .../test/278_mkimage_missing_multiple.dts     | 19 +++++++
 11 files changed, 111 insertions(+), 26 deletions(-)
 create mode 100644 tools/binman/test/278_mkimage_missing_multiple.dts
Signature · 1 line
2.39.2
#1 lore raw

PATCH 1/9 binman: Remove redundant SetAllowFakeBlob from blob-ext entry

Entry_blob_ext contains an implementation of SetAllowFakeBlob that is identical to the one in the base Entry class, remove it.

---
 tools/binman/etype/blob_ext.py | 8 --------
 1 file changed, 8 deletions(-)
tools/binman/etype/blob_ext.py +0 -8
index fba6271de2bb..d6b0ca17c3f3 100644
@@ -26,11 +26,3 @@ class Entry_blob_ext(Entry_blob):
     def __init__(self, section, etype, node):
         Entry_blob.__init__(self, section, etype, node)
         self.external = True
-
-    def SetAllowFakeBlob(self, allow_fake):
-        """Set whether the entry allows to create a fake blob
-
-        Args:
-            allow_fake_blob: True if allowed, False if not allowed
-        """
-        self.allow_fake = allow_fake
Signature · 1 line
2.39.2
Reviewed-by on v1 1/9
#2 lore raw

Re: [PATCH 1/9] binman: Remove redundant SetAllowFakeBlob from blob-ext entry

Quoted 9 lines · Jonas Karlman

Entry_blob_ext contains an implementation of SetAllowFakeBlob that is identical to the one in the base Entry class, remove it.

---
 tools/binman/etype/blob_ext.py | 8 --------
 1 file changed, 8 deletions(-)
Reviewed-by
#3 lore raw

Re: [PATCH 1/9] binman: Remove redundant SetAllowFakeBlob from blob-ext entry

Quoted 9 lines · Jonas Karlman

Entry_blob_ext contains an implementation of SetAllowFakeBlob that is identical to the one in the base Entry class, remove it.

---
 tools/binman/etype/blob_ext.py | 8 --------
 1 file changed, 8 deletions(-)

Applied to u-boot-dm/next, thanks!

#4 lore raw

PATCH 2/9 binman: Fix spelling of nodes in code comments

In reply to Jonas Karlman

Replace notes with nodes in code comments and docstrings.

---
 tools/binman/etype/fit.py     | 2 +-
 tools/binman/etype/section.py | 2 +-
 tools/binman/state.py         | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)
tools/binman/etype/fit.py +1 -1
index cd2943533ce2..822de7982768 100644
@@ -823,7 +823,7 @@ class Entry_fit(Entry_section):
         self.mkimage = self.AddBintool(btools, 'mkimage')
 
     def CheckMissing(self, missing_list):
-        # We must use our private entry list for this since generator notes
+        # We must use our private entry list for this since generator nodes
         # which are removed from self._entries will otherwise not show up as
         # missing
         for entry in self._priv_entries.values():
tools/binman/etype/section.py +1 -1
index 57b91ff726c0..8bf5aa437d1a 100644
@@ -172,7 +172,7 @@ class Entry_section(Entry):
     def IsSpecialSubnode(self, node):
         """Check if a node is a special one used by the section itself
 
-        Some notes are used for hashing / signatures and do not add entries to
+        Some nodes are used for hashing / signatures and do not add entries to
         the actual section.
 
         Returns:
tools/binman/state.py +1 -1
index 56e5bf8bc10f..33563199840e 100644
@@ -306,7 +306,7 @@ def GetUpdateNodes(node, for_repack=False):
     """Yield all the nodes that need to be updated in all device trees
 
     The property referenced by this node is added to any device trees which
-    have the given node. Due to removable of unwanted notes, SPL and TPL may
+    have the given node. Due to removable of unwanted nodes, SPL and TPL may
     not have this node.
 
     Args:
Signature · 1 line
2.39.2
Reviewed-by on v1 2/9
#5 lore raw

Re: [PATCH 2/9] binman: Fix spelling of nodes in code comments

Quoted 9 lines · Jonas Karlman

Replace notes with nodes in code comments and docstrings.

---
 tools/binman/etype/fit.py     | 2 +-
 tools/binman/etype/section.py | 2 +-
 tools/binman/state.py         | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)
Reviewed-by
#6 lore raw

Re: [PATCH 2/9] binman: Fix spelling of nodes in code comments

Quoted 9 lines · Jonas Karlman

Replace notes with nodes in code comments and docstrings.

---
 tools/binman/etype/fit.py     | 2 +-
 tools/binman/etype/section.py | 2 +-
 tools/binman/state.py         | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

Applied to u-boot-dm/next, thanks!

#7 lore raw

PATCH 3/9 binman: Use correct argument name in docstrings

In reply to Jonas Karlman

Use correct argument name in docstrings.

---
 tools/binman/entry.py         | 2 +-
 tools/binman/etype/blob.py    | 2 +-
 tools/binman/etype/section.py | 4 ++--
 3 files changed, 4 insertions(+), 4 deletions(-)
tools/binman/entry.py +1 -1
index 5eacc5fa6c42..52b5d335f8ba 100644
@@ -1104,7 +1104,7 @@ features to produce new behaviours.
         If there are faked blobs, the entries are added to the list
 
         Args:
-            fake_blobs_list: List of Entry objects to be added to
+            faked_blobs_list: List of Entry objects to be added to
         """
         # This is meaningless for anything other than blobs
         pass
tools/binman/etype/blob.py +1 -1
index c7ddcedffb82..a80741e36338 100644
@@ -102,7 +102,7 @@ class Entry_blob(Entry):
         If there are faked blobs, the entries are added to the list
 
         Args:
-            fake_blobs_list: List of Entry objects to be added to
+            faked_blobs_list: List of Entry objects to be added to
         """
         if self.faked:
             faked_blobs_list.append(self)
tools/binman/etype/section.py +2 -2
index 8bf5aa437d1a..d3926f791c72 100644
@@ -885,7 +885,7 @@ class Entry_section(Entry):
         """Set whether a section allows to create a fake blob
 
         Args:
-            allow_fake_blob: True if allowed, False if not allowed
+            allow_fake: True if allowed, False if not allowed
         """
         super().SetAllowFakeBlob(allow_fake)
         for entry in self._entries.values():
@@ -909,7 +909,7 @@ class Entry_section(Entry):
         If there are faked blobs, the entries are added to the list
 
         Args:
-            fake_blobs_list: List of Entry objects to be added to
+            faked_blobs_list: List of Entry objects to be added to
         """
         for entry in self._entries.values():
             entry.CheckFakedBlobs(faked_blobs_list)
Signature · 1 line
2.39.2
Reviewed-by on v1 3/9
#8 lore raw

Re: [PATCH 3/9] binman: Use correct argument name in docstrings

Quoted 9 lines · Jonas Karlman

Use correct argument name in docstrings.

---
 tools/binman/entry.py         | 2 +-
 tools/binman/etype/blob.py    | 2 +-
 tools/binman/etype/section.py | 4 ++--
 3 files changed, 4 insertions(+), 4 deletions(-)
Reviewed-by
#9 lore raw

Re: [PATCH 3/9] binman: Use correct argument name in docstrings

Quoted 9 lines · Jonas Karlman

Use correct argument name in docstrings.

---
 tools/binman/entry.py         | 2 +-
 tools/binman/etype/blob.py    | 2 +-
 tools/binman/etype/section.py | 4 ++--
 3 files changed, 4 insertions(+), 4 deletions(-)

Applied to u-boot-dm/next, thanks!

#10 lore raw

PATCH 4/9 binman: Override CheckOptional in fit entry

In reply to Jonas Karlman

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 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) with TEE=/path/to/tee.bin

---
 tools/binman/etype/fit.py | 7 +++++++
 1 file changed, 7 insertions(+)
tools/binman/etype/fit.py +7 -0
index 822de7982768..314e03b4a964 100644
@@ -828,3 +828,10 @@ class Entry_fit(Entry_section):
         # missing
         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)
Signature · 1 line
2.39.2
Reviewed-by on v1 4/9
#11 lore raw

Re: [PATCH 4/9] binman: Override CheckOptional in fit entry

Quoted 8 lines · Jonas Karlman

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 external blobs but is still functional: tee-os

Quoted 9 lines

/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) with TEE=/path/to/tee.bin

---
 tools/binman/etype/fit.py | 7 +++++++
 1 file changed, 7 insertions(+)

Do we need a test for this?

#12 lore raw

PATCH 5/9 binman: Implement missing check functions in mkimage entry

In reply to Jonas Karlman

The mkimage entry is working like a section entry but inherits from Entry not Entry_section. Copy implementations of missing Check-functions from Entry_section and adopt to Entry_mkimage.

---
 tools/binman/etype/mkimage.py | 44 ++++++++++++++++++++++++++++++++++-
 1 file changed, 43 insertions(+), 1 deletion(-)
tools/binman/etype/mkimage.py +43 -1
index cb264c3cad0b..49d3462a154c 100644
@@ -206,16 +206,31 @@ class Entry_mkimage(Entry):
             self._imagename.SetAllowMissing(allow_missing)
 
     def SetAllowFakeBlob(self, allow_fake):
-        """Set whether the sub nodes allows to create a fake blob
+        """Set whether a section allows to create a fake blob
 
         Args:
             allow_fake: True if allowed, False if not allowed
         """
+        super().SetAllowFakeBlob(allow_fake)
         for entry in self._mkimage_entries.values():
             entry.SetAllowFakeBlob(allow_fake)
         if self._imagename:
             self._imagename.SetAllowFakeBlob(allow_fake)
 
+    def CheckMissing(self, missing_list):
+        """Check if any entries in this section have missing external blobs
+
+        If there are missing (non-optional) blobs, the entries are added to the
+        list
+
+        Args:
+            missing_list: List of Entry objects to be added to
+        """
+        for entry in self._mkimage_entries.values():
+            entry.CheckMissing(missing_list)
+        if self._imagename:
+            self._imagename.CheckMissing(missing_list)
+
     def CheckFakedBlobs(self, faked_blobs_list):
         """Check if any entries in this section have faked external blobs
 
@@ -229,6 +244,33 @@ class Entry_mkimage(Entry):
         if self._imagename:
             self._imagename.CheckFakedBlobs(faked_blobs_list)
 
+    def CheckOptional(self, optional_list):
+        """Check the section for missing but optional external blobs
+
+        If there are missing (optional) blobs, the entries are added to the list
+
+        Args:
+            optional_list (list): List of Entry objects to be added to
+        """
+        for entry in self._mkimage_entries.values():
+            entry.CheckOptional(optional_list)
+        if self._imagename:
+            self._imagename.CheckOptional(optional_list)
+
+    def check_missing_bintools(self, missing_list):
+        """Check if any entries in this section have missing bintools
+
+        If there are missing bintools, these are added to the list
+
+        Args:
+            missing_list: List of Bintool objects to be added to
+        """
+        super().check_missing_bintools(missing_list)
+        for entry in self._mkimage_entries.values():
+            entry.check_missing_bintools(missing_list)
+        if self._imagename:
+            self._imagename.check_missing_bintools(missing_list)
+
     def AddBintools(self, btools):
         super().AddBintools(btools)
         self.mkimage = self.AddBintool(btools, 'mkimage')
Signature · 1 line
2.39.2
#13 lore raw

Re: [PATCH 5/9] binman: Implement missing check functions in mkimage entry

Quoted 9 lines · Jonas Karlman

The mkimage entry is working like a section entry but inherits from Entry not Entry_section. Copy implementations of missing Check-functions from Entry_section and adopt to Entry_mkimage.

---
 tools/binman/etype/mkimage.py | 44 ++++++++++++++++++++++++++++++++++-
 1 file changed, 43 insertions(+), 1 deletion(-)

Again I suspect this needs a test to make sure it works?

#14 lore raw

PATCH 6/9 binman: Mark mkimage entry missing when its subnodes is missing

In reply to Jonas Karlman

Using the mkimage entry with the multiple-data-files prop and having a missing external blob result in an unexpected ValueError exception using the --allow-missing flag.

ValueError: Filename 'missing.bin' not found in input path (...)

Fix this by using _pathname that is resolved by ObtainContents for blob entries, ObtainContents also handles allow missing for external blobs.

Mark mkimage entry as missing and return without running mkimage when missing entries is reported by CheckMissing.

---
 tools/binman/etype/mkimage.py                 | 10 +++++++++-
 tools/binman/ftest.py                         |  9 +++++++++
 .../test/278_mkimage_missing_multiple.dts     | 19 +++++++++++++++++++
 3 files changed, 37 insertions(+), 1 deletion(-)
 create mode 100644 tools/binman/test/278_mkimage_missing_multiple.dts
tools/binman/etype/mkimage.py +9 -1
index 49d3462a154c..2673a8607f37 100644
@@ -156,7 +156,8 @@ class Entry_mkimage(Entry):
             for entry in self._mkimage_entries.values():
                 if not entry.ObtainContents(fake_size=fake_size):
                     return False
-                fnames.append(tools.get_input_filename(entry.GetDefaultFilename()))
+                if entry._pathname:
+                    fnames.append(entry._pathname)
             input_fname = ":".join(fnames)
         else:
             data, input_fname, uniq = self.collect_contents_to_file(
@@ -171,6 +172,13 @@ class Entry_mkimage(Entry):
         outfile = self._filename if self._filename else 'mkimage-out.%s' % uniq
         output_fname = tools.get_output_filename(outfile)
 
+        missing_list = []
+        self.CheckMissing(missing_list)
+        self.missing = bool(missing_list)
+        if self.missing:
+            self.SetContents(b'')
+            return self.allow_missing
+
         args = ['-d', input_fname]
         if self._data_to_imagename:
             args += ['-n', input_fname]
tools/binman/ftest.py +9 -0
index 48ac1540bfd8..803b8c5accf4 100644
@@ -6393,6 +6393,15 @@ fdt         fdtmap                Extract the devicetree blob from the fdtmap
         data = self._DoReadFile('277_rockchip_tpl.dts')
         self.assertEqual(ROCKCHIP_TPL_DATA, data[:len(ROCKCHIP_TPL_DATA)])
 
+    def testMkimageMissingBlobMultiple(self):
+        """Test using mkimage to build an image"""
+        with test_util.capture_sys_output() as (stdout, stderr):
+            self._DoTestFile('278_mkimage_missing_multiple.dts', allow_missing=True)
+        err = stderr.getvalue()
+        self.assertRegex(
+            err,
+            "Image '.*' is missing external blobs and is non-functional: .*")
+
 
 if __name__ == "__main__":
     unittest.main()
tools/binman/test/278_mkimage_missing_multiple.dts new file +19 -0
new file mode 100644
index 000000000000..f84aea49ead9
@@ -0,0 +1,19 @@
+// SPDX-License-Identifier: GPL-2.0+
+
+/dts-v1/;
+
+/ {
+	#address-cells = <1>;
+	#size-cells = <1>;
+
+	binman {
+		mkimage {
+			args = "-n test -T script";
+			multiple-data-files;
+
+			blob-ext {
+				filename = "missing.bin";
+			};
+		};
+	};
+};
Signature · 1 line
2.39.2
Reviewed-by on v1 6/9
#15 lore raw

Re: [PATCH 6/9] binman: Mark mkimage entry missing when its subnodes is missing

Quoted 13 lines · Jonas Karlman

Using the mkimage entry with the multiple-data-files prop and having a missing external blob result in an unexpected ValueError exception using the --allow-missing flag.

ValueError: Filename 'missing.bin' not found in input path (...)

Fix this by using _pathname that is resolved by ObtainContents for blob entries, ObtainContents also handles allow missing for external blobs.

Mark mkimage entry as missing and return without running mkimage when missing entries is reported by CheckMissing.

Quoted 8 lines
---
 tools/binman/etype/mkimage.py                 | 10 +++++++++-
 tools/binman/ftest.py                         |  9 +++++++++
 .../test/278_mkimage_missing_multiple.dts     | 19 +++++++++++++++++++
 3 files changed, 37 insertions(+), 1 deletion(-)
 create mode 100644 tools/binman/test/278_mkimage_missing_multiple.dts
#16 lore raw

PATCH 7/9 binman: Fix blank line usage for invalid images warning text

In reply to Jonas Karlman

There is no blank line between last missing blob help message and the header line for optional blob help messages.

Image 'simple-bin' is missing external blobs and is non-functional: atf-bl31

/binman/simple-bin/fit/images/@atf-SEQ/atf-bl31:
See the documentation for your board. You may need to build ARM Trusted Firmware and build with BL31=/path/to/bl31.bin
Image 'simple-bin' is missing external blobs but is still functional: tee-os

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

Some images are invalid

With this a blank line is inserted to make the text more readable.

---
 tools/binman/control.py | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)
tools/binman/control.py +7 -6
index e64740094f60..b5ede60c1cde 100644
@@ -106,9 +106,10 @@ def _ReadMissingBlobHelp():
     return result
 
 def _ShowBlobHelp(path, text):
-    tout.warning('\n%s:' % path)
+    tout.warning('%s:' % path)
     for line in text.splitlines():
         tout.warning('   %s' % line)
+    tout.warning('')
 
 def _ShowHelpForMissingBlobs(missing_list):
     """Show help for each missing blob to help the user take action
@@ -598,7 +599,7 @@ def ProcessImage(image, update_fdt, write_map, get_contents=True,
     missing_list = []
     image.CheckMissing(missing_list)
     if missing_list:
-        tout.warning("Image '%s' is missing external blobs and is non-functional: %s" %
+        tout.warning("Image '%s' is missing external blobs and is non-functional: %s\n" %
                      (image.name, ' '.join([e.name for e in missing_list])))
         _ShowHelpForMissingBlobs(missing_list)
 
@@ -606,7 +607,7 @@ def ProcessImage(image, update_fdt, write_map, get_contents=True,
     image.CheckFakedBlobs(faked_list)
     if faked_list:
         tout.warning(
-            "Image '%s' has faked external blobs and is non-functional: %s" %
+            "Image '%s' has faked external blobs and is non-functional: %s\n" %
             (image.name, ' '.join([os.path.basename(e.GetDefaultFilename())
                                    for e in faked_list])))
 
@@ -614,7 +615,7 @@ def ProcessImage(image, update_fdt, write_map, get_contents=True,
     image.CheckOptional(optional_list)
     if optional_list:
         tout.warning(
-            "Image '%s' is missing external blobs but is still functional: %s" %
+            "Image '%s' is missing external blobs but is still functional: %s\n" %
             (image.name, ' '.join([e.name for e in optional_list])))
         _ShowHelpForMissingBlobs(optional_list)
 
@@ -622,7 +623,7 @@ def ProcessImage(image, update_fdt, write_map, get_contents=True,
     image.check_missing_bintools(missing_bintool_list)
     if missing_bintool_list:
         tout.warning(
-            "Image '%s' has missing bintools and is non-functional: %s" %
+            "Image '%s' has missing bintools and is non-functional: %s\n" %
             (image.name, ' '.join([os.path.basename(bintool.name)
                                    for bintool in missing_bintool_list])))
     return any([missing_list, faked_list, missing_bintool_list])
@@ -756,7 +757,7 @@ def Binman(args):
             # This can only be True if -M is provided, since otherwise binman
             # would have raised an error already
             if invalid:
-                msg = '\nSome images are invalid'
+                msg = 'Some images are invalid'
                 if args.ignore_missing:
                     tout.warning(msg)
                 else:
Signature · 1 line
2.39.2
Reviewed-by on v1 7/9
#17 lore raw

Re: [PATCH 7/9] binman: Fix blank line usage for invalid images warning text

Quoted 15 lines · Jonas Karlman

There is no blank line between last missing blob help message and the header line for optional blob help messages.

Image 'simple-bin' is missing external blobs and is non-functional: atf-bl31

/binman/simple-bin/fit/images/@atf-SEQ/atf-bl31:
See the documentation for your board. You may need to build ARM Trusted Firmware and build with BL31=/path/to/bl31.bin
Image 'simple-bin' is missing external blobs but is still functional: tee-os

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

Quoted 9 lines

Some images are invalid

With this a blank line is inserted to make the text more readable.

---
 tools/binman/control.py | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)
#18 lore raw

PATCH 8/9 binman: Show filename in missing blob help message

In reply to Jonas Karlman

Show the filename next to the node path in missing blob help messages, also show a generic missing blob message when there was no help message for the help tag.

---
 tools/binman/control.py | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)
tools/binman/control.py +10 -3
index b5ede60c1cde..a5ff1cb56245 100644
@@ -105,8 +105,8 @@ def _ReadMissingBlobHelp():
     _FinishTag(tag, msg, result)
     return result
 
-def _ShowBlobHelp(path, text):
-    tout.warning('%s:' % path)
+def _ShowBlobHelp(path, text, fname):
+    tout.warning('%s (%s):' % (path, fname))
     for line in text.splitlines():
         tout.warning('   %s' % line)
     tout.warning('')
@@ -126,10 +126,17 @@ def _ShowHelpForMissingBlobs(missing_list):
         tags = entry.GetHelpTags()
 
         # Show the first match help message
+        shown_help = False
         for tag in tags:
             if tag in missing_blob_help:
-                _ShowBlobHelp(entry._node.path, missing_blob_help[tag])
+                _ShowBlobHelp(entry._node.path, missing_blob_help[tag],
+                              entry.GetDefaultFilename())
+                shown_help = True
                 break
+        # Or a generic help message
+        if not shown_help:
+            _ShowBlobHelp(entry._node.path, "Missing blob",
+                          entry.GetDefaultFilename())
 
 def GetEntryModules(include_testing=True):
     """Get a set of entry class implementations
Signature · 1 line
2.39.2
Reviewed-by on v1 8/9
#19 lore raw

Re: [PATCH 8/9] binman: Show filename in missing blob help message

Quoted 10 lines · Jonas Karlman

Show the filename next to the node path in missing blob help messages, also show a generic missing blob message when there was no help message for the help tag.

---
 tools/binman/control.py | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)

Test?

#20 lore raw

PATCH 9/9 Makefile: Show binman missing blob message

In reply to Jonas Karlman

When binman is invoked during a build of U-Boot and an external blob is missing, the user is usually presented with a generic file not found in input path message.

Invoke binman with --allow-missing so that binman can show relevant missing blob help messages. Build continue to fail with missing blobs unless BINMAN_ALLOW_MISSING=1 is used.

This changes the following error message:

binman: Filename 'atf-bl31' not found in input path (...)

to the following:

Image 'itb' is missing external blobs and is non-functional: atf-blob

/binman/itb/fit/images/atf/atf-blob (bl31.bin):
See the documentation for your board. You may need to build ARM Trusted Firmware and build with BL31=/path/to/bl31.bin

---
 Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Makefile +1 -1
index 58f8c7a35335..c2860824f6f2 100644
@@ -1326,7 +1326,7 @@ cmd_binman = $(srctree)/tools/binman/binman $(if $(BINMAN_DEBUG),-D) \
                 --toolpath $(objtree)/tools \
 		$(if $(BINMAN_VERBOSE),-v$(BINMAN_VERBOSE)) \
 		build -u -d u-boot.dtb -O . -m \
-		$(if $(BINMAN_ALLOW_MISSING),--allow-missing --ignore-missing) \
+		--allow-missing $(if $(BINMAN_ALLOW_MISSING),--ignore-missing) \
 		-I . -I $(srctree) -I $(srctree)/board/$(BOARDDIR) \
 		-I arch/$(ARCH)/dts -a of-list=$(CONFIG_OF_LIST) \
 		$(foreach f,$(BINMAN_INDIRS),-I $(f)) \
Signature · 1 line
2.39.2
Reviewed-by on v1 9/9
#21 lore raw

Re: [PATCH 9/9] Makefile: Show binman missing blob message

Hi Jonas

+Tom Rini

Quoted 40 lines · Jonas Karlman

When binman is invoked during a build of U-Boot and an external blob is missing, the user is usually presented with a generic file not found in input path message.

Invoke binman with --allow-missing so that binman can show relevant missing blob help messages. Build continue to fail with missing blobs unless BINMAN_ALLOW_MISSING=1 is used.

This changes the following error message:

binman: Filename 'atf-bl31' not found in input path (...)

to the following:

Image 'itb' is missing external blobs and is non-functional: atf-blob

/binman/itb/fit/images/atf/atf-blob (bl31.bin):
See the documentation for your board. You may need to build ARM Trusted Firmware and build with BL31=/path/to/bl31.bin

---
 Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Makefile +1 -2
index 58f8c7a35335..c2860824f6f2 100644
@@ -1326,7 +1326,7 @@ cmd_binman = $(srctree)/tools/binman/binman $(if $(BINMAN_DEBUG),-D) \
                 --toolpath $(objtree)/tools \
                $(if $(BINMAN_VERBOSE),-v$(BINMAN_VERBOSE)) \
                build -u -d u-boot.dtb -O . -m \
-               $(if $(BINMAN_ALLOW_MISSING),--allow-missing --ignore-missing) \
+               --allow-missing $(if $(BINMAN_ALLOW_MISSING),--ignore-missing) \
                -I . -I $(srctree) -I $(srctree)/board/$(BOARDDIR) \
                -I arch/$(ARCH)/dts -a of-list=$(CONFIG_OF_LIST) \
                $(foreach f,$(BINMAN_INDIRS),-I $(f)) \
--
Quoted 2 lines

2.39.2

I agree this is better, but we should see what Tom thinks.

Regards,
Simon

#22 lore raw

Re: [PATCH 9/9] Makefile: Show binman missing blob message

Quoted 50 lines · Simon Glass

Hi Jonas

+Tom Rini

Quoted 40 lines · Jonas Karlman

When binman is invoked during a build of U-Boot and an external blob is missing, the user is usually presented with a generic file not found in input path message.

Invoke binman with --allow-missing so that binman can show relevant missing blob help messages. Build continue to fail with missing blobs unless BINMAN_ALLOW_MISSING=1 is used.

This changes the following error message:

binman: Filename 'atf-bl31' not found in input path (...)

to the following:

Image 'itb' is missing external blobs and is non-functional: atf-blob

/binman/itb/fit/images/atf/atf-blob (bl31.bin):
See the documentation for your board. You may need to build ARM Trusted Firmware and build with BL31=/path/to/bl31.bin

---
 Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Makefile +1 -2
index 58f8c7a35335..c2860824f6f2 100644
@@ -1326,7 +1326,7 @@ cmd_binman = $(srctree)/tools/binman/binman $(if $(BINMAN_DEBUG),-D) \
                 --toolpath $(objtree)/tools \
                $(if $(BINMAN_VERBOSE),-v$(BINMAN_VERBOSE)) \
                build -u -d u-boot.dtb -O . -m \
-               $(if $(BINMAN_ALLOW_MISSING),--allow-missing --ignore-missing) \
+               --allow-missing $(if $(BINMAN_ALLOW_MISSING),--ignore-missing) \
                -I . -I $(srctree) -I $(srctree)/board/$(BOARDDIR) \
                -I arch/$(ARCH)/dts -a of-list=$(CONFIG_OF_LIST) \
                $(foreach f,$(BINMAN_INDIRS),-I $(f)) \
--
Quoted 2 lines

2.39.2

I agree this is better, but we should see what Tom thinks.

Quoted 1 line

This sounds like a binman bug. We shouldn't need to say --allow-missing to then make use of the missing-msg node.

Signature · 1 line
Tom
#23 lore raw

Re: [PATCH 9/9] Makefile: Show binman missing blob message

Hi Tom,

Quoted 52 lines · Tom Rini
Quoted 50 lines · Simon Glass

Hi Jonas

+Tom Rini

Quoted 40 lines · Jonas Karlman

When binman is invoked during a build of U-Boot and an external blob is missing, the user is usually presented with a generic file not found in input path message.

Invoke binman with --allow-missing so that binman can show relevant missing blob help messages. Build continue to fail with missing blobs unless BINMAN_ALLOW_MISSING=1 is used.

This changes the following error message:

binman: Filename 'atf-bl31' not found in input path (...)

to the following:

Image 'itb' is missing external blobs and is non-functional: atf-blob

/binman/itb/fit/images/atf/atf-blob (bl31.bin):
See the documentation for your board. You may need to build ARM Trusted Firmware and build with BL31=/path/to/bl31.bin

---
 Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Makefile +1 -2
index 58f8c7a35335..c2860824f6f2 100644
@@ -1326,7 +1326,7 @@ cmd_binman = $(srctree)/tools/binman/binman $(if $(BINMAN_DEBUG),-D) \
                 --toolpath $(objtree)/tools \
                $(if $(BINMAN_VERBOSE),-v$(BINMAN_VERBOSE)) \
                build -u -d u-boot.dtb -O . -m \
-               $(if $(BINMAN_ALLOW_MISSING),--allow-missing --ignore-missing) \
+               --allow-missing $(if $(BINMAN_ALLOW_MISSING),--ignore-missing) \
                -I . -I $(srctree) -I $(srctree)/board/$(BOARDDIR) \
                -I arch/$(ARCH)/dts -a of-list=$(CONFIG_OF_LIST) \
                $(foreach f,$(BINMAN_INDIRS),-I $(f)) \
--
Quoted 2 lines

2.39.2

I agree this is better, but we should see what Tom thinks.

Quoted 4 lines
Quoted 1 line

This sounds like a binman bug. We shouldn't need to say --allow-missing to then make use of the missing-msg node.

Without --allow-missing binman just dies when it cannot find something. This is useful because it allows debugging of problems.

I'm not sure how easy it would be to change this. The error is reported by the tools module which has no knowledge of binman. We could catch the exception, but again that makes things non-debuggable.

At the moment we have two cases:
- normal: missing files cause an immediate abort
- --allow-missing: missing files are collected with a report at the end

Worse, we can have missing tools, not just missing blobs. The complexity of this gets completely out of hand if we try to meld the normal and --allow-missing cases together.

I actually don't see much of a downside to passing allow-missing always. But perhaps the BINMAN_ALLOW_MISSING should be renamed to BINMAN_IGNORE_MISSING (with a similar change in buildman). We could actually keep BINMAN_ALLOW_MISSING to mean to pass --allow-missing, pointing out in the docs that this is a bad idea as you won't see any blob help?

Regards,
Simon

#24 lore raw

Re: [PATCH 9/9] Makefile: Show binman missing blob message

Quoted 60 lines · Simon Glass

Hi Tom,

Quoted 52 lines · Tom Rini
Quoted 50 lines · Simon Glass

Hi Jonas

+Tom Rini

Quoted 40 lines · Jonas Karlman

When binman is invoked during a build of U-Boot and an external blob is missing, the user is usually presented with a generic file not found in input path message.

Invoke binman with --allow-missing so that binman can show relevant missing blob help messages. Build continue to fail with missing blobs unless BINMAN_ALLOW_MISSING=1 is used.

This changes the following error message:

binman: Filename 'atf-bl31' not found in input path (...)

to the following:

Image 'itb' is missing external blobs and is non-functional: atf-blob

/binman/itb/fit/images/atf/atf-blob (bl31.bin):
See the documentation for your board. You may need to build ARM Trusted Firmware and build with BL31=/path/to/bl31.bin

---
 Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Makefile +1 -2
index 58f8c7a35335..c2860824f6f2 100644
@@ -1326,7 +1326,7 @@ cmd_binman = $(srctree)/tools/binman/binman $(if $(BINMAN_DEBUG),-D) \
                 --toolpath $(objtree)/tools \
                $(if $(BINMAN_VERBOSE),-v$(BINMAN_VERBOSE)) \
                build -u -d u-boot.dtb -O . -m \
-               $(if $(BINMAN_ALLOW_MISSING),--allow-missing --ignore-missing) \
+               --allow-missing $(if $(BINMAN_ALLOW_MISSING),--ignore-missing) \
                -I . -I $(srctree) -I $(srctree)/board/$(BOARDDIR) \
                -I arch/$(ARCH)/dts -a of-list=$(CONFIG_OF_LIST) \
                $(foreach f,$(BINMAN_INDIRS),-I $(f)) \
--
Quoted 2 lines

2.39.2

I agree this is better, but we should see what Tom thinks.

Quoted 4 lines
Quoted 1 line

This sounds like a binman bug. We shouldn't need to say --allow-missing to then make use of the missing-msg node.

Quoted 6 lines

Without --allow-missing binman just dies when it cannot find something. This is useful because it allows debugging of problems.

I'm not sure how easy it would be to change this. The error is reported by the tools module which has no knowledge of binman. We could catch the exception, but again that makes things non-debuggable.

Why wouldn't it be debuggable? Wouldn't it be more debuggable now that we're saying "You're missing foo.blob, this is typically provided by the foo project", which we can just say because the message has been filled out already in the etype.

Quoted 8 lines

At the moment we have two cases:
- normal: missing files cause an immediate abort
- --allow-missing: missing files are collected with a report at the end

Worse, we can have missing tools, not just missing blobs. The complexity of this gets completely out of hand if we try to meld the normal and --allow-missing cases together.

Quoted 6 lines

I actually don't see much of a downside to passing allow-missing always. But perhaps the BINMAN_ALLOW_MISSING should be renamed to BINMAN_IGNORE_MISSING (with a similar change in buildman). We could actually keep BINMAN_ALLOW_MISSING to mean to pass --allow-missing, pointing out in the docs that this is a bad idea as you won't see any blob help?

Maybe the problem is the flag is badly named? I still think this speaks to bugs in the tooling if we can't make use of the helpful error message that we have available without some special flags to be set.

Signature · 1 line
Tom
#25 lore raw

Re: [PATCH 9/9] Makefile: Show binman missing blob message

Hi Tom,

Quoted 65 lines · Tom Rini
Quoted 63 lines · Simon Glass

Hi Tom,

Quoted 52 lines · Tom Rini
Quoted 50 lines · Simon Glass

Hi Jonas

+Tom Rini

Quoted 40 lines · Jonas Karlman

When binman is invoked during a build of U-Boot and an external blob is missing, the user is usually presented with a generic file not found in input path message.

Invoke binman with --allow-missing so that binman can show relevant missing blob help messages. Build continue to fail with missing blobs unless BINMAN_ALLOW_MISSING=1 is used.

This changes the following error message:

binman: Filename 'atf-bl31' not found in input path (...)

to the following:

Image 'itb' is missing external blobs and is non-functional: atf-blob

/binman/itb/fit/images/atf/atf-blob (bl31.bin):
See the documentation for your board. You may need to build ARM Trusted Firmware and build with BL31=/path/to/bl31.bin

---
 Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Makefile +1 -2
index 58f8c7a35335..c2860824f6f2 100644
@@ -1326,7 +1326,7 @@ cmd_binman = $(srctree)/tools/binman/binman $(if $(BINMAN_DEBUG),-D) \
                 --toolpath $(objtree)/tools \
                $(if $(BINMAN_VERBOSE),-v$(BINMAN_VERBOSE)) \
                build -u -d u-boot.dtb -O . -m \
-               $(if $(BINMAN_ALLOW_MISSING),--allow-missing --ignore-missing) \
+               --allow-missing $(if $(BINMAN_ALLOW_MISSING),--ignore-missing) \
                -I . -I $(srctree) -I $(srctree)/board/$(BOARDDIR) \
                -I arch/$(ARCH)/dts -a of-list=$(CONFIG_OF_LIST) \
                $(foreach f,$(BINMAN_INDIRS),-I $(f)) \
--
Quoted 2 lines

2.39.2

I agree this is better, but we should see what Tom thinks.

Quoted 4 lines
Quoted 1 line

This sounds like a binman bug. We shouldn't need to say --allow-missing to then make use of the missing-msg node.

Without --allow-missing binman just dies when it cannot find something. This is useful because it allows debugging of problems.

Quoted 8 lines
Quoted 3 lines

I'm not sure how easy it would be to change this. The error is reported by the tools module which has no knowledge of binman. We could catch the exception, but again that makes things non-debuggable.

Why wouldn't it be debuggable? Wouldn't it be more debuggable now that we're saying "You're missing foo.blob, this is typically provided by the foo project", which we can just say because the message has been filled out already in the etype.

Perhaps just take my word for it? The feature you are asking for here is exactly what the -M flag does, but you are trying to make it so that a 'file not found' error is not reported immediately, but appears later. That makes it hard to debug, since the 'exception' is supressed and only later do you see there is a problem...so hard to debug.

Quoted 16 lines
Quoted 9 lines

At the moment we have two cases:
- normal: missing files cause an immediate abort
- --allow-missing: missing files are collected with a report at the end

Worse, we can have missing tools, not just missing blobs. The complexity of this gets completely out of hand if we try to meld the normal and --allow-missing cases together.

Quoted 6 lines

I actually don't see much of a downside to passing allow-missing always. But perhaps the BINMAN_ALLOW_MISSING should be renamed to BINMAN_IGNORE_MISSING (with a similar change in buildman). We could actually keep BINMAN_ALLOW_MISSING to mean to pass --allow-missing, pointing out in the docs that this is a bad idea as you won't see any blob help?

Quoted 3 lines

Maybe the problem is the flag is badly named? I still think this speaks to bugs in the tooling if we can't make use of the helpful error message that we have available without some special flags to be set.

Without -M binman is just opening the files you tell it, failing if it cannot, exactly as things used to be before binman.

Yes --allow-missing might not be the best name, since we don't really allow it, just collect the information and report it. Binman still fails the build in that case. Perhaps we need:

(nothing) - die as soon as any missing tool or file is
--collect-missing - collect all the missing blobs and tools, rather
than dying right away, returning 103 if there are any problems
--allow-missing - report success (with warnings output) even if
there are missing blobs / tools

Regards,
Simon

Applied
#26 lore raw
In reply to Jonas Karlman

Hi Jonas,

Quoted 73 lines · Jonas Karlman

binman currently support showing a helpful missing blob message, but only when the --allow-missing flag is used.

This changes so that binman is invoked with the --allow-missing flag and the helpful message can be shown by default when building U-Boot.

Using the following:

make rockpro64-rk3399_defconfig
make CROSS_COMPILE="aarch64-linux-gnu-"

Before this series a build fails with:

binman: Filename 'atf-bl31' not found in input path (...)

After this series a build fails with:

Image 'simple-bin' is missing external blobs and is non-functional: atf-bl31

/binman/simple-bin/fit/images/@atf-SEQ/atf-bl31 (atf-bl31):
See the documentation for your board. You may need to build ARM Trusted Firmware and build with BL31=/path/to/bl31.bin

Image 'simple-bin' is missing 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) with TEE=/path/to/tee.bin

Some images are invalid

Builds will continue to fail when there is missing blobs, and the use of BINMAN_ALLOW_MISSING=1 now only enables the --ignore-missing flag.

This series also fixes a few minor issues that prevented some missing and optional blobs to be detected for fit and mkimage entries.

Patch 1-3 contains spelling fixes and code cleanup for related parts. Patch 4-6 improve missing/optional detection for fit and mkimage entries. Patch 7-8 improve the missing blob warning message output. Patch 9 finally update Makefile to always pass the --allow-missing flag.

The series is based on top of [1], and is the follow-up series meant to address the issue with missing blob message for mkimage entries.

[1] https://patchwork.ozlabs.org/project/uboot/cover/[email protected]/

Jonas Karlman (9):
binman: Remove redundant SetAllowFakeBlob from blob-ext entry
binman: Fix spelling of nodes in code comments
binman: Use correct argument name in docstrings
binman: Override CheckOptional in fit entry
binman: Implement missing check functions in mkimage entry
binman: Mark mkimage entry missing when its subnodes is missing
binman: Fix blank line usage for invalid images warning text
binman: Show filename in missing blob help message
Makefile: Show binman missing blob message

 Makefile                                      |  2 +-
 tools/binman/control.py                       | 24 ++++++---
 tools/binman/entry.py                         |  2 +-
 tools/binman/etype/blob.py                    |  2 +-
 tools/binman/etype/blob_ext.py                |  8 ---
 tools/binman/etype/fit.py                     |  9 +++-
 tools/binman/etype/mkimage.py                 | 54 ++++++++++++++++++-
 tools/binman/etype/section.py                 |  6 +--
 tools/binman/ftest.py                         |  9 ++++
 tools/binman/state.py                         |  2 +-
 .../test/278_mkimage_missing_multiple.dts     | 19 +++++++
 11 files changed, 111 insertions(+), 26 deletions(-)
 create mode 100644 tools/binman/test/278_mkimage_missing_multiple.dts
Quoted 3 lines

--
2.39.2

I applied what I could of this to -next

Could you please take another look and see if we can get the rest in?

Regards,
Simon

#27 lore raw

Hi Simon,

Quoted 76 lines · Simon Glass

Hi Jonas,

Quoted 73 lines · Jonas Karlman

binman currently support showing a helpful missing blob message, but only when the --allow-missing flag is used.

This changes so that binman is invoked with the --allow-missing flag and the helpful message can be shown by default when building U-Boot.

Using the following:

make rockpro64-rk3399_defconfig
make CROSS_COMPILE="aarch64-linux-gnu-"

Before this series a build fails with:

binman: Filename 'atf-bl31' not found in input path (...)

After this series a build fails with:

Image 'simple-bin' is missing external blobs and is non-functional: atf-bl31

/binman/simple-bin/fit/images/@atf-SEQ/atf-bl31 (atf-bl31):
See the documentation for your board. You may need to build ARM Trusted Firmware and build with BL31=/path/to/bl31.bin

Image 'simple-bin' is missing 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) with TEE=/path/to/tee.bin

Some images are invalid

Builds will continue to fail when there is missing blobs, and the use of BINMAN_ALLOW_MISSING=1 now only enables the --ignore-missing flag.

This series also fixes a few minor issues that prevented some missing and optional blobs to be detected for fit and mkimage entries.

Patch 1-3 contains spelling fixes and code cleanup for related parts. Patch 4-6 improve missing/optional detection for fit and mkimage entries. Patch 7-8 improve the missing blob warning message output. Patch 9 finally update Makefile to always pass the --allow-missing flag.

The series is based on top of [1], and is the follow-up series meant to address the issue with missing blob message for mkimage entries.

[1] https://patchwork.ozlabs.org/project/uboot/cover/[email protected]/

Jonas Karlman (9):
binman: Remove redundant SetAllowFakeBlob from blob-ext entry
binman: Fix spelling of nodes in code comments
binman: Use correct argument name in docstrings
binman: Override CheckOptional in fit entry
binman: Implement missing check functions in mkimage entry
binman: Mark mkimage entry missing when its subnodes is missing
binman: Fix blank line usage for invalid images warning text
binman: Show filename in missing blob help message
Makefile: Show binman missing blob message

 Makefile                                      |  2 +-
 tools/binman/control.py                       | 24 ++++++---
 tools/binman/entry.py                         |  2 +-
 tools/binman/etype/blob.py                    |  2 +-
 tools/binman/etype/blob_ext.py                |  8 ---
 tools/binman/etype/fit.py                     |  9 +++-
 tools/binman/etype/mkimage.py                 | 54 ++++++++++++++++++-
 tools/binman/etype/section.py                 |  6 +--
 tools/binman/ftest.py                         |  9 ++++
 tools/binman/state.py                         |  2 +-
 .../test/278_mkimage_missing_multiple.dts     | 19 +++++++
 11 files changed, 111 insertions(+), 26 deletions(-)
 create mode 100644 tools/binman/test/278_mkimage_missing_multiple.dts
Quoted 7 lines
Quoted 3 lines

--
2.39.2

I applied what I could of this to -next

Could you please take another look and see if we can get the rest in?

Sure, I will take a look at a v2 (with more tests) in next few days.

Still unclear what to do about "Makefile: Show binman missing blob message" at [2]. Should I re-send it as-is, change it or just drop it?

[2] https://patchwork.ozlabs.org/project/uboot/patch/[email protected]/#3063614

Regards,
Jonas

Quoted 3 lines

Regards,
Simon

#28 lore raw

Hi Jonas,

Quoted 85 lines · Jonas Karlman

Hi Simon,

Quoted 82 lines · Simon Glass

Hi Jonas,

Quoted 73 lines · Jonas Karlman

binman currently support showing a helpful missing blob message, but only when the --allow-missing flag is used.

This changes so that binman is invoked with the --allow-missing flag and the helpful message can be shown by default when building U-Boot.

Using the following:

make rockpro64-rk3399_defconfig
make CROSS_COMPILE="aarch64-linux-gnu-"

Before this series a build fails with:

binman: Filename 'atf-bl31' not found in input path (...)

After this series a build fails with:

Image 'simple-bin' is missing external blobs and is non-functional: atf-bl31

/binman/simple-bin/fit/images/@atf-SEQ/atf-bl31 (atf-bl31):
See the documentation for your board. You may need to build ARM Trusted Firmware and build with BL31=/path/to/bl31.bin

Image 'simple-bin' is missing 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) with TEE=/path/to/tee.bin

Some images are invalid

Builds will continue to fail when there is missing blobs, and the use of BINMAN_ALLOW_MISSING=1 now only enables the --ignore-missing flag.

This series also fixes a few minor issues that prevented some missing and optional blobs to be detected for fit and mkimage entries.

Patch 1-3 contains spelling fixes and code cleanup for related parts. Patch 4-6 improve missing/optional detection for fit and mkimage entries. Patch 7-8 improve the missing blob warning message output. Patch 9 finally update Makefile to always pass the --allow-missing flag.

The series is based on top of [1], and is the follow-up series meant to address the issue with missing blob message for mkimage entries.

[1] https://patchwork.ozlabs.org/project/uboot/cover/[email protected]/

Jonas Karlman (9):
binman: Remove redundant SetAllowFakeBlob from blob-ext entry
binman: Fix spelling of nodes in code comments
binman: Use correct argument name in docstrings
binman: Override CheckOptional in fit entry
binman: Implement missing check functions in mkimage entry
binman: Mark mkimage entry missing when its subnodes is missing
binman: Fix blank line usage for invalid images warning text
binman: Show filename in missing blob help message
Makefile: Show binman missing blob message

 Makefile                                      |  2 +-
 tools/binman/control.py                       | 24 ++++++---
 tools/binman/entry.py                         |  2 +-
 tools/binman/etype/blob.py                    |  2 +-
 tools/binman/etype/blob_ext.py                |  8 ---
 tools/binman/etype/fit.py                     |  9 +++-
 tools/binman/etype/mkimage.py                 | 54 ++++++++++++++++++-
 tools/binman/etype/section.py                 |  6 +--
 tools/binman/ftest.py                         |  9 ++++
 tools/binman/state.py                         |  2 +-
 .../test/278_mkimage_missing_multiple.dts     | 19 +++++++
 11 files changed, 111 insertions(+), 26 deletions(-)
 create mode 100644 tools/binman/test/278_mkimage_missing_multiple.dts
Quoted 3 lines

--
2.39.2

I applied what I could of this to -next

Quoted 8 lines
Quoted 1 line

Could you please take another look and see if we can get the rest in?

Sure, I will take a look at a v2 (with more tests) in next few days.

Still unclear what to do about "Makefile: Show binman missing blob message" at [2]. Should I re-send it as-is, change it or just drop it?

[2] https://patchwork.ozlabs.org/project/uboot/patch/[email protected]/#3063614

I'd say resend since it seems right to me. I'll probably need to talk to Tom about it.

Regards,
SImon