aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2015-09-11 16:33:26 +0000
committerFelix Fietkau <nbd@openwrt.org>2015-09-11 16:33:26 +0000
commit686b04f499b3f36aee0306d84c5321db98fb10c6 (patch)
tree7b73d71232e38584e9c9be6ea00d7077b702e904
parent2cd3a64073d504e8d4edf0370cf99b25a3ef1016 (diff)
downloadmaster-187ad058-686b04f499b3f36aee0306d84c5321db98fb10c6.tar.gz
master-187ad058-686b04f499b3f36aee0306d84c5321db98fb10c6.tar.bz2
master-187ad058-686b04f499b3f36aee0306d84c5321db98fb10c6.zip
include/image.mk: make tar reproducible
several packages reported different file order between builds make binutils, kmod-sched reproducible Signed-off-by: Dirk Neukirchen <dirkneukirchen@web.de> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@46859 3c298f89-4303-0410-b956-a3cf2f4a3e73
-rw-r--r--include/image.mk2
-rwxr-xr-xscripts/ipkg-build6
2 files changed, 4 insertions, 4 deletions
diff --git a/include/image.mk b/include/image.mk
index cf6717cf19..c59222e415 100644
--- a/include/image.mk
+++ b/include/image.mk
@@ -245,7 +245,7 @@ define Image/mkfs/cpiogz
endef
define Image/mkfs/targz
- $(TAR) -czpf $(BIN_DIR)/$(IMG_PREFIX)$(if $(PROFILE),-$(PROFILE))-rootfs.tar.gz --numeric-owner --owner=0 --group=0 -C $(TARGET_DIR)/ .
+ $(TAR) -czpf $(BIN_DIR)/$(IMG_PREFIX)$(if $(PROFILE),-$(PROFILE))-rootfs.tar.gz --numeric-owner --owner=0 --group=0 --sort=name -C $(TARGET_DIR)/ .
endef
E2SIZE=$(shell echo $$(($(CONFIG_TARGET_ROOTFS_PARTSIZE)*1024*1024)))
diff --git a/scripts/ipkg-build b/scripts/ipkg-build
index cd70c1fbba..a54e9b5af2 100755
--- a/scripts/ipkg-build
+++ b/scripts/ipkg-build
@@ -139,20 +139,20 @@ mkdir $tmp_dir
echo $CONTROL > $tmp_dir/tarX
# Preserve permissions (-p) when creating data.tar.gz as non-root user
-( cd $pkg_dir && $TAR $ogargs -X $tmp_dir/tarX --format=gnu -czpf $tmp_dir/data.tar.gz --mtime="$TIMESTAMP" . )
+( cd $pkg_dir && $TAR $ogargs -X $tmp_dir/tarX --format=gnu --sort=name -czpf $tmp_dir/data.tar.gz --mtime="$TIMESTAMP" . )
installed_size=`stat -c "%s" $tmp_dir/data.tar.gz`
sed -i -e "s/^Installed-Size: .*/Installed-Size: $installed_size/" \
$pkg_dir/$CONTROL/control
-( cd $pkg_dir/$CONTROL && $TAR $ogargs --format=gnu -czf $tmp_dir/control.tar.gz --mtime="$TIMESTAMP" . )
+( cd $pkg_dir/$CONTROL && $TAR $ogargs --format=gnu --sort=name -czf $tmp_dir/control.tar.gz --mtime="$TIMESTAMP" . )
rm $tmp_dir/tarX
echo "2.0" > $tmp_dir/debian-binary
pkg_file=$dest_dir/${pkg}_${version}_${arch}.ipk
rm -f $pkg_file
-( cd $tmp_dir && $TAR --format=gnu -zcf $pkg_file --mtime="$TIMESTAMP" ./debian-binary ./data.tar.gz ./control.tar.gz )
+( cd $tmp_dir && $TAR --format=gnu --sort=name -zcf $pkg_file --mtime="$TIMESTAMP" ./debian-binary ./data.tar.gz ./control.tar.gz )
rm $tmp_dir/debian-binary $tmp_dir/data.tar.gz $tmp_dir/control.tar.gz
rmdir $tmp_dir