summaryrefslogtreecommitdiff
path: root/tools/patman
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2020-07-09 18:39:38 -0600
committerSimon Glass <sjg@chromium.org>2020-07-25 14:46:57 -0600
commit4f9f1056ecf2d9e54803b89fd0784240a8d89fd8 (patch)
tree11f385fc3a6d6d0938a3f690693500ec21afc020 /tools/patman
parent04e6a6b9ecdc75023edeebe73286f311c40b346b (diff)
downloadu-boot-4f9f1056ecf2d9e54803b89fd0784240a8d89fd8.tar.gz
binman: Allow external binaries to be missing
Sometimes it is useful to build an image even though external binaries are not present. This allows the build system to continue to function without these files, albeit not producing valid images. U-Boot does with with ATF (ARM Trusted Firmware) today. Add a new flag to binman to request this behaviour. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Diffstat (limited to 'tools/patman')
-rw-r--r--tools/patman/tools.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/tools/patman/tools.py b/tools/patman/tools.py
index f402b9aab8..d41115a22c 100644
--- a/tools/patman/tools.py
+++ b/tools/patman/tools.py
@@ -114,14 +114,16 @@ def SetInputDirs(dirname):
indir = dirname
tout.Debug("Using input directories %s" % indir)
-def GetInputFilename(fname):
+def GetInputFilename(fname, allow_missing=False):
"""Return a filename for use as input.
Args:
fname: Filename to use for new file
+ allow_missing: True if the filename can be missing
Returns:
- The full path of the filename, within the input directory
+ The full path of the filename, within the input directory, or
+ None on error
"""
if not indir or fname[:1] == '/':
return fname
@@ -130,6 +132,8 @@ def GetInputFilename(fname):
if os.path.exists(pathname):
return pathname
+ if allow_missing:
+ return None
raise ValueError("Filename '%s' not found in input path (%s) (cwd='%s')" %
(fname, ','.join(indir), os.getcwd()))