summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2016-01-31 23:29:16 +0000
committerFelix Fietkau <nbd@openwrt.org>2016-01-31 23:29:16 +0000
commitbe6acba4dc5c9013a8f61fb2e9d2dbb976126aa8 (patch)
treeae4776018ed3f2a18d6c3c0cf97bae2d14fd995b /scripts
parentad8169546cbcb5b2ed59cef332bb6b1dc5e389ef (diff)
downloadmtk-20170518-be6acba4dc5c9013a8f61fb2e9d2dbb976126aa8.zip
mtk-20170518-be6acba4dc5c9013a8f61fb2e9d2dbb976126aa8.tar.gz
mtk-20170518-be6acba4dc5c9013a8f61fb2e9d2dbb976126aa8.tar.bz2
build system: have tar use $SOURCE_DATE_EPOCH for --mtime
The --mtime argument to 'tar' sets the modification time for all files within the archive, which determines the timestamp files will get when they are extracted. In this case, rootfs and other tarballs will get mtimes which correspond to the last commit timestamp of the build system, as reported by git/subversion. This is a step towards reproducible image builds. Signed-off-by: bryan newbold <bnewbold@robocracy.org> Signed-off-by: Alexander Couzens <lynxis@fe80.eu> Signed-off-by: Felix Fietkau <nbd@openwrt.org> SVN-Revision: 48586
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/sysupgrade-nand.sh7
1 files changed, 6 insertions, 1 deletions
diff --git a/scripts/sysupgrade-nand.sh b/scripts/sysupgrade-nand.sh
index 92b326c..45b17da 100755
--- a/scripts/sysupgrade-nand.sh
+++ b/scripts/sysupgrade-nand.sh
@@ -56,7 +56,12 @@ echo "BOARD=${board}" > "${tmpdir}/sysupgrade-${board}/CONTROL"
[ -z "${rootfs}" ] || cp "${rootfs}" "${tmpdir}/sysupgrade-${board}/root"
[ -z "${kernel}" ] || cp "${kernel}" "${tmpdir}/sysupgrade-${board}/kernel"
-(cd "$tmpdir"; tar cvf sysupgrade.tar sysupgrade-${board})
+mtime=""
+if [ -n "$SOURCE_DATE_EPOCH" ]; then
+ mtime="--mtime=@${SOURCE_DATE_EPOCH}"
+fi
+
+(cd "$tmpdir"; tar cvf sysupgrade.tar sysupgrade-${board} ${mtime})
err="$?"
if [ -e "$tmpdir/sysupgrade.tar" ]; then
cp "$tmpdir/sysupgrade.tar" "$outfile"