From 75ea4331d3638b17e5fe1b139a5cdcf7df13fc32 Mon Sep 17 00:00:00 2001 From: Andrew Gunnerson Date: Mon, 13 Feb 2023 22:19:32 -0500 Subject: [PATCH] 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 --- avbroot/formats/compression.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/avbroot/formats/compression.py b/avbroot/formats/compression.py index 98d679b..3f3edd7 100644 --- a/avbroot/formats/compression.py +++ b/avbroot/formats/compression.py @@ -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: