From 6b483cce4f50c4defc7f99cef9a74867f58cc62a Mon Sep 17 00:00:00 2001
From: Holger Levsen
Date: Mon, 14 Dec 2015 18:40:47 +0100
Subject: reproducible coreboot: refactor, sort boring reproducible ROMs at the
bottom
---
bin/reproducible_coreboot.sh | 23 ++++++++++++++---------
1 file changed, 14 insertions(+), 9 deletions(-)
(limited to 'bin')
diff --git a/bin/reproducible_coreboot.sh b/bin/reproducible_coreboot.sh
index ef1cd130..7c8fe40f 100755
--- a/bin/reproducible_coreboot.sh
+++ b/bin/reproducible_coreboot.sh
@@ -159,8 +159,9 @@ DIFFOSCOPE="$(schroot --directory /tmp -c source:jenkins-reproducible-${DBDSUITE
echo "============================================================================="
echo "$(date -u) - Running $DIFFOSCOPE on coreboot images."
echo "============================================================================="
-ROMS_HTML=$(mktemp --tmpdir=$TMPDIR)
-echo " " > $ROMS_HTML
+ROW_FRAGMENTS_GOOD_ROMS=$(mktemp --tmpdir=$TMPDIR)
+ROW_FRAGMENTS_BAD_ROMS=$(mktemp --tmpdir=$TMPDIR)
+LIST_OBJECT=$(mktemp --tmpdir=$TMPDIR)
BAD_ROMS=0
GOOD_ROMS=0
ALL_ROMS=0
@@ -174,23 +175,27 @@ for i in $(ls -1d *| sort -u) ; do
get_filesize $i/coreboot.rom
if [ -f $TMPDIR/$i/coreboot.rom.html ] ; then
mv $TMPDIR/$i/coreboot.rom.html $BASE/coreboot/dbd/$i.html
- echo " - $i ($SIZE) is unreproducible.
" >> $ROMS_HTML
+ echo " - $i ($SIZE) is unreproducible.
" >> $ROW_FRAGMENTS_BAD_ROMS
else
SHASUM=$(sha256sum $i/coreboot.rom|cut -d " " -f1)
- echo " - $i ($SHASUM, $SIZE) is reproducible.
" >> $ROMS_HTML
+ echo " - $i ($SHASUM, $SIZE) is reproducible.
" >> $ROW_FRAGMENTS_GOOD_ROMS
let GOOD_ROMS+=1
rm -f $BASE/coreboot/dbd/$i.html # cleanup from previous (unreproducible) tests - if needed
fi
else
if [ ! -f $i/coreboot.rom ] ; then
- echo " - $i failed to build from source.
" >> $ROMS_HTML
+ echo " - $i failed to build from source.
" >> $ROW_FRAGMENTS_BAD_ROMS
else
- echo " - $i failed to build from source on the 2nd build.
" >> $ROMS_HTML
+ echo " - $i failed to build from source on the 2nd build.
" >> $ROW_FRAGMENTS_BAD_ROMS
fi
let BAD_ROMS+=1
fi
done
-echo "
" >> $ROMS_HTML
+echo " " > $LIST_OBJECT
+cat $ROW_FRAGMENTS_BAD_ROMS >> $LIST_OBJECT
+cat $ROW_FRAGMENTS_GOOD_ROMS >> $LIST_OBJECT
+rm $ROW_FRAGMENTS_BAD_ROMS $ROW_FRAGMENTS_GOOD_ROMS > /dev/null
+echo "
" >> $LIST_OBJECT
GOOD_PERCENT=$(echo "scale=1 ; ($GOOD_ROMS*100/$ALL_ROMS)" | bc)
BAD_PERCENT=$(echo "scale=1 ; ($BAD_ROMS*100/$ALL_ROMS)" | bc)
# are we there yet?
@@ -235,7 +240,7 @@ else
fi
write_page " These tests were last run on $DATE for version ${COREBOOT_VERSION} using ${DIFFOSCOPE}.
"
write_explaination_table coreboot
-cat $ROMS_HTML >> $PAGE
+cat $LIST_OBJECT >> $PAGE
write_page " "
echo -n "$COREBOOT" >> $PAGE
write_page "
"
@@ -243,7 +248,7 @@ cat $TOOLCHAIN_HTML >> $PAGE
write_page " "
write_page_footer coreboot
publish_page
-rm -f $ROMS_HTML $TOOLCHAIN_HTML
+rm -f $LIST_OBJECT $TOOLCHAIN_HTML
# the end
calculate_build_duration
--
cgit v1.2.3-70-g09d2