summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Couzens <lynxis@fe80.eu>2016-10-12 02:55:50 +0200
committerHolger Levsen <holger@layer-acht.org>2016-10-12 12:36:59 +0200
commitf762aaee8b626310e77f783818c7a5124c6647c3 (patch)
tree08cfedac3723869f28182ea0f360db49e7d369f7
parent0633f7162e06eacecb63664a6fc639ccef198c3a (diff)
downloadjenkins.debian.net-f762aaee8b626310e77f783818c7a5124c6647c3.tar.xz
reproducible_openwrt/lede: add openwrt_download
download all necesarry files before building to fix the future. Signed-off-by: Holger Levsen <holger@layer-acht.org>
-rwxr-xr-xbin/reproducible_lede.sh1
-rwxr-xr-xbin/reproducible_openwrt.sh1
-rw-r--r--bin/reproducible_openwrt_common.sh45
3 files changed, 36 insertions, 11 deletions
diff --git a/bin/reproducible_lede.sh b/bin/reproducible_lede.sh
index 519c8c0c..bccc6d00 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 b3d66750..cf7eedc9 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 77649087..13150400 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