binman: Add a --toolpath option to set the tool search path
authorSimon Glass <sjg@chromium.org>
Mon, 8 Jul 2019 19:18:28 +0000 (13:18 -0600)
committerSimon Glass <sjg@chromium.org>
Wed, 24 Jul 2019 03:27:57 +0000 (20:27 -0700)
Sometimes tools used by binman may not be in the normal PATH search path,
such as when the tool is built by the U-Boot build itself (e.g. mkimage).
Provide a way to specify an additional search path for tools. The flag
can be used multiple times.

Update the help to describe this option.

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

index decca47bbf301fd2fc117191f2a47a0e888597ca..28624fadb335ad28339a1992ba6ac8d44fb71bba 100644 (file)
@@ -691,6 +691,16 @@ Not all properties can be provided this way. Only some entries support it,
 typically for filenames.
 
 
+External tools
+--------------
+
+Binman can make use of external command-line tools to handle processing of
+entry contents or to generate entry contents. These tools are executed using
+the 'tools' module's Run() method. The tools generally must exist on the PATH,
+but the --toolpath option can be used to specify additional search paths to
+use. This option can be specified multiple times to add more than one path.
+
+
 Code coverage
 -------------
 
index 3886d52b3a02c4332293dcf3cd050b9a20889fd8..ee19c5e33fec8cb48f1855b9a346a473245c4fac 100644 (file)
@@ -52,6 +52,8 @@ def ParseArgs(argv):
                     default=False, help='run tests')
     parser.add_option('-T', '--test-coverage', action='store_true',
                     default=False, help='run tests and check for 100% coverage')
+    parser.add_option('--toolpath', type='string', action='append',
+            help='Add a path to the directories containing tools')
     parser.add_option('-u', '--update-fdt', action='store_true',
         default=False, help='Update the binman node with offset/size info')
     parser.add_option('-v', '--verbosity', default=1,
index 20186ee1980282cfbd6b78d12d6ee1bbf7468fa3..df78848e13d312c425b565bde23f8f4227f63540 100644 (file)
@@ -112,6 +112,7 @@ def Binman(options, args):
         try:
             tools.SetInputDirs(options.indir)
             tools.PrepareOutputDir(options.outdir, options.preserve)
+            tools.SetToolPaths(options.toolpath)
             state.SetEntryArgs(options.entry_arg)
 
             # Get the device tree ready by compiling it and copying the compiled