From: Jérôme Pouiller Date: Wed, 23 Nov 2016 12:58:43 +0000 (+0100) Subject: fs/tar: make results reproducible X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=59f9c4ca9feb2c070df508c7196f06a6e87307b4;p=buildroot.git fs/tar: make results reproducible 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 --- diff --git a/fs/tar/tar.mk b/fs/tar/tar.mk index 11c69c5a8b..b14c977d76 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))