diff options
author | Axel Fagerstedt <axel.fagerstedt@linaro.org> | 2013-04-17 19:37:40 +0200 |
---|---|---|
committer | Axel Fagerstedt <axel.fagerstedt@linaro.org> | 2013-04-17 19:37:40 +0200 |
commit | 9e27b494c7cc7151392b990e03285fa52c371ee8 (patch) | |
tree | 0bd06b2b357cf94acfe66813cfd184cfbe7d943a /build-scripts/build-android-testsuite-restricted | |
parent | 63a2d6a20c0b3c0e9d70303b8481f0362a6f3a75 (diff) |
Rename buildtype to build-android-testsuite-restricted
Diffstat (limited to 'build-scripts/build-android-testsuite-restricted')
-rw-r--r-- | build-scripts/build-android-testsuite-restricted | 95 |
1 files changed, 95 insertions, 0 deletions
diff --git a/build-scripts/build-android-testsuite-restricted b/build-scripts/build-android-testsuite-restricted new file mode 100644 index 0000000..9bc4a8f --- /dev/null +++ b/build-scripts/build-android-testsuite-restricted @@ -0,0 +1,95 @@ +############################################################################### +# Copyright (c) 2013 Linaro +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Eclipse Public License v1.0 +# which accompanies this distribution, and is available at +# http://www.eclipse.org/legal/epl-v10.html +############################################################################### + +export GIT_SSH=/var/run/lava/ssh + +source "${BUILD_SCRIPT_ROOT}"/helpers + +trap infrastructure_error ERR + +# get the source +if [ -n "$REPO_SEED_URL" ]; then + repo-sync-from-seed "${1}" +else + repo-sync-from-mirror "${1}" +fi + +# get toolchain +if test -n "$TOOLCHAIN_URL"; then + wget -nv --no-check-certificate $TOOLCHAIN_URL + toolchain_filename=`echo $TOOLCHAIN_URL | sed -e 's/.*\/\([^/]*\)$/\1/'` + mkdir toolchain + tar -C toolchain --strip-components 1 -xf $toolchain_filename + rm -rf $toolchain_filename + export PATH=`pwd`/toolchain/bin:$PATH + if test -z "$TOOLCHAIN_TRIPLET"; then + #assume arm-linux-gnueabihf- + echo "WARNING: assuming arm.linux-gnueabihf toolchain" + CROSS_COMPILE="CROSS_COMPILE=arm-linux-gnueabihf-" + else + CROSS_COMPILE="CROSS_COMPILE=$TOOLCHAIN_TRIPLET" + fi +else + echo "ERROR: TOOLCHAIN_URL is not optional." + exit 1 +fi + +# build the tests +trap - ERR +if test -e "build/Makefile"; then + make $CROSS_COMPILE -C build/ build + make $CROSS_COMPILE -C build/ install +else + echo "ERROR: Could not locate build tools, expecting a Makefile in build/ with targets build and install" + exit 1 +fi + +trap infrastructure_error ERR + +# Combine output with prebuilt android images +if test -n "$ANDROID_PREBUILT_URL"; then + #get prebuilt android + wget -nv --no-check-certificate $ANDROID_PREBUILT_URL/boot.tar.bz2 + wget -nv --no-check-certificate $ANDROID_PREBUILT_URL/system.tar.bz2 + wget -nv --no-check-certificate $ANDROID_PREBUILT_URL/userdata.tar.bz2 + + # move thw boot tarball + mv boot.tar.bz2 out/. + + # we are assuming that the makefile has given us a out/ structure + # containing data/ and system/ with the test files + + # uncompress the archives so we can update them + bunzip2 --keep userdata.tar.bz2 + bunzip2 --keep system.tar.bz2 + mv userdata.tar out/. + mv system.tar out/. + + # update the archives with the tests + cd out + tar -uvpf userdata.tar data + tar -uvpf system.tar system + + # compress them again + bzip2 userdata.tar + bzip2 system.tar + + # create tarballs with just the tests + tar -pcjf tests_userdata.tar.bz2 data + tar -pcjf tests_system.tar.bz2 system + + #clean up + rm -rf data + rm -rf system + cd .. + rm -rf system.tar.bz2 + rm -rf userdata.tar.bz2 +else + echo "ERROR: Could not locate prebuilt android image, please set ANDROID_PREBUILT_URL" +fi + |