From 72e423c6b6664ff77b46c732f8d7e2e173b3b5fe Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Sat, 5 Mar 2022 20:19:05 -0700 Subject: 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 Reviewed-by: Alper Nebi Yasak --- tools/binman/etype/blob.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'tools/binman/etype/blob.py') 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'') -- cgit v1.2.3