From 94c94318239f7038f98f3d9e3ce61fb7c84ccc0f Mon Sep 17 00:00:00 2001 From: Paul Sokolovsky Date: Wed, 8 Aug 2012 16:48:55 +0300 Subject: Add BUILD_FS_IMAGE bool config option to create FS image. --- build-scripts/build-android | 10 ++++++++++ build-scripts/helpers | 13 +++++++++++++ 2 files changed, 23 insertions(+) (limited to 'build-scripts') diff --git a/build-scripts/build-android b/build-scripts/build-android index c1dde71..29bd674 100644 --- a/build-scripts/build-android +++ b/build-scripts/build-android @@ -116,6 +116,16 @@ if [ -n "$BUILD_SYSROOT" ]; then tar -cj -C /tmp/sysroot -f out/sysroot.tar.bz2 . fi +# Create filesystem images +if [ -n "$BUILD_FS_IMAGE" ]; then + sudo linaro-android-media-create \ + --dev `product2lamc_dev $TARGET_PRODUCT` \ + --system out/target/product/$TARGET_PRODUCT/system.tar.bz2 \ + --userdata out/target/product/$TARGET_PRODUCT/userdata.tar.bz2 \ + --boot out/target/product/$TARGET_PRODUCT/boot.tar.bz2 \ + --image-file out/target/product/$TARGET_PRODUCT/$TARGET_PRODUCT.img +fi + # Store kernel .config as a build artifact if [ -f kernel/.config ]; then cp kernel/.config out/kernel_config diff --git a/build-scripts/helpers b/build-scripts/helpers index 56094e4..6908b26 100644 --- a/build-scripts/helpers +++ b/build-scripts/helpers @@ -145,3 +145,16 @@ infrastructure_error () { # Interpreted as NOT_BUILT by Shell Status plugin exit 123 } + +# Convert Android's TARGET_PRODUCT to linaro-android-media-create --dev option value +product2lamc_dev () { +# Inventory: vexpress,snowball_emmc,mx6qsabrelite,vexpress-a9,panda,iMX53,smdkv310,snowball_sd,beagle,origen,mx53loco + case "$1" in + "pandaboard") + echo -n "panda";; + "snowball") + echo -n "snowball_sd";; + *) + echo -n "$1";; + esac +} -- cgit v1.2.3 From ae394b7b5da615d8436cd978d321125ea59bb7f4 Mon Sep 17 00:00:00 2001 From: Paul Sokolovsky Date: Wed, 8 Aug 2012 16:50:13 +0300 Subject: bzip2 FS image. --- build-scripts/build-android | 1 + 1 file changed, 1 insertion(+) (limited to 'build-scripts') diff --git a/build-scripts/build-android b/build-scripts/build-android index 29bd674..c55df04 100644 --- a/build-scripts/build-android +++ b/build-scripts/build-android @@ -124,6 +124,7 @@ if [ -n "$BUILD_FS_IMAGE" ]; then --userdata out/target/product/$TARGET_PRODUCT/userdata.tar.bz2 \ --boot out/target/product/$TARGET_PRODUCT/boot.tar.bz2 \ --image-file out/target/product/$TARGET_PRODUCT/$TARGET_PRODUCT.img + bzip2 -9 out/target/product/$TARGET_PRODUCT/$TARGET_PRODUCT.img fi # Store kernel .config as a build artifact -- cgit v1.2.3 From 004a4c178733a63407c5c0211df1b7e390c8d528 Mon Sep 17 00:00:00 2001 From: Paul Sokolovsky Date: Thu, 9 Aug 2012 13:28:41 +0300 Subject: Use absolute paths with sudo, trying to workaround "No such file or directory". --- build-scripts/build-android | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'build-scripts') diff --git a/build-scripts/build-android b/build-scripts/build-android index c55df04..b719c76 100644 --- a/build-scripts/build-android +++ b/build-scripts/build-android @@ -118,11 +118,13 @@ fi # Create filesystem images if [ -n "$BUILD_FS_IMAGE" ]; then + pwd + ls -l out/target/product/$TARGET_PRODUCT/system.tar.bz2 sudo linaro-android-media-create \ --dev `product2lamc_dev $TARGET_PRODUCT` \ - --system out/target/product/$TARGET_PRODUCT/system.tar.bz2 \ - --userdata out/target/product/$TARGET_PRODUCT/userdata.tar.bz2 \ - --boot out/target/product/$TARGET_PRODUCT/boot.tar.bz2 \ + --system $PWD/out/target/product/$TARGET_PRODUCT/system.tar.bz2 \ + --userdata $PWD/out/target/product/$TARGET_PRODUCT/userdata.tar.bz2 \ + --boot $PWD/out/target/product/$TARGET_PRODUCT/boot.tar.bz2 \ --image-file out/target/product/$TARGET_PRODUCT/$TARGET_PRODUCT.img bzip2 -9 out/target/product/$TARGET_PRODUCT/$TARGET_PRODUCT.img fi -- cgit v1.2.3 From b7375e74307c54710ae365ca0481f3fa448fc845 Mon Sep 17 00:00:00 2001 From: Paul Sokolovsky Date: Thu, 9 Aug 2012 15:13:41 +0300 Subject: Make BUILD_COPYCAT feature skip "make" phase, but still follow other processing. E.g., filesystem image creation. --- build-scripts/build-android | 195 ++++++++++++++++++++++---------------------- 1 file changed, 99 insertions(+), 96 deletions(-) (limited to 'build-scripts') diff --git a/build-scripts/build-android b/build-scripts/build-android index b719c76..2959faf 100644 --- a/build-scripts/build-android +++ b/build-scripts/build-android @@ -13,107 +13,110 @@ source "${BUILD_SCRIPT_ROOT}"/helpers trap infrastructure_error ERR if [ -n "$BUILD_COPYCAT" ]; then + download_another_build "$BUILD_COPYCAT" - exit $? -fi -if [ -n "$REPO_SEED_URL" ]; then - repo-sync-from-seed "${1}" else - repo-sync-from-mirror "${1}" -fi - -if [ -n "$POST_CHECKOUT_HOOK" ]; then -# if echo "$POST_CHECKOUT_HOOK" | grep -F / >/dev/null; then -# echo "Invalid POST_CHECKOUT_HOOK: $POST_CHECKOUT_HOOK" -# exit 1 -# fi - $BUILD_SCRIPT_ROOT/$POST_CHECKOUT_HOOK -fi - -trap - ERR -. build/envsetup.sh -trap infrastructure_error ERR - -# We evaluate the configuration again because envsetup.sh might well -# have stomped on some of the values in it. - -set -a -eval $CONFIGURATION -set +a - -export JAVA_HOME=/usr/lib/jvm/java-6-sun-1.6.0.22/ -export ANDROID_JAVA_HOME=$JAVA_HOME - -MAKE_TARGETS="${MAKE_TARGETS-boottarball systemtarball userdatatarball}" -calc_make_jobs - -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 - if test -z "$TOOLCHAIN_TRIPLET"; then - # Android 2.x usually needs to be built with arm-eabi, - # Android 4.x usually needs to be built with arm-linux-androideabi... - if echo $MANIFEST_BRANCH |grep -qE 'android.2\.3'; then - p=`find $PWD/toolchain/bin/arm-eabi-gcc 2>/dev/null |head -n1` - else - p=`find $PWD/toolchain/bin/arm-linux-androideabi-gcc 2>/dev/null |head -n1` - fi - [ -z "$p" ] && p=`find $PWD/toolchain/bin/*-gcc |head -n1` - else - p=`find $PWD/toolchain/bin/$TOOLCHAIN_TRIPLET-gcc |head -n1` - fi - export TARGET_TOOLS_PREFIX=`echo $p | sed -e 's/-gcc$/-/'` -fi - -if [ "$TOOLCHAIN_FINGERPRINT" != "0" -a -n "$toolchain_filename" ]; then - mkdir -p fingerprints - cp $toolchain_filename fingerprints/ -fi - -if test -z "$TARGET_ARCH_VARIANT"; then - TARGET_ARCH_VARIANT=armv7-a-neon -fi -if test -z "$WITH_HOST_DALVIK"; then - WITH_HOST_DALVIK=false -fi - -SHOWCOMMANDS= -if test -z "$QUIET" || test "$QUIET" = "0"; then - SHOWCOMMANDS=showcommands -fi - -if [ -n "$SOURCE_OVERLAY" ]; then - unpack_overlays "$SOURCE_OVERLAY" -fi - -if [ -n "$EXTERNAL_TARBALL" ]; then - unpack_external_tarball "$EXTERNAL_TARBALL" -fi - -if [ -x "${TARGET_TOOLS_PREFIX}gcc" ]; then - ${TARGET_TOOLS_PREFIX}gcc -v -fi - -if [ -z "$MAKE" ]; then - MAKE=make -fi - -trap - ERR -time -p $MAKE $MAKE_OPTS -j$MAKE_JOBS $MAKE_TARGETS $SHOWCOMMANDS WITH_HOST_DALVIK="$WITH_HOST_DALVIK" HOST_CC=gcc-4.5 HOST_CXX=g++-4.5 HOST_CPP=cpp-4.5 -trap infrastructure_error ERR -# Show remaining disk space to catch early if -# we're approaching ramdisk limit again -df + if [ -n "$REPO_SEED_URL" ]; then + repo-sync-from-seed "${1}" + else + repo-sync-from-mirror "${1}" + fi + + if [ -n "$POST_CHECKOUT_HOOK" ]; then + # if echo "$POST_CHECKOUT_HOOK" | grep -F / >/dev/null; then + # echo "Invalid POST_CHECKOUT_HOOK: $POST_CHECKOUT_HOOK" + # exit 1 + # fi + $BUILD_SCRIPT_ROOT/$POST_CHECKOUT_HOOK + fi + + trap - ERR + . build/envsetup.sh + trap infrastructure_error ERR + + # We evaluate the configuration again because envsetup.sh might well + # have stomped on some of the values in it. + + set -a + eval $CONFIGURATION + set +a + + export JAVA_HOME=/usr/lib/jvm/java-6-sun-1.6.0.22/ + export ANDROID_JAVA_HOME=$JAVA_HOME + + MAKE_TARGETS="${MAKE_TARGETS-boottarball systemtarball userdatatarball}" + calc_make_jobs + + 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 + if test -z "$TOOLCHAIN_TRIPLET"; then + # Android 2.x usually needs to be built with arm-eabi, + # Android 4.x usually needs to be built with arm-linux-androideabi... + if echo $MANIFEST_BRANCH |grep -qE 'android.2\.3'; then + p=`find $PWD/toolchain/bin/arm-eabi-gcc 2>/dev/null |head -n1` + else + p=`find $PWD/toolchain/bin/arm-linux-androideabi-gcc 2>/dev/null |head -n1` + fi + [ -z "$p" ] && p=`find $PWD/toolchain/bin/*-gcc |head -n1` + else + p=`find $PWD/toolchain/bin/$TOOLCHAIN_TRIPLET-gcc |head -n1` + fi + export TARGET_TOOLS_PREFIX=`echo $p | sed -e 's/-gcc$/-/'` + fi + + if [ "$TOOLCHAIN_FINGERPRINT" != "0" -a -n "$toolchain_filename" ]; then + mkdir -p fingerprints + cp $toolchain_filename fingerprints/ + fi + + if test -z "$TARGET_ARCH_VARIANT"; then + TARGET_ARCH_VARIANT=armv7-a-neon + fi + if test -z "$WITH_HOST_DALVIK"; then + WITH_HOST_DALVIK=false + fi + + SHOWCOMMANDS= + if test -z "$QUIET" || test "$QUIET" = "0"; then + SHOWCOMMANDS=showcommands + fi + + if [ -n "$SOURCE_OVERLAY" ]; then + unpack_overlays "$SOURCE_OVERLAY" + fi + + if [ -n "$EXTERNAL_TARBALL" ]; then + unpack_external_tarball "$EXTERNAL_TARBALL" + fi + + if [ -x "${TARGET_TOOLS_PREFIX}gcc" ]; then + ${TARGET_TOOLS_PREFIX}gcc -v + fi + + if [ -z "$MAKE" ]; then + MAKE=make + fi + + trap - ERR + time -p $MAKE $MAKE_OPTS -j$MAKE_JOBS $MAKE_TARGETS $SHOWCOMMANDS WITH_HOST_DALVIK="$WITH_HOST_DALVIK" HOST_CC=gcc-4.5 HOST_CXX=g++-4.5 HOST_CPP=cpp-4.5 + trap infrastructure_error ERR + + # Show remaining disk space to catch early if + # we're approaching ramdisk limit again + df + + if [ -n "$BUILD_SYSROOT" ]; then + git clone git://git.linaro.org/android/toolchain/build.git toolchain-build + rm -rf /tmp/sysroot + toolchain-build/build-sysroot.sh out/target/product/`ls -1 out/target/product | head -n1` /tmp/sysroot + tar -cj -C /tmp/sysroot -f out/sysroot.tar.bz2 . + fi -if [ -n "$BUILD_SYSROOT" ]; then - git clone git://git.linaro.org/android/toolchain/build.git toolchain-build - rm -rf /tmp/sysroot - toolchain-build/build-sysroot.sh out/target/product/`ls -1 out/target/product | head -n1` /tmp/sysroot - tar -cj -C /tmp/sysroot -f out/sysroot.tar.bz2 . fi # Create filesystem images -- cgit v1.2.3 From 696378e88397b590f38eab760f3ee5580f28d9da Mon Sep 17 00:00:00 2001 From: Paul Sokolovsky Date: Fri, 10 Aug 2012 12:14:30 +0300 Subject: Remove debug output. --- build-scripts/build-android | 2 -- 1 file changed, 2 deletions(-) (limited to 'build-scripts') diff --git a/build-scripts/build-android b/build-scripts/build-android index 2959faf..b2fb9d5 100644 --- a/build-scripts/build-android +++ b/build-scripts/build-android @@ -121,8 +121,6 @@ fi # Create filesystem images if [ -n "$BUILD_FS_IMAGE" ]; then - pwd - ls -l out/target/product/$TARGET_PRODUCT/system.tar.bz2 sudo linaro-android-media-create \ --dev `product2lamc_dev $TARGET_PRODUCT` \ --system $PWD/out/target/product/$TARGET_PRODUCT/system.tar.bz2 \ -- cgit v1.2.3 From 7b03c73849156c6ac2fa6b9147709834f6244db1 Mon Sep 17 00:00:00 2001 From: Paul Sokolovsky Date: Fri, 10 Aug 2012 12:22:56 +0300 Subject: Allow to override FS image size with FS_IMAGE_SIZE var. --- build-scripts/build-android | 2 ++ 1 file changed, 2 insertions(+) (limited to 'build-scripts') diff --git a/build-scripts/build-android b/build-scripts/build-android index b2fb9d5..34ba592 100644 --- a/build-scripts/build-android +++ b/build-scripts/build-android @@ -121,11 +121,13 @@ fi # Create filesystem images if [ -n "$BUILD_FS_IMAGE" ]; then + FS_IMAGE_SIZE=${FS_IMAGE_SIZE-2G} sudo linaro-android-media-create \ --dev `product2lamc_dev $TARGET_PRODUCT` \ --system $PWD/out/target/product/$TARGET_PRODUCT/system.tar.bz2 \ --userdata $PWD/out/target/product/$TARGET_PRODUCT/userdata.tar.bz2 \ --boot $PWD/out/target/product/$TARGET_PRODUCT/boot.tar.bz2 \ + --image-size "$FS_IMAGE_SIZE" \ --image-file out/target/product/$TARGET_PRODUCT/$TARGET_PRODUCT.img bzip2 -9 out/target/product/$TARGET_PRODUCT/$TARGET_PRODUCT.img fi -- cgit v1.2.3 From 89f81c29a47172306471d5380beafdec80ac76ee Mon Sep 17 00:00:00 2001 From: Yongqin Liu Date: Mon, 13 Aug 2012 10:53:30 +0800 Subject: support to run more than two instances of the same test with different option at the same time --- build-scripts/post-build-lava.py | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) (limited to 'build-scripts') diff --git a/build-scripts/post-build-lava.py b/build-scripts/post-build-lava.py index b7acb12..63c3815 100755 --- a/build-scripts/post-build-lava.py +++ b/build-scripts/post-build-lava.py @@ -59,7 +59,16 @@ def gen_lava_android_test_actions(tests=[]): actions = [] if len(tests) == 0: return actions - test_actions = [test for test in tests if test != REBOOT_TOKEN] + test_actions = [] + for test in tests: + if test == REBOOT_TOKEN: + continue + if test.find('(') >= 0\ + and test.rfind(')') > test.find('('): + test = test[:test.find('(')].strip() + if not test: + continue + test_actions.append(test) if len(test_actions) > 0: inst_action = { @@ -72,9 +81,18 @@ def gen_lava_android_test_actions(tests=[]): actions.append(inst_action) for test in tests: + + test_option = '' + if test.find('(') >= 0 and test.rfind(')') > test.find('(') \ + and test[:test.find('(')].strip(): + test = test[:test.find('(')].strip() + test_option = test[test.find('(') + 1 : test.rfind(')')] + parameters = {'test_name': test} - test_option = os.environ.get('%s%s' % (test.upper(), OPTION_SUFFIX)) + if not test_option: + test_option = os.environ.get('%s%s' % (test.upper(), OPTION_SUFFIX)) + if test_option: parameters['option'] = test_option -- cgit v1.2.3 From 2555919e1044e6b1d396fef99da8415fb06cb5d0 Mon Sep 17 00:00:00 2001 From: Yongqin Liu Date: Mon, 13 Aug 2012 11:20:19 +0800 Subject: fix the problem that generate wrong option for test --- build-scripts/post-build-lava.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'build-scripts') diff --git a/build-scripts/post-build-lava.py b/build-scripts/post-build-lava.py index 63c3815..bf09de1 100755 --- a/build-scripts/post-build-lava.py +++ b/build-scripts/post-build-lava.py @@ -85,8 +85,8 @@ def gen_lava_android_test_actions(tests=[]): test_option = '' if test.find('(') >= 0 and test.rfind(')') > test.find('(') \ and test[:test.find('(')].strip(): - test = test[:test.find('(')].strip() test_option = test[test.find('(') + 1 : test.rfind(')')] + test = test[:test.find('(')].strip() parameters = {'test_name': test} -- cgit v1.2.3 From 269294e9ab7bcb2ccab1fa25a960e6218b090028 Mon Sep 17 00:00:00 2001 From: Yongqin Liu Date: Mon, 13 Aug 2012 13:32:23 +0800 Subject: add some comment --- build-scripts/post-build-lava.py | 3 +++ 1 file changed, 3 insertions(+) (limited to 'build-scripts') diff --git a/build-scripts/post-build-lava.py b/build-scripts/post-build-lava.py index bf09de1..972088f 100755 --- a/build-scripts/post-build-lava.py +++ b/build-scripts/post-build-lava.py @@ -63,6 +63,7 @@ def gen_lava_android_test_actions(tests=[]): for test in tests: if test == REBOOT_TOKEN: continue + ## support for test that specified with option like methanol,methanol(DEFAULT) if test.find('(') >= 0\ and test.rfind(')') > test.find('('): test = test[:test.find('(')].strip() @@ -82,6 +83,8 @@ def gen_lava_android_test_actions(tests=[]): for test in tests: + ## support for test that specified with option like methanol,methanol(DEFAULT) + ## for this case, get the option from the test test_option = '' if test.find('(') >= 0 and test.rfind(')') > test.find('(') \ and test[:test.find('(')].strip(): -- cgit v1.2.3