summaryrefslogtreecommitdiffstats
path: root/bin/reproducible_openwrt.sh
diff options
context:
space:
mode:
Diffstat (limited to 'bin/reproducible_openwrt.sh')
-rwxr-xr-xbin/reproducible_openwrt.sh54
1 files changed, 28 insertions, 26 deletions
diff --git a/bin/reproducible_openwrt.sh b/bin/reproducible_openwrt.sh
index 9a2bcde7..6bfb3e8a 100755
--- a/bin/reproducible_openwrt.sh
+++ b/bin/reproducible_openwrt.sh
@@ -70,11 +70,18 @@ save_openwrt_results(){
cd bin
for i in * ; do
cd $i
+ # save images
mkdir -p $TMPDIR/$RUN/$i
- for j in $(find . -name "*.bin") ; do
+ for j in $(find . -name "*.bin" -exec basename \{\} \; ) ; do
cp -p $j $TMPDIR/$RUN/$i/
done
- cd ..
+ # save packages
+ cd packages
+ for j in $(find * -name "*.ipk") ; do
+ mkdir -p $TMPDIR/$RUN/$i/ipk/$(dirname $j)
+ cp -p $j $TMPDIR/$RUN/$i/ipk/$(dirname $j)
+ done
+ cd ../..
done
cd ..
}
@@ -125,7 +132,7 @@ ionice -c 3 nice \
ionice -c 3 nice \
make -j $NUM_CPU package/cleanup
ionice -c 3 nice \
- make -j $NUM_CPU package/compile
+ make -j $NUM_CPU package/compile || true # don't let some packages fail the whole build
ionice -c 3 nice \
make -j $NUM_CPU package/install
ionice -c 3 nice \
@@ -160,7 +167,7 @@ ionice -c 3 nice \
make -j $NEW_NUM_CPU package/cleanup
ionice -c 3 nice \
linux64 --uname-2.6 \
- make -j $NEW_NUM_CPU package/compile
+ make -j $NEW_NUM_CPU package/compile || true # don't let some packages fail the whole build
ionice -c 3 nice \
linux64 --uname-2.6 \
make -j $NEW_NUM_CPU package/install
@@ -186,12 +193,12 @@ save_openwrt_results b2
#
TOOLCHAIN_HTML=$(mktemp)
TARGET=$(ls -1d staging_dir/toolchain*|cut -d "-" -f2-|xargs echo)
-echo "<table><tr><th>Contents of <pre>build_dir/host/</pre></th></tr>" > $TOOLCHAIN_HTML
+echo "<table><tr><th>Contents of <code>build_dir/host/</code></th></tr>" > $TOOLCHAIN_HTML
for i in $(ls -1 build_dir/host/) ; do
echo " <tr><td>$i</td></tr>" >> $TOOLCHAIN_HTML
done
echo "</table>" >> $TOOLCHAIN_HTML
-echo "<table><tr><th>Downloaded software built for <pre>$TARGET</pre></th></tr>" >> $TOOLCHAIN_HTML
+echo "<table><tr><th>Downloaded software built for <code>$TARGET</code></th></tr>" >> $TOOLCHAIN_HTML
for i in $(ls -1 dl/) ; do
echo " <tr><td>$i</td></tr>" >> $TOOLCHAIN_HTML
done
@@ -215,14 +222,14 @@ echo "==========================================================================
echo "$(date -u) - Running $DBDVERSION on openwrt images now"
echo "============================================================================="
IMAGES_HTML=$(mktemp)
-echo " <ul>" > $IMAGES_HTML
+echo " <table><tr><th>Images for <code>$TARGET</code></th></tr>" > $IMAGES_HTML
GOOD_IMAGES=0
ALL_IMAGES=0
create_results_dirs
cd $TMPDIR/b1
for i in * ; do
cd $i
- for j in $(find . -name "*.bin"|sort -u ) ; do
+ for j in $(find . -name "*.bin" -exec basename \{\} \; |sort -u ) ; do
let ALL_IMAGES+=1
call_debbindiff $i $j
SIZE="$(du -h -b $j | cut -f1)"
@@ -230,17 +237,17 @@ for i in * ; do
if [ -f $TMPDIR/$i/$j.html ] ; then
mkdir -p $BASE/openwrt/dbd/$i
mv $TMPDIR/$i/$j.html $BASE/openwrt/dbd/$i/$j.html
- echo " <li><a href=\"dbd/$i/$j.html\"><img src=\"/userContent/static/weather-showers-scattered.png\" alt=\"unreproducible icon\" /> $j</a> (${SIZE}K) is unreproducible.</li>" >> $IMAGES_HTML
+ echo " <tr><td><a href=\"dbd/$i/$j.html\"><img src=\"/userContent/static/weather-showers-scattered.png\" alt=\"unreproducible icon\" /> $j</a> (${SIZE}K) is unreproducible.</td></tr>" >> $IMAGES_HTML
else
SHASUM=$(sha256sum $j|cut -d " " -f1)
- echo " <li><img src=\"/userContent/static/weather-clear.png\" alt=\"reproducible icon\" /> $j ($SHASUM, ${SIZE}K) is reproducible.</li>" >> $IMAGES_HTML
+ echo " <tr><td><img src=\"/userContent/static/weather-clear.png\" alt=\"reproducible icon\" /> $j ($SHASUM, ${SIZE}K) is reproducible.</td></tr>" >> $IMAGES_HTML
let GOOD_IMAGES+=1
rm -f $BASE/openwrt/dbd/$i/$j.html # cleanup from previous (unreproducible) tests - if needed
fi
done
cd ..
done
-echo " </ul>" >> $IMAGES_HTML
+echo " </table>" >> $IMAGES_HTML
GOOD_PERCENT=$(echo "scale=1 ; ($GOOD_IMAGES*100/$ALL_IMAGES)" | bc)
#
@@ -255,22 +262,17 @@ cat > $PAGE <<- EOF
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width">
<title>openwrt</title>
- <!-- link rel='stylesheet' id='twentyfourteen-style-css' href='landing_style.css?ver=4.0' type='text/css' media='all' /-->
+ <link rel='stylesheet' id='kamikaze-style-css' href='cascading.css?ver=4.0' type='text/css' media='all'>
</head>
<body>
- <div class="content">
- <div class="page-content">
- <p>&nbsp;</p>
- <p><center><img src="logo.png" alt="openwrt logo"" /><br />
- <blockquote>
- <br />
- <strong>OpenWRT</strong>: <em>reproducible</em> wireless freedom?
- </blockquote>
- <pre>
+ <div id="header">
+ <p><center>
+ <code>
EOF
cat $(find openwrt/build_dir/ -name banner | grep etc/banner|head -1) >> $PAGE
-write_page " </pre></center></p>"
-write_page " <h1>Reproducible OpenWRT</h1>"
+write_page " </code></center></p>"
+write_page " </div><div id=\"main-content\">"
+write_page " <h1>Reproducible OpenWRT - <em>reproducible</em> wireless freedom?</h1>"
write_page " <p><em>Reproducible builds</em> enable anyone to reproduce bit by bit identical binary packages from a given source, so that anyone can verify that a given binary derived from the source it was said to be derived. There is a lot more information about <a href=\"https://wiki.debian.org/ReproducibleBuilds\">reproducible builds on the Debian wiki</a> and on <a href=\"https://reproducible.debian.net\">https://reproducible.debian.net</a>. The wiki has a lot more information, eg. why this is useful, what common issues exist and which workarounds and solutions are known.<br />"
write_page " <em>Reproducible OpenWRT</em> is an effort to apply this to OpenWRT. Thus each OpenWR target is build twice, with a few varitations added and then the resulting images from the two builds are compared using <a href=\"https://tracker.debian.org/debbindiff\">debbindiff</a>. Please note that the toolchain is not varied at all as the rebuild happens on exactly the same system. More variations are expected to be seen in the wild.</p>"
write_page " <p>There is a monthly run <a href=\"https://jenkins.debian.net/view/reproducible/job/reproducible_openwrt/\">jenkins job</a> to test the <code>master</code> branch of <a href=\"git://git.openwrt.org/openwrt.git\">openwrt.git</a>. Currently this job is triggered more often though, because this is still under development and brand new. The jenkins job is simply running <a href=\"http://anonscm.debian.org/cgit/qa/jenkins.debian.net.git/tree/bin/reproducible_openwrt.sh\">reproducible_openwrt.sh</a> in a Debian environemnt and this script is solely responsible for creating this page. Feel invited to join <code>#debian-reproducible</code> (on irc.oftc.net) to request job runs whenever sensible. Patches and other <a href=\"mailto:reproducible-builds@lists.alioth.debian.org\">feedback</a> are very much appreciated!</p>"
@@ -278,11 +280,11 @@ write_page " <p>$GOOD_IMAGES ($GOOD_PERCENT%) out of $ALL_IMAGES built ope
write_page " These tests were last run on $DATE for version ${OPENWRT_VERSION}.</p>"
write_explaination_table OpenWRT
cat $IMAGES_HTML >> $PAGE
-write_page " <p><pre>"
+write_page " <table><tr><th>git commit built</th></tr><tr><td>><code>"
echo -n "$OPENWRT" >> $PAGE
-write_page " </pre></p>"
+write_page " </code></td></tr></table>"
cat $TOOLCHAIN_HTML >> $PAGE
-write_page " </div></div>"
+write_page " </div>"
write_page_footer OpenWRT
publish_page
rm -f $IMAGES_HTML $TOOLCHAIN_HTML