From 0b4d9e94923280e5e836105a8b82e9b01f1714d0 Mon Sep 17 00:00:00 2001 From: Alexander Couzens Date: Sun, 24 Jul 2016 13:56:25 +0200 Subject: reproducible_lede: move resulting images into targets dir Make the structure more clean when packages are seperate from images Signed-off-by: Holger Levsen --- bin/reproducible_lede.sh | 66 ++++++++++++++++++++------------------ bin/reproducible_openwrt_common.sh | 4 +-- 2 files changed, 37 insertions(+), 33 deletions(-) (limited to 'bin') diff --git a/bin/reproducible_lede.sh b/bin/reproducible_lede.sh index 176c58aa..8705277b 100755 --- a/bin/reproducible_lede.sh +++ b/bin/reproducible_lede.sh @@ -100,40 +100,44 @@ DBD_BAD_PKGS_HTML=$(mktemp --tmpdir=$TMPDIR) GOOD_IMAGES=0 ALL_IMAGES=0 SIZE="" -cd $TMPDIR/b1 +cd $TMPDIR/b1/targets tree . -for i in * ; do - cd $i - - # search images in both paths to find non-existing ones - IMGS1=$(find * -type f -name "*.bin" -o -name "*.squashfs" | sort -u ) - pushd $TMPDIR/b2/$i - IMGS2=$(find * -type f -name "*.bin" -o -name "*.squashfs" | sort -u ) - popd - - echo " " >> $DBD_HTML - for j in $(printf "$IMGS1\n$IMGS2" | sort -u ) ; do - let ALL_IMAGES+=1 - if [ ! -f $TMPDIR/b1/$i/$j -o ! -f $TMPDIR/b2/$i/$j ] ; then - echo " " >> $DBD_HTML - rm -f $BASE/lede/dbd/$i/$j.html # cleanup from previous (unreproducible) tests - if needed - continue - fi - call_diffoscope $i $j - get_filesize $j - if [ -f $TMPDIR/$i/$j.html ] ; then - mkdir -p $BASE/lede/dbd/$i - mv $TMPDIR/$i/$j.html $BASE/lede/dbd/$i/$j.html - echo " " >> $DBD_HTML - else - SHASUM=$(sha256sum $j|cut -d " " -f1) - echo " " >> $DBD_HTML - let GOOD_IMAGES+=1 - rm -f $BASE/lede/dbd/$i/$j.html # cleanup from previous (unreproducible) tests - if needed - fi +for target in * ; do + cd $target + for subtarget in * ; do + cd $subtarget + + # search images in both paths to find non-existing ones + IMGS1=$(find * -type f -name "*.bin" -o -name "*.squashfs" | sort -u ) + pushd $TMPDIR/b2/targets/$target/$subtarget + IMGS2=$(find * -type f -name "*.bin" -o -name "*.squashfs" | sort -u ) + popd + + echo "
Images for $i
\"ftbfs $j (${SIZE}) failed to build.
\"unreproducible $j (${SIZE}) is unreproducible.
\"reproducible $j ($SHASUM, $SIZE) is reproducible.
" >> $DBD_HTML + for image in $(printf "$IMGS1\n$IMGS2" | sort -u ) ; do + let ALL_IMAGES+=1 + if [ ! -f $TMPDIR/b1/$target/$subtarget/$image -o ! -f $TMPDIR/b2/$target/$subtarget/$image ] ; then + echo " " >> $DBD_HTML + rm -f $BASE/lede/dbd/$target/$subtarget/$image.html # cleanup from previous (unreproducible) tests - if needed + continue + fi + call_diffoscope $target/$subtarget $image + get_filesize $image + if [ -f $TMPDIR/$target/$subtarget/$image.html ] ; then + mkdir -p $BASE/lede/dbd/$target/$subtarget + mv $TMPDIR/$target/$subtarget/$image.html $BASE/lede/dbd/$target/$subtarget/$image.html + echo " " >> $DBD_HTML + else + SHASUM=$(sha256sum $image|cut -d " " -f1) + echo " " >> $DBD_HTML + let GOOD_IMAGES+=1 + rm -f $BASE/lede/dbd/$target/$subtarget/$image.html # cleanup from previous (unreproducible) tests - if needed + fi + done + cd .. + echo "
Images for $target/$subtarget
\"ftbfs $image (${SIZE}) failed to build.
\"unreproducible $image (${SIZE}) is unreproducible.
\"reproducible $image ($SHASUM, $SIZE) is reproducible.
" >> $DBD_HTML done cd .. - echo " " >> $DBD_HTML done GOOD_PERCENT_IMAGES=$(echo "scale=1 ; ($GOOD_IMAGES*100/$ALL_IMAGES)" | bc) # run diffoscope on the packages diff --git a/bin/reproducible_openwrt_common.sh b/bin/reproducible_openwrt_common.sh index a678f6a7..2e774b4f 100644 --- a/bin/reproducible_openwrt_common.sh +++ b/bin/reproducible_openwrt_common.sh @@ -41,9 +41,9 @@ save_lede_results() { pushd $subtarget || continue # save firmware images - mkdir -p $TMPDIR/$RUN/$target/$subtarget/ + mkdir -p $TMPDIR/$RUN/targets/$target/$subtarget/ for image in $(find * -name "*.bin" -o -name "*.squashfs") ; do - cp -p $image $TMPDIR/$RUN/$target/$subtarget/ + cp -p $image $TMPDIR/$RUN/targets/$target/$subtarget/ done # save subtarget specific packages -- cgit v1.2.3-70-g09d2