From 59f9c4ca9feb2c070df508c7196f06a6e87307b4 Mon Sep 17 00:00:00 2001 From: Jérôme Pouiller Date: Wed, 23 Nov 2016 13:58:43 +0100 Subject: fs/tar: make results reproducible MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In order to make tar images reproducible, force files order in tarball. This work was sponsored by `BA Robotic Systems'. Signed-off-by: Jérôme Pouiller Signed-off-by: Thomas Petazzoni --- fs/tar/tar.mk | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'fs') diff --git a/fs/tar/tar.mk b/fs/tar/tar.mk index 11c69c5a8..b14c977d7 100644 --- a/fs/tar/tar.mk +++ b/fs/tar/tar.mk @@ -7,7 +7,8 @@ TAR_OPTS := $(call qstrip,$(BR2_TARGET_ROOTFS_TAR_OPTIONS)) define ROOTFS_TAR_CMD - tar $(TAR_OPTS) -cf $@ --numeric-owner -C $(TARGET_DIR) . + (cd $(TARGET_DIR); find -print0 | LC_ALL=C sort -z | \ + tar $(TAR_OPTS) -cf $@ --null -T - --no-recursion --numeric-owner) endef $(eval $(call ROOTFS_TARGET,tar)) -- cgit v1.2.3 From 68db7210fd8e76120c27cdc4a1fe591de67c06c2 Mon Sep 17 00:00:00 2001 From: Jérôme Pouiller Date: Wed, 23 Nov 2016 13:58:47 +0100 Subject: fs/common: lock modification times in $TARGET_DIR MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Make sure all files in $TARGET_DIR have a defined modification time before to generate filesystems. This work was sponsored by `BA Robotic Systems'. Signed-off-by: Jérôme Pouiller Reviewed-by: Thomas Petazzoni Reviewed-by: Arnout Vandecappelle (Essensium/Mind) Signed-off-by: Thomas Petazzoni --- fs/common.mk | 3 +++ 1 file changed, 3 insertions(+) (limited to 'fs') diff --git a/fs/common.mk b/fs/common.mk index 2dbef4d7b..981dcb1aa 100644 --- a/fs/common.mk +++ b/fs/common.mk @@ -95,6 +95,9 @@ endif $$(foreach s,$$(call qstrip,$$(BR2_ROOTFS_POST_FAKEROOT_SCRIPT)),\ echo "echo '$$(TERM_BOLD)>>> Executing fakeroot script $$(s)$$(TERM_RESET)'" >> $$(FAKEROOT_SCRIPT); \ echo $$(s) $$(TARGET_DIR) $$(BR2_ROOTFS_POST_SCRIPT_ARGS) >> $$(FAKEROOT_SCRIPT)$$(sep)) +ifeq ($$(BR2_REPRODUCIBLE),y) + echo "find $$(TARGET_DIR) -print0 | xargs -0 -r touch -hd @$$(SOURCE_DATE_EPOCH)" >> $$(FAKEROOT_SCRIPT) +endif $$(call PRINTF,$$(ROOTFS_$(2)_CMD)) >> $$(FAKEROOT_SCRIPT) chmod a+x $$(FAKEROOT_SCRIPT) PATH=$$(BR_PATH) $$(HOST_DIR)/usr/bin/pseudo -- $$(FAKEROOT_SCRIPT) -- cgit v1.2.3