data = comp_util.compress(indata, self.compress)
return data
+ def DecompressData(self, indata):
+ """Decompress data according to the entry's compression method
+
+ Args:
+ indata: Data to decompress
+
+ Returns:
+ Decompressed data
+ """
+ data = comp_util.decompress(indata, self.compress)
+ if self.compress != 'none':
+ self.uncomp_size = len(data)
+ self.uncomp_data = data
+ return data
+
@classmethod
def UseExpanded(cls, node, etype, new_etype):
"""Check whether to use an expanded entry type
import re
import sys
-from binman import comp_util
from binman.entry import Entry
from binman import state
from dtoc import fdt_util
data = parent_data[offset:offset + child.size]
if decomp:
indata = data
- data = comp_util.decompress(indata, child.compress)
+ data = child.DecompressData(indata)
if child.uncomp_size:
tout.info("%s: Decompressing data size %#x with algo '%s' to data size %#x" %
(child.GetPath(), len(indata), child.compress,