summaryrefslogtreecommitdiff
path: root/tools/binman/entry.py
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2020-10-27 02:40:15 +0300
committerSimon Glass <sjg@chromium.org>2020-10-29 23:42:59 +0300
commit97c3e9a6faa4483a700b26988bc48c2f9efe8dd6 (patch)
tree031a9234c43728c3628b56dd8d890fbca0ca1d5e /tools/binman/entry.py
parent7d398bb1c71580da2182f0b820d91950bf4b3d24 (diff)
downloadu-boot-97c3e9a6faa4483a700b26988bc48c2f9efe8dd6.tar.xz
binman: Store the original data before compression
When compressing an entry, the original uncompressed data is overwritten. Store it so it is available if needed. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'tools/binman/entry.py')
-rw-r--r--tools/binman/entry.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/tools/binman/entry.py b/tools/binman/entry.py
index 0421129c03..d701eaff8f 100644
--- a/tools/binman/entry.py
+++ b/tools/binman/entry.py
@@ -60,7 +60,10 @@ class Entry(object):
the containing section, 0 if none. The pad bytes become part of
the entry.
data: Contents of entry (string of bytes). This does not include
- padding created by pad_before or pad_after
+ padding created by pad_before or pad_after. If the entry is
+ compressed, this contains the compressed data.
+ uncomp_data: Original uncompressed data, if this entry is compressed,
+ else None
compress: Compression algoithm used (e.g. 'lz4'), 'none' if none
orig_offset: Original offset value read from node
orig_size: Original size value read from node
@@ -83,6 +86,7 @@ class Entry(object):
self.pre_reset_size = None
self.uncomp_size = None
self.data = None
+ self.uncomp_data = None
self.contents_size = 0
self.align = None
self.align_size = None
@@ -856,6 +860,7 @@ features to produce new behaviours.
Returns:
Compressed data (first word is the compressed size)
"""
+ self.uncomp_data = indata
if self.compress != 'none':
self.uncomp_size = len(indata)
data = tools.Compress(indata, self.compress)