[Qa-jenkins-scm] [jenkins.debian.net] 01/01: reproducible_openwrt/lede: add openwrt_download

Holger Levsen holger at layer-acht.org
Wed Oct 12 10:37:11 UTC 2016


This is an automated email from the git hooks/post-receive script.

holger pushed a commit to branch master
in repository jenkins.debian.net.

commit f762aaee8b626310e77f783818c7a5124c6647c3
Author: Alexander Couzens <lynxis at fe80.eu>
Date:   Wed Oct 12 02:55:50 2016 +0200

    reproducible_openwrt/lede: add openwrt_download
    
    download all necesarry files before building to fix the future.
    
    Signed-off-by: Holger Levsen <holger at layer-acht.org>
---
 bin/reproducible_lede.sh           |  1 +
 bin/reproducible_openwrt.sh        |  1 +
 bin/reproducible_openwrt_common.sh | 45 ++++++++++++++++++++++++++++----------
 3 files changed, 36 insertions(+), 11 deletions(-)

diff --git a/bin/reproducible_lede.sh b/bin/reproducible_lede.sh
index 519c8c0..bccc6d0 100755
--- a/bin/reproducible_lede.sh
+++ b/bin/reproducible_lede.sh
@@ -25,6 +25,7 @@ case $1 in
 		shift
 		case $1 in
 			openwrt_build |\
+			openwrt_download |\
 			openwrt_get_banner |\
 			node_cleanup_tmpdirs) ;; # this is the allowed list
 			*)
diff --git a/bin/reproducible_openwrt.sh b/bin/reproducible_openwrt.sh
index b3d6675..cf7eedc 100755
--- a/bin/reproducible_openwrt.sh
+++ b/bin/reproducible_openwrt.sh
@@ -25,6 +25,7 @@ case $1 in
 		shift
 		case $1 in
 			openwrt_build |\
+			openwrt_download |\
 			openwrt_get_banner |\
 			node_cleanup_tmpdirs) ;; # this is the allowed list
 			*)
diff --git a/bin/reproducible_openwrt_common.sh b/bin/reproducible_openwrt_common.sh
index 7764908..1315040 100644
--- a/bin/reproducible_openwrt_common.sh
+++ b/bin/reproducible_openwrt_common.sh
@@ -196,6 +196,33 @@ openwrt_compile() {
 	ionice -c 3 $MAKE $OPTIONS package/index || true # don't let some packages fail the whole build
 }
 
+# called by openwrt_two_times
+# ssh $GENERIC_NODE1 reproducible_$TYPE node openwrt_download $TYPE $TARGET $CONFIG $TMPDIR
+openwrt_download() {
+	local TYPE=$1
+	local TARGET=$2
+	local CONFIG=$3
+	local TMPDIR=$4
+
+	mkdir -p $TMPDIR/download
+	cd $TMPDIR/download
+
+	# checkout the repo
+	echo "============================================================================="
+	echo "$(date -u) - Cloning $TYPE git repository."
+	echo "============================================================================="
+	git clone -b $OPENWRT_GIT_BRANCH $OPENWRT_GIT_REPO $TYPE
+	cd $TYPE
+
+	# update feeds
+	./scripts/feeds update
+	./scripts/feeds install -a
+
+	# configure openwrt because otherwise it wont download everything
+	openwrt_config $CONFIG
+	make download -j $NUM_CPU
+}
+
 openwrt_get_banner() {
 	TMPDIR=$1
 	TYPE=$2
@@ -225,17 +252,10 @@ openwrt_build() {
 	export TMPDIR=$5
 	export TMPBUILDDIR=$TMPDIR/build/
 
-	if [ -d $TMPDIR ] ; then
-		echo "============================================================================="
-		echo "TMPDIR already exists! $TMPDIR"
-		echo "============================================================================="
-		exit 1
-	fi
-	mkdir -p $TMPBUILDDIR
+	mv "$TMPDIR/download" "$TMPBUILDDIR"
 	trap node_cleanup_tmpdirs INT TERM EXIT
 
-	# we have also to set the TMP
-
+	# openwrt/lede is checkouted under /download
 	cd $TMPBUILDDIR
 
 	# checkout the repo
@@ -248,8 +268,6 @@ openwrt_build() {
 	# set tz, date, core, ..
 	openwrt_apply_variations $RUN
 
-	# configure openwrt
-	openwrt_config $CONFIG
 	openwrt_build_toolchain
 	# build images and packages
 	openwrt_compile $TYPE $RUN $TARGET
@@ -275,6 +293,11 @@ build_two_times() {
 	TARGET=$2
 	CONFIG=$3
 
+	# 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/
+	rsync -a $TMPDIR/download/ $GENERIC_NODE2:$TMPDIR/download/
+
 	## first run
 	RUN=b1
 	ssh $GENERIC_NODE1 reproducible_$TYPE node openwrt_build $TYPE $RUN $TARGET $CONFIG $TMPDIR

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/qa/jenkins.debian.net.git



More information about the Qa-jenkins-scm mailing list