rootfs.mk: ensure all timestamp are set to SOURCE_DATE_EPOCH reproducible
authorAlexander Couzens <lynxis@fe80.eu>
Fri, 20 Sep 2019 03:36:13 +0000 (05:36 +0200)
committerAlexander Couzens <lynxis@fe80.eu>
Fri, 20 Sep 2019 14:56:16 +0000 (16:56 +0200)
Some tools doesn't support SOURCE_DATE_EPOCH (e.g. initramfs images).
Ensure all all files and links have the correct timestamp.
Fixes initramfs differ.

Signed-off-by: Alexander Couzens <lynxis@fe80.eu>
include/rootfs.mk

index f2d2494ae26445d1a8f79eefecd2887a868a88ab..b6775c7e15fb00e935737fd0b801ca7bef6e2a0d 100644 (file)
@@ -99,4 +99,5 @@ define prepare_rootfs
        rm -rf $(1)/boot
        $(call clean_ipkg,$(1))
        $(call mklibs,$(1))
+       $(if $(SOURCE_DATE_EPOCH),find $(1)/ -mindepth 1 -execdir touch -hcd "@$(SOURCE_DATE_EPOCH)" "{}" +)
 endef