From 0330c329d29c020790f34cb3c0743b37dc43fc83 Mon Sep 17 00:00:00 2001 From: Oliver Grawert Date: Thu, 28 Mar 2013 16:32:16 +0100 Subject: [PATCH] add android image cross building for Ubuntu Touch --- BuildLiveCD | 5 ++++- debian/changelog | 8 ++++++++ debian/install | 2 +- ubuntu-touch-android.sh | 33 +++++++++++++++++++++++++++++++++ 4 files changed, 46 insertions(+), 2 deletions(-) create mode 100755 ubuntu-touch-android.sh diff --git a/BuildLiveCD b/BuildLiveCD index 2024e32f..2f3063db 100755 --- a/BuildLiveCD +++ b/BuildLiveCD @@ -35,7 +35,7 @@ IMAGEFORMAT="" LIVE_BUILD=false UBUNTU_DEFAULTS_LOCALE="" -while getopts :A:s:r:d:f:pa:lu: name; do case $name in +while getopts :A:s:r:d:f:pa:lu:t: name; do case $name in A) ARCH="$OPTARG";; s) SUBARCH="$OPTARG";; r) SUBPROJECT="$OPTARG";; @@ -45,6 +45,7 @@ while getopts :A:s:r:d:f:pa:lu: name; do case $name in a) APT_SOURCE="-A $OPTARG";; l) LIVE_BUILD=:;; u) UBUNTU_DEFAULTS_LOCALE="$OPTARG";; + t) UBUNTU_TOUCH_ANDROID="$OPTARG";; esac; done; shift $((OPTIND-1)) @@ -142,6 +143,8 @@ for STE in $SUITES; do COMMAND="PROJECT=${FS} SUBPROJECT=${SUBPROJECT} ARCH=${ARCH} SUBARCH=${SUBARCH} lb build" elif [ "$UBUNTU_DEFAULTS_LOCALE" ]; then COMMAND="ubuntu-defaults-image --locale ${UBUNTU_DEFAULTS_LOCALE} --arch ${ARCH} --release ${STE}" + elif [ "$UBUNTU_TOUCH_ANDROID" ]; then + COMMAND="/usr/sbin/ubuntu-touch-android.sh ${SUBARCH}" else COMMAND="/usr/sbin/livecd.sh ${SUBARCHARG} ${APT_SOURCE} ${PROPOSED} -d${STE} ${IMAGEFORMAT:+-f$IMAGEFORMAT} ${ARCHARG} ${IMAGEARG} ${FS}" fi diff --git a/debian/changelog b/debian/changelog index 5148da4d..d74d61ed 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,11 @@ +livecd-rootfs (2.116) UNRELEASED; urgency=low + + * add new arg (-t) to enable Ubuntu Touch android cross builds which calls a + newly added script (ubuntu-touch-android.sh) to cross build android base + images for Ubuntu Touch on an amd64 builder. + + -- Oliver Grawert Thu, 28 Mar 2013 16:02:12 +0100 + livecd-rootfs (2.115) raring; urgency=low * live-build/auto/config: Run the ubuntukylin-default-settings chroot diff --git a/debian/install b/debian/install index c12d1e96..5ead3ed9 100644 --- a/debian/install +++ b/debian/install @@ -1,2 +1,2 @@ -livecd.sh e2fs-zero.py usr/sbin +livecd.sh e2fs-zero.py ubuntu-touch-android.sh usr/sbin live-build usr/share/livecd-rootfs diff --git a/ubuntu-touch-android.sh b/ubuntu-touch-android.sh new file mode 100755 index 00000000..0c0d83cb --- /dev/null +++ b/ubuntu-touch-android.sh @@ -0,0 +1,33 @@ +!#/bin/sh + +set -e + +codename=$1 +builddir=$codename-build + +[ "$(dpkg --print-architecture)" = "amd64" ] || exit 1 + +# set up multiarch +dpkg --print-foreign-architectures | grep -q i386 || dpkg --add-architecture i386 +apt-get update + +# add cross build env including the needed i386 packages +apt-get -y install git gnupg flex bison gperf build-essential \ + zip bzr curl libc6-dev libncurses5-dev:i386 x11proto-core-dev \ + libx11-dev:i386 libreadline6-dev:i386 libgl1-mesa-glx:i386 \ + libgl1-mesa-dev g++-multilib mingw32 tofrodos phablet-tools \ + python-markdown libxml2-utils xsltproc zlib1g-dev:i386 schedtool \ + openjdk-6-jdk + +# get the git tree +phablet-dev-bootstrap -v $codename $builddir + +cd $builddir +repo sync + +. build/envsetup.sh +brunch $codename + +cd - +cp $builddir/out/target/product/$codename/*-$codename.zip . +rm -rf $buildir