summaryrefslogtreecommitdiff
path: root/tools/binman/entry.py
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2022-03-05 20:19:03 -0700
committerSimon Glass <sjg@chromium.org>2022-03-18 19:24:25 -0600
commit9a0a2e9569f0d4e89cbaace40227e18c9c37fbf4 (patch)
tree0b71229ab382eae9428093699e27085f78aeb6ed /tools/binman/entry.py
parentae9a45702954707619df6990bb479c98f5346408 (diff)
binman: Change how faked blobs are created
At present fake blobs are created but internally an empty blob is used. Change it to use the contents of the faked file. Also return whether the blob was faked, in case the caller needs to know that. Add a TODO to put fake blobs in their own directory. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Alper Nebi Yasak <alpernebiyasak@gmail.com>
Diffstat (limited to 'tools/binman/entry.py')
-rw-r--r--tools/binman/entry.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/tools/binman/entry.py b/tools/binman/entry.py
index 786c959911f..9d499f07aab 100644
--- a/tools/binman/entry.py
+++ b/tools/binman/entry.py
@@ -999,15 +999,18 @@ features to produce new behaviours.
fname (str): Filename to check
Returns:
- fname (str): Filename of faked file
+ tuple:
+ fname (str): Filename of faked file
+ bool: True if the blob was faked, False if not
"""
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)
self.faked = True
- return outfname
- return fname
+ tout.info(f"Entry '{self._node.path}': Faked file '{outfname}'")
+ return outfname, True
+ return fname, False
def CheckFakedBlobs(self, faked_blobs_list):
"""Check if any entries in this section have faked external blobs