aboutsummaryrefslogtreecommitdiff
path: root/tools/patman/tools.py
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2020-07-09 18:39:38 -0600
committerSimon Glass <sjg@chromium.org>2020-07-20 11:37:47 -0600
commit5f850fb9a62659edaa81167a4acc879c0ea104fc (patch)
tree0bb5362a5c9286d4eba4832c185ffb692f98105b /tools/patman/tools.py
parent894f63575574e153ac813b7a1d20bf5d251af2ac (diff)
downloadu-boot-5f850fb9a62659edaa81167a4acc879c0ea104fc.zip
u-boot-5f850fb9a62659edaa81167a4acc879c0ea104fc.tar.gz
u-boot-5f850fb9a62659edaa81167a4acc879c0ea104fc.tar.bz2
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/tools.py')
-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 f402b9a..d41115a 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()))