avbroot/formats/compression.py: Hardcode timestamp in gzip header

For v2 boot images that use gzip headers, the current system time was
begin added to the gzip header while recompressing the ramdisk, which
broke reproducibility. This commit hardcodes the timestamp to 0 (unix
epoch time).

Signed-off-by: Andrew Gunnerson <accounts+github@chiller3.com>
This commit is contained in:
Andrew Gunnerson
2023-02-13 22:19:32 -05:00
parent 558fef4232
commit 75ea4331d3
+1 -1
View File
@@ -167,7 +167,7 @@ class CompressedFile:
break
if format == Format.GZIP:
format_fp = gzip.open(fp, mode)
format_fp = gzip.GzipFile(fileobj=fp, mode=mode, mtime=0)
elif format == Format.LZ4_LEGACY:
format_fp = Lz4Legacy(fp, mode)
else: