summaryrefslogtreecommitdiff
path: root/tools/binman/entry.py
diff options
context:
space:
mode:
Diffstat (limited to 'tools/binman/entry.py')
-rw-r--r--tools/binman/entry.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/tools/binman/entry.py b/tools/binman/entry.py
index 9d499f07aa..21d3457788 100644
--- a/tools/binman/entry.py
+++ b/tools/binman/entry.py
@@ -990,13 +990,14 @@ features to produce new behaviours.
if self.missing:
missing_list.append(self)
- def check_fake_fname(self, fname):
+ def check_fake_fname(self, fname, size=0):
"""If the file is missing and the entry allows fake blobs, fake it
Sets self.faked to True if faked
Args:
fname (str): Filename to check
+ size (int): Size of fake file to create
Returns:
tuple:
@@ -1006,7 +1007,7 @@ features to produce new behaviours.
if self.allow_fake and not pathlib.Path(fname).is_file():
outfname = tools.get_output_filename(os.path.basename(fname))
with open(outfname, "wb") as out:
- out.truncate(1024)
+ out.truncate(size)
self.faked = True
tout.info(f"Entry '{self._node.path}': Faked file '{outfname}'")
return outfname, True