build: Drop user/group ID/name from sysupgrade.tar
authorSven Eckelmann <sven@narfation.org>
Thu, 6 Dec 2018 10:23:00 +0000 (11:23 +0100)
committerMathias Kresin <dev@kresin.me>
Wed, 2 Jan 2019 21:36:17 +0000 (22:36 +0100)
Tar will automatically record the user/group ID and name for
files/directories. This reduces the reproducibility of the sysupgrade.tar
because most of the people don't use the same username as the OpenWrt
buildserver.

Signed-off-by: Sven Eckelmann <sven@narfation.org>
scripts/sysupgrade-tar.sh

index ca5577387d6837e0085995ae8a57368b8fe937ae..d1d627a96efb8b93fed445bfc365df32613502a1 100755 (executable)
@@ -61,7 +61,7 @@ if [ -n "$SOURCE_DATE_EPOCH" ]; then
        mtime="--mtime=@${SOURCE_DATE_EPOCH}"
 fi
 
-(cd "$tmpdir"; tar --sort=name -cvf sysupgrade.tar sysupgrade-${board} ${mtime})
+(cd "$tmpdir"; tar --sort=name --owner=0 --group=0 --numeric-owner -cvf sysupgrade.tar sysupgrade-${board} ${mtime})
 err="$?"
 if [ -e "$tmpdir/sysupgrade.tar" ]; then
        cp "$tmpdir/sysupgrade.tar" "$outfile"