From: Robert Sturla Date: Thu, 25 Dec 2025 18:00:22 +0000 (+0000) Subject: build_microcode_initrd: Normalize timestamps for reproducible builds X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ec168925ad83e2a0347cecce2566eb8abe5b5504;p=thirdparty%2Fmkosi.git build_microcode_initrd: Normalize timestamps for reproducible builds When building the microcode initrd, files are created in a temporary directory with current timestamps. These timestamps are then embedded in the CPIO archive, causing non-reproducible builds even when SourceDateEpoch is set. Fix this by normalizing the modification times of all files in the microcode root directory to source_date_epoch before creating the CPIO archive. Signed-off-by: Robert Sturla --- diff --git a/mkosi/__init__.py b/mkosi/__init__.py index ac6705e7f..976fb399e 100644 --- a/mkosi/__init__.py +++ b/mkosi/__init__.py @@ -1500,6 +1500,9 @@ def build_microcode_initrd(context: Context) -> list[Path]: for p in intel.iterdir(): f.write(p.read_bytes()) + # Normalize timestamps for reproducible builds before creating cpio + normalize_mtime(root, context.config.source_date_epoch) + make_cpio(root, microcode, sandbox=context.sandbox) return [microcode]