diff options
author | Holger Levsen <holger@layer-acht.org> | 2015-06-12 18:18:36 +0200 |
---|---|---|
committer | Holger Levsen <holger@layer-acht.org> | 2015-06-12 18:18:36 +0200 |
commit | 3948a0b90d8d050c9cd349de5522f199e3fb8823 (patch) | |
tree | a92ad5877e9ccb90444cbb4a2e1806f00984d0af | |
parent | ced3030c0814e28efb51ba99d494ba16be251add (diff) | |
download | jenkins.debian.net-3948a0b90d8d050c9cd349de5522f199e3fb8823.tar.xz |
reproducible openwrt: refactor, introduce save_openwrt_results(), fix bug with cleaning up between builds
-rwxr-xr-x | bin/reproducible_openwrt.sh | 52 |
1 files changed, 21 insertions, 31 deletions
diff --git a/bin/reproducible_openwrt.sh b/bin/reproducible_openwrt.sh index 81cc0eb4..3e373607 100755 --- a/bin/reproducible_openwrt.sh +++ b/bin/reproducible_openwrt.sh @@ -65,6 +65,20 @@ call_debbindiff() { fi } +save_openwrt_results(){ + RUN=$1 + cd bin + for i in * ; do + cd $i + mkdir -p $TMPDIR/$RUN/$i + for j in $(find . -name "*.bin") ; do + cp -p $j $TMPDIR/$RUN/$i/ + done + cd .. + done + cd .. +} + # # main # @@ -100,10 +114,8 @@ echo "$(date -u) - Building openwrt ${OPENWRT_VERSION} images now - first build echo "=============================================================================" export TZ="/usr/share/zoneinfo/Etc/GMT+12" # actually build everything -#nice ionice -c 3 \ -# make nice ionice -c 3 \ - make target/compile + make -j $NUM_CPU target/compile nice ionice -c 3 \ make -j $NUM_CPU package/cleanup nice ionice -c 3 \ @@ -115,23 +127,13 @@ nice ionice -c 3 \ nice ionice -c 3 \ make -j $NUM_CPU package/index -cd bin -for i in * ; do - cd $i - mkdir -p $TMPDIR/b1/$i - for j in $(find . -name "*.bin") ; do - cp -p $j $TMPDIR/b1/$i/ - done - cd .. -done -cd .. -rm bin -r +# save results in b1 +save_openwrt_results b1 -# # clean up between builds -# rm build_dir/target-* -r rm staging_dir/target-* -r +rm bin/* -r echo "=============================================================================" echo "$(date -u) - Building openwrt images now - second build run." @@ -144,12 +146,9 @@ export CAPTURE_ENVIRONMENT="I capture the environment" umask 0002 # use allmost all cores for second build NEW_NUM_CPU=$(echo $NUM_CPU-1|bc) -#nice ionice -c 3 \ -# linux64 --uname-2.6 \ -# make nice ionice -c 3 \ linux64 --uname-2.6 \ - make target/compile + make -j $NUM_CPU target/compile nice ionice -c 3 \ linux64 --uname-2.6 \ make -j $NEW_NUM_CPU package/cleanup @@ -173,17 +172,8 @@ export TZ="/usr/share/zoneinfo/UTC" export PATH="/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:" umask 0022 -cd bin -for i in * ; do - cd $i - mkdir -p $TMPDIR/b2/$i - for j in $(find . -name "*.bin") ; do - cp -p $j $TMPDIR/b2/$i/ - done - cd .. -done -cd .. -rm bin -r +# save results in b2 +save_openwrt_results b2 # # create html about toolchain used |