aboutsummaryrefslogtreecommitdiff
path: root/tools/binman/etype/blob.py
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2020-09-01 05:13:57 -0600
committerSimon Glass <sjg@chromium.org>2020-09-22 12:50:43 -0600
commit8795898a53dae112857f06b49e58cfe94a731dfa (patch)
tree579b751122fd0b3e4648b1580acdb61f0a9f1fb7 /tools/binman/etype/blob.py
parent211cfa503f6cf850ccbd79b1082f9234b603e635 (diff)
binman: Move 'external' support into base class
At present we have an Entry_blob_ext which implement a blob which holds an external binary. We need to support other entry types that hold external binaries, e.g. Entry_blob_named_by_arg. Move the support into the base Entry class to allow this. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'tools/binman/etype/blob.py')
-rw-r--r--tools/binman/etype/blob.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/tools/binman/etype/blob.py b/tools/binman/etype/blob.py
index e507203709..c5f97c85a3 100644
--- a/tools/binman/etype/blob.py
+++ b/tools/binman/etype/blob.py
@@ -37,7 +37,13 @@ class Entry_blob(Entry):
def ObtainContents(self):
self._filename = self.GetDefaultFilename()
- self._pathname = tools.GetInputFilename(self._filename)
+ self._pathname = tools.GetInputFilename(self._filename,
+ self.section.GetAllowMissing())
+ # Allow the file to be missing
+ if self.external and not self._pathname:
+ self.SetContents(b'')
+ self.missing = True
+ return True
self.ReadBlobContents()
return True