From 093579017eb890caf5f2278f273200750f736f7e Mon Sep 17 00:00:00 2001 From: Alexander Couzens Date: Wed, 12 Oct 2016 18:37:36 +0200 Subject: reproducible/openwrt|lede: add command node_create_tmpdirs create tmpdir in a spereate step Signed-off-by: Holger Levsen --- bin/reproducible_lede.sh | 1 + bin/reproducible_openwrt.sh | 1 + bin/reproducible_openwrt_common.sh | 13 ++++++++++++- 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/bin/reproducible_lede.sh b/bin/reproducible_lede.sh index bccc6d00..cf19221f 100755 --- a/bin/reproducible_lede.sh +++ b/bin/reproducible_lede.sh @@ -27,6 +27,7 @@ case $1 in openwrt_build |\ openwrt_download |\ openwrt_get_banner |\ + node_create_tmpdirs |\ node_cleanup_tmpdirs) ;; # this is the allowed list *) echo "Unsupported remote node function $@" diff --git a/bin/reproducible_openwrt.sh b/bin/reproducible_openwrt.sh index cf7eedc9..07233d2b 100755 --- a/bin/reproducible_openwrt.sh +++ b/bin/reproducible_openwrt.sh @@ -27,6 +27,7 @@ case $1 in openwrt_build |\ openwrt_download |\ openwrt_get_banner |\ + node_create_tmpdirs |\ node_cleanup_tmpdirs) ;; # this is the allowed list *) echo "Unsupported remote node function $@" diff --git a/bin/reproducible_openwrt_common.sh b/bin/reproducible_openwrt_common.sh index 936a48d4..042a47e8 100644 --- a/bin/reproducible_openwrt_common.sh +++ b/bin/reproducible_openwrt_common.sh @@ -23,6 +23,16 @@ node_cleanup_tmpdirs() { rm -rf $TMPDIR } +node_create_tmpdirs() { + export TMPDIR=$1 + # (very simple) check what we are creating + if [ "${TMPDIR:0:26}" != "/srv/reproducible-results/" ] || [ ${#TMPDIR} -le 26 ] ; then + echo "Something very strange with \$TMPDIR=$TMPDIR exiting instead of doing create." + exit 1 + fi + mkdir -p $TMPDIR/download +} + # called as trap handler # called on cleanup master_cleanup_tmpdirs() { @@ -206,7 +216,6 @@ openwrt_download() { local CONFIG=$3 local TMPDIR=$4 - mkdir -p $TMPDIR/download cd $TMPDIR/download # checkout the repo @@ -295,6 +304,8 @@ build_two_times() { TARGET=$2 CONFIG=$3 + ssh $GENERIC_NODE1 reproducible_$TYPE node node_create_tmpdirs $TMPDIR + ssh $GENERIC_NODE2 reproducible_$TYPE node node_create_tmpdirs $TMPDIR # download and prepare openwrt on node b1 ssh $GENERIC_NODE1 reproducible_$TYPE node openwrt_download $TYPE $TARGET $CONFIG $TMPDIR rsync -a $GENERIC_NODE1:$TMPDIR/download/ $TMPDIR/download/ -- cgit v1.2.3-54-g00ecf