aboutsummaryrefslogtreecommitdiff
path: root/tools/binman/etype/blob.py
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2022-03-05 20:19:05 -0700
committerSimon Glass <sjg@chromium.org>2022-03-18 19:24:25 -0600
commit72e423c6b6664ff77b46c732f8d7e2e173b3b5fe (patch)
treed07400ebe3dee62f4ea7107f8178a6069d0a951d /tools/binman/etype/blob.py
parent3817ad4c1c2d62be15f657e6647afcc93faf1d55 (diff)
binman: Allow mkimage to use a non-zero fake-blob size
Unfortunately mkimage gets upset with zero-sized files. Update the ObtainContents() method to support specifying the size, if a fake blob is created. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Alper Nebi Yasak <alpernebiyasak@gmail.com>
Diffstat (limited to 'tools/binman/etype/blob.py')
-rw-r--r--tools/binman/etype/blob.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/tools/binman/etype/blob.py b/tools/binman/etype/blob.py
index 89f089e740..ceaefb07b7 100644
--- a/tools/binman/etype/blob.py
+++ b/tools/binman/etype/blob.py
@@ -35,13 +35,14 @@ class Entry_blob(Entry):
super().__init__(section, etype, node)
self._filename = fdt_util.GetString(self._node, 'filename', self.etype)
- def ObtainContents(self):
+ def ObtainContents(self, fake_size=0):
self._filename = self.GetDefaultFilename()
self._pathname = tools.get_input_filename(self._filename,
self.external and self.section.GetAllowMissing())
# Allow the file to be missing
if not self._pathname:
- self._pathname, faked = self.check_fake_fname(self._filename)
+ self._pathname, faked = self.check_fake_fname(self._filename,
+ fake_size)
self.missing = True
if not faked:
self.SetContents(b'')