summaryrefslogtreecommitdiff
path: root/tools/binman/entry.py
diff options
context:
space:
mode:
authorStefan Herbrechtsmeier <stefan.herbrechtsmeier@weidmueller.com>2022-08-19 16:25:31 +0200
committerSimon Glass <sjg@chromium.org>2022-08-20 18:07:33 -0600
commitc3665a896e30578f8e5d6f1927da304efcd14735 (patch)
tree68241babdff0820326215410b6dd015da1872544 /tools/binman/entry.py
parentec7d27d3a83023af37e4fd42f67ec328d27b20c7 (diff)
binman: Support missing compression tools
Handle missing compression tools by returning empty data and record missing bintool. Signed-off-by: Stefan Herbrechtsmeier <stefan.herbrechtsmeier@weidmueller.com> Reviewed-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'tools/binman/entry.py')
-rw-r--r--tools/binman/entry.py14
1 files changed, 11 insertions, 3 deletions
diff --git a/tools/binman/entry.py b/tools/binman/entry.py
index af8e277995b..88f228682aa 100644
--- a/tools/binman/entry.py
+++ b/tools/binman/entry.py
@@ -1118,7 +1118,11 @@ features to produce new behaviours.
self.uncomp_data = indata
if self.compress != 'none':
self.uncomp_size = len(indata)
- data = self.comp_bintool.compress(indata)
+ if self.comp_bintool.is_present():
+ data = self.comp_bintool.compress(indata)
+ else:
+ self.record_missing_bintool(self.comp_bintool)
+ data = tools.get_bytes(0, 1024)
else:
data = indata
return data
@@ -1133,8 +1137,12 @@ features to produce new behaviours.
Decompressed data
"""
if self.compress != 'none':
- data = self.comp_bintool.decompress(indata)
- self.uncomp_size = len(data)
+ if self.comp_bintool.is_present():
+ data = self.comp_bintool.decompress(indata)
+ self.uncomp_size = len(data)
+ else:
+ self.record_missing_bintool(self.comp_bintool)
+ data = tools.get_bytes(0, 1024)
else:
data = indata
self.uncomp_data = data