From afaa481f4762ea5b1216923a3eba969d6718f7cc Mon Sep 17 00:00:00 2001 From: Amit Pundir Date: Tue, 24 Jun 2014 09:30:21 +0530 Subject: update linaro-android-build-cmd.sh 1) Fix pinned manifest builds for restricted builds For restricted builds, we update .repo/manifests/$MANIFEST_FILENAME for correct username to pull from private repos. This worked well for tip manifest builds but for pinned manifest builds it did't because we copy pinned manifest as .repo/manifest.xml. This change update .repo/manifest.xml with correct username. It will work for tip manifests as well since .repo/manifest.xml is a symlink to .repo/manifests/$MANIFEST_FILENAME 2) Add Ubuntu 13.10 and 14.04 support. Verified on Ubuntu 13.10 and 14.04 chroot environment. 3) Prompt for OpenJDK v1.7 installation for AOSP master builds 4) Pick system login as default login to access private manifests instead of using a login bot 5) Make tip build a default build. i.e. "./linaro_android_build_cmds.sh" run will give us a tip build. Change-Id: I04b2b2420617dd8aa427142fbaca1276e2505f0c Signed-off-by: Amit Pundir --- build-scripts/create-user-build-script | 55 +++++++++++++++++++++++----------- 1 file changed, 38 insertions(+), 17 deletions(-) diff --git a/build-scripts/create-user-build-script b/build-scripts/create-user-build-script index db9b66b..c7d5b04 100755 --- a/build-scripts/create-user-build-script +++ b/build-scripts/create-user-build-script @@ -30,11 +30,11 @@ header() set -e -EXACT=1 +EXACT=0 INTERACTIVE=1 DIR=android if [ -z "\${LINARO_ANDROID_ACCESS_ID}" ] ; then - LINARO_ANDROID_ACCESS_ID=default-bot + LINARO_ANDROID_ACCESS_ID=\${USER} fi SOURCE_OVERLAY_OPTIONAL=1 @@ -50,6 +50,7 @@ usage() echo " If in doubt, please contact Linaro Android mailing list for details" echo " Default: \${LINARO_ANDROID_ACCESS_ID}" echo " -y Assume answer 'YES' for all questions. Non-interactive mode. Requires -l" + echo " -h Will show this message." exit 1 } @@ -61,26 +62,30 @@ while getopts "${USAGE_OPTOVERLAY}d:l:hty" optn; do t ) EXACT=0;; y ) INTERACTIVE=0;; h ) usage; exit 1;; + \? ) usage; exit 1;; esac done -if [ "\${LINARO_ANDROID_ACCESS_ID}" == "default-bot" -a \${INTERACTIVE} -eq 0 ] ; then - usage -fi - UBUNTU=\`cat /etc/issue.net | cut -d' ' -f2\` HOST_ARCH=\`uname -m\` if [ \${HOST_ARCH} == "x86_64" ] ; then - PKGS='gnupg flex bison gperf build-essential zip curl zlib1g-dev libc6-dev lib32ncurses5-dev x11proto-core-dev libx11-dev lib32z1-dev libgl1-mesa-dev g++-multilib mingw32 tofrodos python-markdown libxml2-utils xsltproc uboot-mkimage openjdk-6-jdk openjdk-6-jre vim-common python-parted python-yaml wget uuid-dev acpica-tools' + PKGS='gnupg flex bison gperf build-essential zip curl zlib1g-dev libc6-dev lib32ncurses5-dev x11proto-core-dev libx11-dev lib32z1-dev libgl1-mesa-dev g++-multilib mingw32 tofrodos python-markdown libxml2-utils xsltproc vim-common python-parted python-yaml wget uuid-dev' else echo "ERROR: Only 64bit Host(Build) machines are supported at the moment." exit 1 fi -if [[ \${UBUNTU} =~ "13." || \${UBUNTU} =~ "12.10" ]]; then +if [[ \${UBUNTU} =~ "14.04" || \${UBUNTU} =~ "13." || \${UBUNTU} =~ "12.10" ]]; then #Install basic dev package missing in chrooted environments sudo apt-get install software-properties-common sudo dpkg --add-architecture i386 PKGS+=' libstdc++6:i386 git-core' + if [[ \${UBUNTU} =~ "14.04" ]]; then + PKGS+=' u-boot-tools bc acpica-tools' + elif [[ \${UBUNTU} =~ "13.10" ]]; then + PKGS+=' u-boot-tools bc iasl' + else + PKGS+=' uboot-mkimage acpica-tools' + fi elif [[ \${UBUNTU} =~ "12.04" || \${UBUNTU} =~ "10.04" ]] ; then #Install basic dev package missing in chrooted environments sudo apt-get install python-software-properties @@ -90,7 +95,7 @@ elif [[ \${UBUNTU} =~ "12.04" || \${UBUNTU} =~ "10.04" ]] ; then PKGS+=' ia32-libs libssl-dev libcurl4-gnutls-dev libexpat1-dev gettext' fi else - echo "ERROR: Only Ubuntu 10.04, 12.* and 13.04 versions are supported." + echo "ERROR: Only Ubuntu 10.04, 12.*, 13.* and 14.04 versions are supported." exit 1 fi @@ -100,6 +105,21 @@ sudo add-apt-repository "deb http://archive.ubuntu.com/ubuntu \$(lsb_release -sc sudo add-apt-repository ppa:linaro-maintainers/tools sudo apt-get update echo +echo "Install OpenJDK v1.7?" +echo "*** If you are building AOSP master based builds then you should install OpenJDK v1.7. ***" +echo "*** But if you are building Android 4.4.4 or earlier Android releases then OpenJDK v1.6 is OK to use. ***" +echo "Press "y" to install OpenJDK v1.7, OR" +echo "Press "n" to install OpenJDK v1.6, OR" +echo "Press any other key to continue with the existing JDK installation." +read JDK +if [ \${JDK} == y ] ; then + PKGS+=' openjdk-7-jdk openjdk-7-jre' +elif [ \${JDK} == n ] ; then + PKGS+=' openjdk-6-jdk openjdk-6-jre' +else + echo "Continue with the existing JDK installation .." +fi +echo echo "Installing missing dependencies if any..." if [ \$INTERACTIVE -eq 1 ] ; then sudo apt-get install \${PKGS} @@ -159,10 +179,10 @@ jenkins_configs_method() # check for linaro private manifests PM=\`echo ${MANIFEST_REPO} | grep -i "linaro-private" | wc -l\` if [ \${PM} -gt 0 -a \${INTERACTIVE} -eq 1 ] ; then - if [ "\${LINARO_ANDROID_ACCESS_ID}" == "default-bot" ] ; then + if [ "\${LINARO_ANDROID_ACCESS_ID}" == "\${USER}" ] ; then echo "You must specify valid login/access-id to clone from linaro-private manifest repositories." - echo "Press "y" to continue (which may result in incomplete build or failure), OR" - echo "Press "n" to enter login details, OR" + echo "Press "y" to continue with login: \${USER}, OR" + echo "Press "n" to enter new login details, OR" echo "Press "h" for help." read NEXT if [ \${NEXT} == n ] ; then @@ -195,6 +215,7 @@ export DEBUG_NO_STDCXX11=${DEBUG_NO_STDCXX11} export TOOLCHAIN_TRIPLET=${TOOLCHAIN_TRIPLET} export ANDROID_64=${ANDROID_64} export WITH_HOST_DALVIK=${WITH_HOST_DALVIK} +export USE_LINARO_TOOLCHAIN=${USE_LINARO_TOOLCHAIN} EOF if [ -n "$TOOLCHAIN_URL" ] ; then cat <