From 66fd6be793815301bf00681e50aba318c9e7e0de Mon Sep 17 00:00:00 2001 From: JoeyJiao Date: Sun, 31 Mar 2013 19:56:05 -0700 Subject: [PATCH 1/4] Enable phablet manifest Signed-off-by: JoeyJiao --- local_manifest.xml | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/local_manifest.xml b/local_manifest.xml index 04b75c8..3713ba5 100644 --- a/local_manifest.xml +++ b/local_manifest.xml @@ -2,19 +2,19 @@ - - + + - - - + + + - - - - + + + + - + From 2ff0ba7696d3c38a127f72b4a3c30a66869329a9 Mon Sep 17 00:00:00 2001 From: JoeyJiao Date: Sun, 31 Mar 2013 20:02:11 -0700 Subject: [PATCH 2/4] Init README for phablet Signed-off-by: JoeyJiao --- README.mkdn | 25 ++++++++----------------- 1 file changed, 8 insertions(+), 17 deletions(-) diff --git a/README.mkdn b/README.mkdn index dff151b..5a5dc6f 100644 --- a/README.mkdn +++ b/README.mkdn @@ -1,4 +1,4 @@ -Local manifest addon for building CM-10.1 (4.2.1_r1) for Kindle Fires +Local manifest addon for building phablet (CM-10.1 4.2.1_r1) for Kindle Fires Getting Started --------------- @@ -9,33 +9,24 @@ Also get and be familiar with [Git and Repo](http://source.android.com/download/ Make a build directory: - mkdir Andoid (or whatever name you choose) - cd Android (or the name you chose) - + mkdir ~/Andoid (or whatever name you choose) -To initialize your local repository using the CyanogenMod manifest, use commands like these: +To initialize your local repository using the phablet, use commands like these (refer to https://wiki.ubuntu.com/Touch/Building): - repo init -u git://github.com/CyanogenMod/android.git -b cm-10.1 + phablet-dev-bootstrap ~/Android - curl -L -o .repo/local_manifest.xml -O -L https://raw.github.com/KFire-Android/android_local_manifest/cm-10.1/local_manifest.xml - - ( or Download: https://github.com/KFire-Android/android_local_manifest/blob/cm-10.1/local_manifest.xml - and place it in ~/Android/.repo/local_manifest.xml (or ~/'name you chose'/.repo) + curl -L -o .repo/local_manifest.xml -O -L https://raw.github.com/JoeyJiao/android_local_manifest/phablet/local_manifest.xml Then to sync up: - repo sync - -Need to pull down the prebuilt add-ons for CM: - - vendor/cm/get-prebuilts + repo sync -j4 And finally to build the CM ROM: . build/envsetup.sh (for 1st gen Kindle Fire:) brunch otter (for 2nd gen Kindle Fire:) brunch otter2 - (for Kindle Fire HD 8.9:) brunch jem + (for Kindle Fire HD 8.9:) brunch jem -j4 -Look for out/target/product//cm-10.1--UNOFFICIAL-.zip +Look for out/target/product//phablet--.zip From 323015e8ba6a31566490c95610ea1b715bee0cb2 Mon Sep 17 00:00:00 2001 From: JoeyJiao Date: Tue, 2 Apr 2013 19:25:10 -0700 Subject: [PATCH 3/4] Add build script to ubuntu phablet Signed-off-by: JoeyJiao --- build-phablet.sh | 64 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100755 build-phablet.sh diff --git a/build-phablet.sh b/build-phablet.sh new file mode 100755 index 0000000..b24c227 --- /dev/null +++ b/build-phablet.sh @@ -0,0 +1,64 @@ +#!/bin/bash +function quit(){ + local ret=$? + if [ "$ret" != "0" ]; then + echo "[ERROR] ret=$ret" + shift + echo $@ + exit $ret + fi +} + +function check_enviroment(){ + PACKAGES="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 python-markdown libxml2-utils xsltproc zlib1g-dev:i386 schedtool" + for package in ${PACKAGES}; do + dpkg -l | grep ${package} > /dev/null + quit $? + done +} + +function main(){ + BUILD_DIR=~/phablet + LOG=${BUILD_DIR}/log.log + + if [ "$#" == "1" ]; then + TARGET=$1 + else + TARGET=jem + fi + + echo "Check git config" + git config --get user.name > /dev/null + quit $? "Not set user.name in gitconfig" + git config --get user.email > /dev/null + quit $? "Not set user.email in gitconfig" + + echo "Check build enviroment" + #check_enviroment + + echo "Init phablet" + mkdir -p ${BUILD_DIR}/.repo + [ -d "${BUILD_DIR}/../phablet_projects" ] && mv ${BUILD_DIR}/../phablet_projects ${BUILD_DIR}/.repo/ + CPUCORES=$(grep processor /proc/cpuinfo | wc -l) + if [ "${CPUCORES}" -ge "8" ]; then + JOBS=8 + else + JOBS=${CPUCORES} + fi + phablet-dev-bootstrap ${BUILD_DIR} -j${JOBS} -c + quit $? + + echo "Init customized manifest" + cd ${BUILD_DIR} + curl -L -o .repo/local_manifest.xml -O -L https://raw.github.com/JoeyJiao/android_local_manifest/phablet/local_manifest.xml + quit $? + repo sync -j${JOBS} + quit $? + + echo "Start build" + . build/envsetup.sh + rm -rf log.log && time brunch ${TARGET} -j${CPUCORES} 2>&1 | tee -a log.log + [ -d "${BUILD_DIR}/.repo/projects" ] && mv ${BUILD_DIR}/.repo/projects ${BUILD_DIR}/../phablet_projects/ +} + +main $@ From dde05b5fe150498e903e02bac49715b20c86e2ab Mon Sep 17 00:00:00 2001 From: JoeyJiao Date: Sat, 6 Apr 2013 10:02:35 -0700 Subject: [PATCH 4/4] Use build script from lp:livecd-rootfs --- build-phablet.sh | 64 --------------------------- ubuntu-touch-android.sh | 95 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 95 insertions(+), 64 deletions(-) delete mode 100755 build-phablet.sh create mode 100755 ubuntu-touch-android.sh diff --git a/build-phablet.sh b/build-phablet.sh deleted file mode 100755 index b24c227..0000000 --- a/build-phablet.sh +++ /dev/null @@ -1,64 +0,0 @@ -#!/bin/bash -function quit(){ - local ret=$? - if [ "$ret" != "0" ]; then - echo "[ERROR] ret=$ret" - shift - echo $@ - exit $ret - fi -} - -function check_enviroment(){ - PACKAGES="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 python-markdown libxml2-utils xsltproc zlib1g-dev:i386 schedtool" - for package in ${PACKAGES}; do - dpkg -l | grep ${package} > /dev/null - quit $? - done -} - -function main(){ - BUILD_DIR=~/phablet - LOG=${BUILD_DIR}/log.log - - if [ "$#" == "1" ]; then - TARGET=$1 - else - TARGET=jem - fi - - echo "Check git config" - git config --get user.name > /dev/null - quit $? "Not set user.name in gitconfig" - git config --get user.email > /dev/null - quit $? "Not set user.email in gitconfig" - - echo "Check build enviroment" - #check_enviroment - - echo "Init phablet" - mkdir -p ${BUILD_DIR}/.repo - [ -d "${BUILD_DIR}/../phablet_projects" ] && mv ${BUILD_DIR}/../phablet_projects ${BUILD_DIR}/.repo/ - CPUCORES=$(grep processor /proc/cpuinfo | wc -l) - if [ "${CPUCORES}" -ge "8" ]; then - JOBS=8 - else - JOBS=${CPUCORES} - fi - phablet-dev-bootstrap ${BUILD_DIR} -j${JOBS} -c - quit $? - - echo "Init customized manifest" - cd ${BUILD_DIR} - curl -L -o .repo/local_manifest.xml -O -L https://raw.github.com/JoeyJiao/android_local_manifest/phablet/local_manifest.xml - quit $? - repo sync -j${JOBS} - quit $? - - echo "Start build" - . build/envsetup.sh - rm -rf log.log && time brunch ${TARGET} -j${CPUCORES} 2>&1 | tee -a log.log - [ -d "${BUILD_DIR}/.repo/projects" ] && mv ${BUILD_DIR}/.repo/projects ${BUILD_DIR}/../phablet_projects/ -} - -main $@ diff --git a/ubuntu-touch-android.sh b/ubuntu-touch-android.sh new file mode 100755 index 0000000..c4f6161 --- /dev/null +++ b/ubuntu-touch-android.sh @@ -0,0 +1,95 @@ +#!/bin/bash + +usage(){ + cat < [-v VENDORS] [-h] [-j JOBS] [-p BUILD_JOBS] [-c] [-r REFERENCE] + +Phablet build script + +Required arguments: + -d DEVICE Target device to build + +Optional arguments: + -v VENDORS Comma separated list of devices to Setup such as + maguro, manta, mako, grouper + -h HELP Show this help message and exit + -j JOBS Amount of sync jobs + -c CONTINUE Continue a previously started sync + -r REFERENCE Use another dev enviroment as reference for git + -l LOCAL_MANIFEST Local manifest address + -p BUILD_JOBS Amount of build jobs + +EOF + exit 1 +} + +JOBS="" +CONTINUE=0 +REFERENCE="" +LOCAL_MANIFEST="" +BUILD_JOBS=$(grep processor /proc/cpuinfo | wc -l) + +while getopts hd:v:j:cr:l:p: opt; do + case $opt in + h) usage;; + d) DEVICE=$OPTARG;; + v) VENDORS=$OPTARG;; + j) JOBS=$OPTARG;; + c) CONTINUE=1;; + r) REFERENCE=$OPTARG;; + l) LOCAL_MANIFEST=$OPTARG;; + p) BUILD_JOBS=$OPTARG;; + *) usage;; + esac +done + +[ "$DEVICE" == "" ] && usage + +# check if is root +if [ "$(id -u)" == "0" ]; then + SUDO="" +else + SUDO="sudo" +fi + +builddir=phablet-build-$DEVICE + +[ "$(dpkg --print-architecture)" == "amd64" ] || exit 1 + +# set up multiarch +dpkg --print-foreign-architectures | grep -q i386 || dpkg --add-architecture i386 +$SUDO apt-get update + +# add cross build env including the needed i386 packages +$SUDO 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 +[ "$VENDORS" == "" ] || ARGS=" -v $VENDORS" +[ "$JOBS" == "" ] || ARGS="$ARGS -j $JOBS" +[ "$CONTINUE" == "0" ] || ARGS="$ARGS -c" +[ "$REFERENCE" == "" ] || ARGS="$ARGS -r $REFERENCE" +phablet-dev-bootstrap $ARGS $builddir + +cd $builddir +repo forall -c 'git reset --hard && git clean -xdf' + +# get local manifest +[ "$LOCAL_MANIFEST" == "" ] || curl -L -o .repo/local_manifest.xml -O -L $LOCAL_MANIFEST + +[ "$JOBS" == "" ] || JOBS=" -j $JOBS" +repo sync $JOBS + +. build/envsetup.sh +brunch $DEVICE -j $BUILD_JOBS + +cd - +cp $builddir/out/target/product/$DEVICE/*-*$DEVICE.zip ./livecd.ubuntu-touch-$DEVICE.zip +for image in system recovery boot; do + cp $builddir/out/target/product/$DEVICE/$image.img ./livecd.ubuntu-touch-$DEVICE.$image.img +done +#rm -rf $builddir