mirror of
https://xff.cz/git/u-boot/
synced 2025-11-01 19:05:51 +01:00
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>
This commit is contained in:
@@ -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()))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user