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 <rsturla@redhat.com>
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]