#!/bin/bash ############################################################################### # Copyright (c) 2011 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 ############################################################################### set -xe # Stubborn apt-get, retrying on errors apt-get-retry () { local fatal="yes"; if [ "$1" == "--non-fatal" ]; then fatal="" shift fi local delay=1; while [ $delay -lt 100 ]; do if apt-get "$@"; then return fi echo "apt-get failed, sleeping ${delay}s before retrying" sleep $delay delay=$((delay * 2)) done if [ -n "$fatal" ]; then echo "apt-get failed after several attempts, aborting" exit 1 fi } # get latest repo script and install it in PATH #wget http://android.git.kernel.org/repo # Use our mirror of repo wget -nv --no-check-certificate 'http://android.git.linaro.org/gitweb?p=tools/repo.git;a=blob_plain;f=repo;hb=refs/heads/stable' -O repo mv repo /usr/local/bin/repo chmod a+x /usr/local/bin/repo sed -i.bk 's,^\(.*://[^.]*.ec2.archive.ubuntu.com\)/,\1.s3.amazonaws.com/,' /etc/apt/sources.list apt-get-retry --non-fatal update # We do update as part of early node init (to get this script actually) #apt-get update # add feature to allow add-apt-repository apt-get-retry install -y python-software-properties unixodbc java-common # enable partner repo for sun-java6 ##add-apt-repository "deb http://archive.canonical.com/ubuntu maverick partner" ##apt-get update wget -nv --no-check-certificate http://android-build.linaro.org/seed/sun-java6-bin_6.26-2natty1_amd64.deb \ http://android-build.linaro.org/seed/sun-java6-jdk_6.26-2natty1_amd64.deb \ http://android-build.linaro.org/seed/sun-java6-jre_6.26-2natty1_all.deb export DEBIAN_FRONTEND=noninteractive ##apt-get install -y sun-java6-jdk || (debconf 'echo SET shared/accepted-sun-dlj-v1-1 true' || true; apt-get install -f -y; apt-get install -y sun-java6-jdk) dpkg -i sun-java6-* || (debconf 'echo SET shared/accepted-sun-dlj-v1-1 true' || true; apt-get install -f -y; dpkg -i sun-java6-*) # set java-6-sun as default update-java-alternatives -s java-6-sun || true # Install basic development packages # Do not install toolchains and other variable stuff here apt-get-retry install -y \ zip \ curl \ texinfo \ flex \ bison \ build-essential \ autoconf \ automake \ libtool \ git-core # install base stuff for android apt-get-retry install -y \ gnupg \ gperf \ zlib1g-dev \ libx11-dev \ x11proto-core-dev \ gcc-multilib \ g++-multilib \ libc6-dev-i386 \ lib32ncurses5-dev \ ia32-libs \ lib32readline-gplv2-dev \ lib32z-dev \ gcc-4.5 \ g++-4.5 \ cpp-4.5 \ gcc-4.5-multilib \ g++-4.5-multilib \ gcc-4.4 \ g++-4.4 \ cpp-4.4 \ gcc-4.4-multilib \ g++-4.4-multilib \ gcc-arm-linux-gnueabi \ gcc-4.5-arm-linux-gnueabi \ uboot-mkimage \ uuid-dev \ lzop \ libxml2-utils \ subversion \ libmpfr-dev # uuid-dev, acpica-tools are UEFI bootloader requirement # Retired # lib32readline5-dev \ # gitg \ # qt3-dev-tools \ # libqt3-mt-dev \ # eclipse \ # valgrind \ # libx11-dev \ # 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 # Install recent version of iasl/acpica-tools from linaro-maintainers ppa. sudo apt-get install -y acpica-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