aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYongqin Liu <yongqin.liu@linaro.org>2012-08-14 11:53:18 +0800
committerYongqin Liu <yongqin.liu@linaro.org>2012-08-14 11:53:18 +0800
commit083c746df4da9b31c54a8791855e14f805bfef75 (patch)
tree500968a066db8ddf392b1755d825e36001a32059
parent4e8998eb2a29ee864bc12508459a8253d6a1fd66 (diff)
parentfbfda5beb7449f025eaae6cae8d59898bf215895 (diff)
merge with trunk
-rw-r--r--build-scripts/build-android204
-rw-r--r--build-scripts/helpers13
-rwxr-xr-xbuild-scripts/post-build-lava.py25
-rwxr-xr-xnode/setup-build-android7
-rw-r--r--utils/mangle-jobs/push-artifacts-set.mangle2
5 files changed, 154 insertions, 97 deletions
diff --git a/build-scripts/build-android b/build-scripts/build-android
index c1dde71..34ba592 100644
--- a/build-scripts/build-android
+++ b/build-scripts/build-android
@@ -13,107 +13,123 @@ 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 [ -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 [ -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 .
+# 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
# Store kernel .config as a build artifact
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
+}
diff --git a/build-scripts/post-build-lava.py b/build-scripts/post-build-lava.py
index 2365d4e..9815215 100755
--- a/build-scripts/post-build-lava.py
+++ b/build-scripts/post-build-lava.py
@@ -59,7 +59,17 @@ 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
+ ## 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()
+ if not test:
+ continue
+ test_actions.append(test)
if len(test_actions) > 0:
inst_action = {
@@ -72,9 +82,20 @@ def gen_lava_android_test_actions(tests=[]):
actions.append(inst_action)
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():
+ test_option = test[test.find('(') + 1 : test.rfind(')')]
+ test = test[:test.find('(')].strip()
+
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
diff --git a/node/setup-build-android b/node/setup-build-android
index e135938..d93d7aa 100755
--- a/node/setup-build-android
+++ b/node/setup-build-android
@@ -118,3 +118,10 @@ apt-get-retry install -y \
# x11proto-core-dev \
adduser --system jenkins-build
+
+# Install linaro-image-tools so builds can create complete FS images.
+sudo add-apt-repository ppa:linaro-maintainers/tools
+sudo apt-get update
+sudo apt-get install -y linaro-image-tools
+# Allow 'jenkins-build' user to run linaro-android-media-create via sudo
+echo "jenkins-build ALL = NOPASSWD: /usr/bin/linaro-android-media-create" >>/etc/sudoers
diff --git a/utils/mangle-jobs/push-artifacts-set.mangle b/utils/mangle-jobs/push-artifacts-set.mangle
index 6ff038f..f1a03b6 100644
--- a/utils/mangle-jobs/push-artifacts-set.mangle
+++ b/utils/mangle-jobs/push-artifacts-set.mangle
@@ -1,6 +1,6 @@
# Update list of artifacts to push to snapshots.linaro.org
-new_value = "build/out/target/*/*/*.img," \
+new_value = "build/out/target/*/*/*.img.bz2," \
"build/out/target/*/*/*.tar.bz2," \
"build/out/target/*/*/MD5SUMS," \
"build/out/*.tar.bz2," \