diff options
Diffstat (limited to 'build-scripts/create-user-build-script')
-rwxr-xr-x | build-scripts/create-user-build-script | 58 |
1 files changed, 40 insertions, 18 deletions
diff --git a/build-scripts/create-user-build-script b/build-scripts/create-user-build-script index ffafe0e..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 @@ -194,6 +214,8 @@ export DEBUG_NO_STRICT_ALIASING=${DEBUG_NO_STRICT_ALIASING} 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 <<EOF @@ -238,7 +260,7 @@ sync_commands() fi cat <<EOF # download the repo tool for android -curl "http://android.git.linaro.org/gitweb?p=tools/repo.git;a=blob_plain;f=repo;hb=refs/heads/stable" > repo +curl "https://android.git.linaro.org/gitweb?p=tools/repo.git;a=blob_plain;f=repo;hb=refs/heads/stable" > repo chmod +x repo # download the android code @@ -248,12 +270,12 @@ if [ \${EXACT} -eq 1 ] ; then $CP_CMD fi # check for linaro private git repositories -PRI=\`grep -i "linaro-private" .repo/manifests/\${MANIFEST_FILENAME} | wc -l\` +PRI=\`grep -i "linaro-private" .repo/manifest.xml | wc -l\` if [ \${PRI} -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 git repositories." - echo "Press "y" to continue (which may result in incomplete build), 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 @@ -263,7 +285,7 @@ if [ \${PRI} -gt 0 -a \${INTERACTIVE} -eq 1 ] ; then usage fi fi - sed -i 's/\/\/.*-bot@/\/\/'"\${LINARO_ANDROID_ACCESS_ID}"'@/' .repo/manifests/\${MANIFEST_FILENAME} + sed -i 's/\/\/.*-bot@/\/\/'"\${LINARO_ANDROID_ACCESS_ID}"'@/' .repo/manifest.xml fi ./repo sync -f -j1 |