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 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 @@ - - + + - - - + + + - - - - + + + + - + 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