]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
binman: Remove dependency on pylibfdt for entry-docs
authorSimon Glass <sjg@chromium.org>
Sat, 20 Jul 2024 10:49:43 +0000 (11:49 +0100)
committerSimon Glass <sjg@chromium.org>
Mon, 29 Jul 2024 14:42:18 +0000 (08:42 -0600)
Allow the entry-docs command to operate even if pylibfdt is not present
in the systemn.

Signed-off-by: Simon Glass <sjg@chromium.org>
tools/binman/image.py

index e77b5d0d97cd02b88d67f9335568e4879b493646..97443d3c0a7b04d48f0e66bbfd6f657ed6cf32be 100644 (file)
@@ -21,6 +21,9 @@ from dtoc import fdt_util
 from u_boot_pylib import tools
 from u_boot_pylib import tout
 
+# This is imported if needed
+state = None
+
 class Image(section.Entry_section):
     """A Image, representing an output from binman
 
@@ -75,6 +78,10 @@ class Image(section.Entry_section):
     def __init__(self, name, node, copy_to_orig=True, test=False,
                  ignore_missing=False, use_expanded=False, missing_etype=False,
                  generate=True):
+        # Put this here to allow entry-docs and help to work without libfdt
+        global state
+        from binman import state
+
         super().__init__(None, 'section', node, test=test)
         self.copy_to_orig = copy_to_orig
         self.name = name