diff mbox series

[U-Boot,11/29] binman: Allow help to work without libfdt

Message ID 20180717192552.198496-12-sjg@chromium.org
State Accepted
Commit 9b1a804d52832aa2ae62bef0254451606d5a1901
Delegated to: Simon Glass
Headers show
Series binman: Expand feature set and documentation | expand

Commit Message

Simon Glass July 17, 2018, 7:25 p.m. UTC
At present binman needs libfdt.py to be available before it will do
anything, even print help. Import those modules later to avoid this, as it
is bad practice to fail to even show help on startup.

Signed-off-by: Simon Glass <sjg@chromium.org>
---

 tools/binman/control.py | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/tools/binman/control.py b/tools/binman/control.py
index 4fa505da81..3e5eac2c52 100644
--- a/tools/binman/control.py
+++ b/tools/binman/control.py
@@ -13,8 +13,6 @@  import tools
 
 import command
 import elf
-import fdt
-import fdt_util
 from image import Image
 import tout
 
@@ -129,6 +127,11 @@  def Binman(options, args):
         options.indir.append(board_pathname)
 
     try:
+        # Import these here in case libfdt.py is not available, in which case
+        # the above help option still works.
+        import fdt
+        import fdt_util
+
         tout.Init(options.verbosity)
         elf.debug = options.debug
         try: