Currently rerunning mg-debian-install-update when the external files
have changed still produces differences in the local files produced
during post-processing.
Avoid these differences by:
- Using gzip -n, which avoids storing a timestamp in the gzip
header (as well as the name, which we don't need).
- Using pax -M norm, which normalises all timestamps (among other
things, such as the owner, which we don't care about)
- Using tar --mtime, with a reference within the dpkg-deb created
hierarchy (which has timestamps from the package and is therefore
dependent only on the downloaded package revision)
With this the results of two invocations of
mg-debian-installer-update(-all) are identical (assuming no changes to
the downloaded files) as demonstrated by runnign this quick hack:
#!/bin/bash
set -ex
TMP=$HOME/tmp/mg-di
rm -rf $TMP
mkdir -p $TMP
cat >$TMP/config <<EOF
TftpPath $TMP
TftpDiBase debian-installer
EOF
cat $TMP/config
mkdir -p $TMP/debian-installer
export OSSTEST_CONFIG=production-config:$TMP/config
# ./mg-debian-installer-update wheezy armhf firmware-bnx2
./mg-debian-installer-update-all
find $TMP/debian-installer -type f -print0 | xargs -0x md5sum > $TMP/SUMS.BASE
#rm -rf $TMP/debian-installer/*
mv $TMP/debian-installer $TMP/debian-installer.org
mkdir -p $TMP/debian-installer
# ./mg-debian-installer-update wheezy armhf firmware-bnx2
./mg-debian-installer-update-all
md5sum --quiet -c $TMP/SUMS.BASE
exit 0
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
curl -s "$site/$pkgfile" >$p.deb
rm -rf x
dpkg-deb -x $p.deb x
- cd x; pax -x sv4cpio -s '%lib%/lib%' -w lib >../cpio; cd ..
- gzip -9f cpio
+ cd x; pax -x sv4cpio -s '%lib%/lib%' -w -M norm lib >../cpio; cd ..
+ gzip -9nf cpio
mv cpio.gz $p.cpio.gz
rm -rf x
done
-path \*/kernel/drivers/scsi/\* -o \
-path \*/kernel/drivers/usb/dwc3/\* -o \
-path \*/kernel/drivers/usb/host/\* \) \
- |pax -x sv4cpio -s '%lib%/lib%' -d -w >../cpio; cd ..
- gzip -9f cpio
+ |pax -x sv4cpio -s '%lib%/lib%' -d -w -M norm >../cpio; cd ..
+ gzip -9nf cpio
mv cpio.gz armmp.cpio.gz
rm -rf dtbs/
mkdir dtbs/
mv x/usr/lib/linux-image-*-armmp/*.dtb dtbs/
- tar -caf dtbs.tar.gz dtbs
+ tar --mtime=./x/usr/lib -cf dtbs.tar dtbs
+ gzip -9nf dtbs.tar
rm -rf x
fi