From 1d035b83d0a35a2a3021d7fb349abd9d517a15f9 Mon Sep 17 00:00:00 2001 From: Holger Levsen Date: Sat, 13 Jun 2015 02:15:39 +0200 Subject: reproducible openwrt: add css and logo (derived from http://luci.subsignal.org/trac/browser/luci/trunk/themes/openwrt.org/htdocs/luci-static/openwrt.org/cascade.css?rev=6304), adopt html. build .ipk packages --- bin/reproducible_openwrt.sh | 54 +++++++++++++++++++++++---------------------- 1 file changed, 28 insertions(+), 26 deletions(-) (limited to 'bin/reproducible_openwrt.sh') 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 "" > $TOOLCHAIN_HTML +echo "
Contents of
build_dir/host/
" > $TOOLCHAIN_HTML for i in $(ls -1 build_dir/host/) ; do echo " " >> $TOOLCHAIN_HTML done echo "
Contents of build_dir/host/
$i
" >> $TOOLCHAIN_HTML -echo "" >> $TOOLCHAIN_HTML +echo "
Downloaded software built for
$TARGET
" >> $TOOLCHAIN_HTML for i in $(ls -1 dl/) ; do echo " " >> $TOOLCHAIN_HTML done @@ -215,14 +222,14 @@ echo "========================================================================== echo "$(date -u) - Running $DBDVERSION on openwrt images now" echo "=============================================================================" IMAGES_HTML=$(mktemp) -echo "
Downloaded software built for $TARGET
$i
" > $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 "
  • \"unreproducible $j (${SIZE}K) is unreproducible.
  • " >> $IMAGES_HTML + echo " " >> $IMAGES_HTML else SHASUM=$(sha256sum $j|cut -d " " -f1) - echo "
  • \"reproducible $j ($SHASUM, ${SIZE}K) is reproducible.
  • " >> $IMAGES_HTML + echo " " >> $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 " " >> $IMAGES_HTML +echo "
    Images for $TARGET
    \"unreproducible $j (${SIZE}K) is unreproducible.
    \"reproducible $j ($SHASUM, ${SIZE}K) is reproducible.
    " >> $IMAGES_HTML GOOD_PERCENT=$(echo "scale=1 ; ($GOOD_IMAGES*100/$ALL_IMAGES)" | bc) # @@ -255,22 +262,17 @@ cat > $PAGE <<- EOF openwrt - + -
    -
    -

     

    -

    openwrt logo
    -
    -
    - OpenWRT: reproducible wireless freedom? -
    -
    +    

    " -write_page "

    Reproducible OpenWRT

    " +write_page "

    " +write_page "
    " +write_page "

    Reproducible OpenWRT - reproducible wireless freedom?

    " write_page "

    Reproducible builds 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 reproducible builds on the Debian wiki and on https://reproducible.debian.net. The wiki has a lot more information, eg. why this is useful, what common issues exist and which workarounds and solutions are known.
    " write_page " Reproducible OpenWRT 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 debbindiff. 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.

    " write_page "

    There is a monthly run jenkins job to test the master branch of openwrt.git. Currently this job is triggered more often though, because this is still under development and brand new. The jenkins job is simply running reproducible_openwrt.sh in a Debian environemnt and this script is solely responsible for creating this page. Feel invited to join #debian-reproducible (on irc.oftc.net) to request job runs whenever sensible. Patches and other feedback are very much appreciated!

    " @@ -278,11 +280,11 @@ write_page "

    $GOOD_IMAGES ($GOOD_PERCENT%) out of $ALL_IMAGES built ope write_page " These tests were last run on $DATE for version ${OPENWRT_VERSION}.

    " write_explaination_table OpenWRT cat $IMAGES_HTML >> $PAGE -write_page "

    "
    +write_page "     
    git commit built
    >" echo -n "$OPENWRT" >> $PAGE -write_page "

    " +write_page "
    " cat $TOOLCHAIN_HTML >> $PAGE -write_page "
    " +write_page " " write_page_footer OpenWRT publish_page rm -f $IMAGES_HTML $TOOLCHAIN_HTML -- cgit v1.2.3-70-g09d2