yashsingh1/xdaforums huggingface dataset:
[Nexus 7 Android Development] azoller1:
Re: [HOWTO] Build CM10.1 for Nexus 7

OK now my ROM wont build with brunch grouper, what java jdk version do I need? It doesnt give a zip output file but the process still takes an hour long to go through building it
[Nexus 7 Android Development] .torrented:
what is the final output at the end?
[Nexus 7 Android Development] azoller1:
Re: [HOWTO] Build CM10.1 for Nexus 7

I forgot it said like "finishing unfinished jobs..." then it finished
[Nexus 7 Android Development] underwaterjr:
Re: [HOWTO] Build CM10.1 for Nexus 7

Did it build?
[Nexus 7 Android Development] azoller1:
Re: [HOWTO] Build CM10.1 for Nexus 7

Nope got no zip package
[Nexus 7 Android Development] underwaterjr:
Re: [HOWTO] Build CM10.1 for Nexus 7

I will post or pm you my exact steps tomorrow, wiped tonight.
[Nexus 7 Android Development] azoller1:
Re: [HOWTO] Build CM10.1 for Nexus 7

Thanks
[Nexus 7 Android Development] underwaterjr:
Ok so get the correct java installed i wanted to completely remove all existing java from my machine. So I followed this.

Remove all the Java related packages (Sun, Oracle, OpenJDK, IcedTea plugins, GIJ):

sudo apt-get update
apt-cache search java | awk '{print($1)}' | grep -E -e '^(ia32-)?(sun|oracle)-java' -e '^openjdk-' -e '^icedtea' -e '^(default|gcj)-j(re|dk)' -e '^gcj-(.*)-j(re|dk)' -e 'java-common' | xargs sudo apt-get -y remove
sudo apt-get -y autoremove

Purge config files:

dpkg -l | grep ^rc | awk '{print($2)}' | xargs sudo apt-get -y purge

Remove Java config and cache directory:

sudo bash -c 'ls -d /home/*/.java' | xargs sudo rm -rf

Remove manually installed JVMs:

sudo rm -rf /usr/lib/jvm/*

Remove Java entries, if there is still any, from the alternatives:

for g in ControlPanel java java_vm javaws jcontrol jexec keytool mozilla-javaplugin.so orbd pack200 policytool rmid rmiregistry servertool tnameserv unpack200 appletviewer apt extcheck HtmlConverter idlj jar jarsigner javac javadoc javah javap jconsole jdb jhat jinfo jmap jps jrunscript jsadebugd jstack jstat jstatd native2ascii rmic schemagen serialver wsgen wsimport xjc xulrunner-1.9-javaplugin.so; do sudo update-alternatives --remove-all $g; done

Search for possible remaining Java directories:

sudo updatedb
sudo locate -b '\pack200'

If the command above produces any output like /path/to/jre1.6.0_34/bin/pack200 remove the directory that is parent of bin, like this:

sudo rm -rf /path/to/jre1.6.0_34.

Then to get the correct version I followed Sparksco's guide to install java SE 1.7 here. You can skip the first couple of steps because java will already be removed. Also be sure to change the commands for whichever version you get( I think its update 15 now).

The next part might have been over kill on my part but I went back through and tried to add all the packages back just in case I had removed any through those commands, but obviously skip the openjdk-6-jre openjdk-6-jdk. It won't reinstall anything you already have up to date.

Let me know how it goes.
[Nexus 7 Android Development] azoller1:
will try this out in a little bit
[Nexus 7 Android Development] mrRobinson:
That way surely works but it has a lot of problems and can be much easier for you. If you can get away with open-jdk then we are good, just aptitude install and all is well in the world. Some builds might work but ideally you want the official oracle java6 or java7 depending on what you are building.

The problem with grabbing the tarball in that post is that java is updated frequently. You'd have to rip it all out and redo your tarball install for every update.

There is a wonderful opensource project that solves this issue for us. The gist of it is that it scripts taking the oracle java (lets you pick the one you want 6 or 7) and builds a local repo for you. Once that local repo is built you simply use the normal aptitude update or remove commands to deal with it. Here is my command history to install the latest java on my ubuntu server

1140 wget https://github.com/flexiondotorg/oab-java6/raw/master/oab-java.sh
1141 chmod +x oab-java.sh
1142 ./oab-java.sh
1143 exit
1144 update-alternatives --config java
1146 java -version

Notice how much easier that was?

check it out here

Genius solution.

As an aside if you are doing builds on a server you ssh into you probably are aware of a program called screen. (so if you disconnect you don't lose your output or build). I was looking for a good screenrc and found byobu. It's screen made pretty, better, etc.

1148 add-apt-repository ppa:byobu/ppa
1149 aptitude update
1150 aptitude install byobu
1151 byobu
[Nexus 7 Android Development] azoller1:
Re: [HOWTO] Build CM10.1 for Nexus 7

So its OK if it says SRC no directory found right before it begins to build?
[Nexus 7 Android Development] #define:
Re: [HOWTO] Build CM10.1 for Nexus 7

yea..

As long as the build doesnt stop, its ok

Sent from my Nexus 7
[Nexus 7 Android Development] underwaterjr:
Re: [HOWTO] Build CM10.1 for Nexus 7

My last couple of builds have lost the options in the reboot menu to reboot into recovery or bootloader. Anybody else?

Edit: I'm a noob lol. Have to go into developer options and enable advanced reboot menu.
[Nexus 7 Android Development] TheDarkDefender:
Re: [HOWTO] Build CM10.1 for Nexus 7

Lol.. I was about to comment on that. :)

Excuse typos. Sent from a handheld.
[Nexus 7 Android Development] fattire:
Yeah I think it's a new security feature to keep people who might find your phone or whatever from rebooting into recovery and doing bad things...
[Nexus 7 Android Development] azoller1:
how do i build it with linaro toolchains? and different optimizations like bionic
[Nexus 7 Android Development] azoller1:
i hope it doesnt take that long to build next time, but it finally worked! thanks evreyone for the help!
[Nexus 7 Android Development] .torrented:
it will take that long every time you do a fresh build

From the time you type brunch grouper to the time it gets to running release tool...........
[Nexus 7 Android Development] azoller1:
Re: [HOWTO] Build CM10.1 for Nexus 7

But ccache helps a little bit?
[Nexus 7 Android Development] azoller1:
can someone hepl me with this auto build script? i dont think im getting the cherry-pick part right

export PATH=${PATH}:~/bin
export PATH=${PATH}:/home/alex

# sync repo with CM and Harsh repository

cd ~/android/system
repo sync

# cherry pick commits
cd ~/android/system/frameworks/base
git fetch git://github.com/AOKP/frameworks_base.git

cd ~/android/system/packages/apps/Settings
git remote add upstream https://github.com/CyanogenMod
android_packages_apps_Settings.git
git fetch upstream
git cherry-pick cb3390486f3daabee8cdf525c440729944863c8b
git cherry-pick ab9ecc34fbed8526ef6a5b31ab3ce7b398cd1eb9

cd ~/android/system/frameworks/base
git remote add upstream https://github.com/AOKP/frameworks_base.git
git fetch upstream
git cherry-pick 6e3bd8940a6ca919d239ab02a0f1c1ee68bb79e4
git cherry-pick 69b33b478a531c2f56148fabdec94809d85525bf
git cherry-pick 0fc02ca80acc0589b8cf90ec57be3d7d47bc9778
git cherry-pick 3e29e8733e155338230c26a5c7c2625484e5cead
git cherry-pick ff2a82398835a6f4e5da32af6f43e560a67e3e33

cd ~/android/system/packages/apps/Settings
git remote add upstream https://github.com/AOKP/packages_apps_Settings.git
git fetch upstream
git cherry-pick ce3b02a64889fd3f2a535045c5a042a616871bc6
git cherry-pick 04b075e7f96e13549e2a1fb5ff2fd5dc538ce62e

cd ~/android/system/packages/apps
git clone git://github.com/AOKP/packages_apps_ROMControl.git ROMControl
git clone git://github.com/AOKP/packages_apps_PerformanceControl.git PerformanceControl

# and prepare for building

cd ~/android/system
export USE_CCACHE=1
. build/envsetup.sh
make clobber
brunch grouper
cd $OUT
[Nexus 7 Android Development] s33d1ing:
Did this ever get figured out? I am running into the exact same problem.
[Nexus 7 Android Development] azoller1:
you have to manuelly download the device and kernel repositories look back a few pages, i posted the repository links
[Nexus 7 Android Development] s33d1ing:
Ok thanks. I saw that post but I havent tried it yet

UPDATE: after manually adding the device and kernel repositories and a little help from this guide, I have successfully built cm10.1!
[Nexus 7 Android Development] Nova163:
I've done exactly the same, but I'm running into this error message:

build/core/package.mk:233: *** multiple target patterns. Stop.

Can't seem to figure out what I'm doing wrong...
[Nexus 7 Android Development] azoller1:
maybe try make clobber, i think its trying to build for more than one device at once, did you type in everything correctly?
[Nexus 7 Android Development] Nova163:
I did make clobber and I typed everything correctly. It's showing the right target as far as I can see.
[Nexus 7 Android Development] azoller1:
Re: [HOWTO] Build CM10.1 for Nexus 7

Hmm what I did was remove my whole cm directory then re did repo sync and it worked
[Nexus 7 Android Development] s33d1ing:
Re: [HOWTO] Build CM10.1 for Nexus 7

When I tried to flash the cm zip I got a status 7 error. I was trying to flash over cm10.1 I already had on there.
[Nexus 7 Android Development] azoller1:
dang im getting status 7 error also, some symlinks failed
[Nexus 7 Android Development] Nova163:
When I read this I was already downloading all source again and *knock on wood* it seems to be working. Thanks for thinking with me!
[Nexus 7 Android Development] #define:
Re: [HOWTO] Build CM10.1 for Nexus 7

Guys...

Explanation??

Please??

Someone??

Sent from my Nexus 7
[Nexus 7 Android Development] fattire:
Good ole 4.2.2.2.2.2.2.2.2.2.2

Here's normal:

============================================

PLATFORM_VERSION_CODENAME=REL

PLATFORM_VERSION=4.2.2

TARGET_PRODUCT=cm_grouper

TARGET_BUILD_VARIANT=userdebug

TARGET_BUILD_TYPE=release

TARGET_BUILD_APPS=

TARGET_ARCH=arm

TARGET_ARCH_VARIANT=armv7-a-neon

HOST_ARCH=x86

HOST_OS=linux

HOST_OS_EXTRA=Linux-3.5.0-25-generic-x86_64-with-Ubuntu-12.10-quantal

HOST_BUILD_TYPE=release

BUILD_ID=JDQ39

OUT_DIR=/media/test/jellybean/out

============================================

Note the TARGET_PRODUCT is cm_grouper not full_grouper... did you brunch grouper?
[Nexus 7 Android Development] #define:
Re: [HOWTO] Build CM10.1 for Nexus 7

This is aosp...

But this is super weird so i thought i'd share...

I've never had this sort of weirdness... The build is going on right now..

But i'm trying to figure out how and why something like this would happen...
[Nexus 7 Android Development] Nova163:
Appearently my knock on wood didn't work... it's giving me the same error now.

EDIT:

Seems to be fixed once more. To anyone who runs into the same error:

The only thing I could find was this:

https://groups.google.com/forum/#!topic/android-building/pnC7IsQ9TAE

And then I realised I had a cherry pick (this one: http://review.cyanogenmod.org/#/c/31545/) that changes files in the res folder. So I deleted the entire Calculator folder and cloned the git that belongs to it.. and that solved it.
[Nexus 7 Android Development] azoller1:
Re: [HOWTO] Build CM10.1 for Nexus 7

It seems like I'm not cherry picking right... Any cherry pick I do the build gives me a black screen when I boot up my nexus 7
[Nexus 7 Android Development] azoller1:
Re: [HOWTO] Build CM10.1 for Nexus 7

Seems some builds take longer than others, so I can't do something like this

brunch grouper -j4?
[Nexus 7 Android Development] Nova163:
The brunch command automatically selects the optimal amount of jobs, so that's not the explanation. Maybe one build is after make clobber and the other isn't?
[Nexus 7 Android Development] azoller1:
is it faster after a make clobber?
[Nexus 7 Android Development] Nova163:
no, slower since it has to rebuild everything from scratch.
[Nexus 7 Android Development] s33d1ing:
What is make clobber? and when would you even use it?
[Nexus 7 Android Development] Nova163:
http://wiki.cyanogenmod.org/w/Doc:_make_clean_vs_make_clobber
[Nexus 7 Android Development] azoller1:
so if i just did, make clean would it be as fast if i didnt do make clobber?
[Nexus 7 Android Development] Nova163:
Re: [HOWTO] Build CM10.1 for Nexus 7

Make clean is faster than clobber but might occasionally cause errors.
[Nexus 7 Android Development] azoller1:
Re: [HOWTO] Build CM10.1 for Nexus 7

Cool now I know for small changes I don't need make clobber so I can make it faster thanks
[Nexus 7 Android Development] bradman117:
Re: [HOWTO] Build CM10.1 for Nexus 7

What's the easiest way to extract android.policy.jar to .java files? Using Linux?
[Nexus 7 Android Development] s33d1ing:
I finally got around to building the rom again and this time it flashed successfully!

Now I have to get around to tweaking some things!
[Nexus 7 Android Development] azoller1:
Re: [HOWTO] Build CM10.1 for Nexus 7

What did you do differently? Or was it just the build probably
[Nexus 7 Android Development] s33d1ing:
I didn't really change anything. Before it finished building but then had an error when trying to flash it. I tried to build it again but had an error during the process so I remade the build environment and it worked after that.

Now comes the fun part :p What are some easy things to change or possible add to help me learn how all this works? One thing that i'm sure is fairly simple is changing the kernel, would I just need to replace the files in the kernel folder with the ones of the kernel I would like to use?

Also: When I build the rom again, do I just need to sync the repo and do brunch grouper and occasionally do make clobber?
[Nexus 7 Android Development] azoller1:
Re: [HOWTO] Build CM10.1 for Nexus 7

I would do a repo sync every time before you build just to be up to date and it doesn't take long at all and make clean is usually for day to day builds but if you do make clobber builds will take longer but you will start from fresh in the Out directory look at the link in the op about make clean vs make clobber
[Nexus 7 Android Development] apascual89:
Re: [HOWTO] Build CM10.1 for Nexus 7

I have to re download the source. I think someone gave a pointer sometime ago about how to download just the current branch. Does anyone know how to do that?
[Nexus 7 Android Development] s33d1ing:
If i'm not mistaken, the CM manifests defaults to downloading only the current branch.
[Nexus 7 Android Development] #define:
Re: [HOWTO] Build CM10.1 for Nexus 7

I use "repo --trace sync -c -d"...

-c stands for current branch and -d stands for detach default.xml...

--trace simply gives verbose output...

Sent from my Nexus 7
[Nexus 7 Android Development] s33d1ing:
How would I go about changing the kernel that is included in the rom when I build it?
[Nexus 7 Android Development] #define:
Re: [HOWTO] Build CM10.1 for Nexus 7

If you wanna use another prebuilt kernel, just replace the file 'kernel' in devices/asus/kernel and the modules present in that folder...

If you wanna build from source, put the kernel source in kernel/asus/grouper(create if not present)....

Then, in the BoardConfigCommon.mk, replace TARGET PREBUILT KERNEL := SOMETHING with TARGET_KERNEL_SOURCE := kernel/asus/grouper, and add TARGET_KERNEL_CONFIG := defconfig command of kernel source...

Also, in device-common.mk, comment out prebuilt modules...

Someone correct me if i'm wrong here...

Sent from my Nexus 7
[Nexus 7 Android Development] s33d1ing:
Thanks Ill try that out later. Also, I haven't looked into adding the thunderbolt tweaks yet but is it as easy as just extracting the zip into the android/system folder or is there something else?
[Nexus 7 Android Development] tonyp:
Re: [HOWTO] Build CM10.1 for Nexus 7

nonsense.

clean will cause exactly the same as clobber.
[Nexus 7 Android Development] TheDarkDefender:
Re: [HOWTO] Build CM10.1 for Nexus 7

http://wiki.cyanogenmod.org/w/Doc:_make_clean_vs_make_clobber

Excuse typos. Sent from a handheld.
[Nexus 7 Android Development] chasmodo:
Yes. Both remove the contents of your /out folder completely.
[Nexus 7 Android Development] TheDarkDefender:
Re: [HOWTO] Build CM10.1 for Nexus 7

This kinda seems weird. I build like once in every two days. Although there are changes merged everyday, the file size has been remaining the same (150.94 mb) .. Am i doing something wrong?

Btw,i do make clobber every time before a build.

Sent from my Nexus 7
[Nexus 7 Android Development] mrRobinson:
Re: [HOWTO] Build CM10.1 for Nexus 7

Changes can just as easily remove things as add things. And unless it's resources you are talking like KB's (many times just bytes on a diff) files. So I don't think you can look at file size to determine if you are doing something wrong.

Take a look at a merge you know you didn't have last time and check in your new build if that feature or fix is there.
[Nexus 7 Android Development] TheDarkDefender:
Re: [HOWTO] Build CM10.1 for Nexus 7

Ah yes.. You are right. Thanks :)

Sent from my Nexus 7
[Nexus 7 Android Development] TheDarkDefender:
can anyone explain this please?
[Nexus 7 Android Development] apascual89:
Re: [HOWTO] Build CM10.1 for Nexus 7

Did you make any changes locally to the kernel?
[Nexus 7 Android Development] TheDarkDefender:
Re: [HOWTO] Build CM10.1 for Nexus 7

Yes. I changed the kernel source. Is this a problem?

Sent from my Nexus 7
[Nexus 7 Android Development] #define:
Re: [HOWTO] Build CM10.1 for Nexus 7

Not a problem, but you need to change the kernel source in manifest as well..

Right now its checking for the source that is mentioned in default manifest, but since you changed it, it does not match....

Hence the error...

So change the kernel project name in default.xml and you should be good to go...

Sent from my Nexus 7
[Nexus 7 Android Development] TheDarkDefender:
Re: [HOWTO] Build CM10.1 for Nexus 7

I ve already done that. In 'room-service.xml' under .repo/local_manifests

Sent from my Nexus 7
[Nexus 7 Android Development] #define:
Re: [HOWTO] Build CM10.1 for Nexus 7

Proper revision defined??

Sent from my Nexus 7
[Nexus 7 Android Development] TheDarkDefender:
Re: [HOWTO] Build CM10.1 for Nexus 7

Yes. Edited everything necessary.

Anyway,the build doesn't start. It throws an error,says some files are already defined. So when i checked the 'kernel' folder and the 'device' folder, there were common sub folders like liblights,overlay,etc...

What do i do?

Thanks

Sent from my Nexus 7
[Nexus 7 Android Development] chasmodo:
Perhaps this is a stupid question, but did you remove the previous kernel project in roomservice.xml?
[Nexus 7 Android Development] TheDarkDefender:
Re: [HOWTO] Build CM10.1 for Nexus 7

Oh,man, come on. I knew i had to replace it.

Sent from my Nexus 7
[Nexus 7 Android Development] jonah1234:
i followed all steps exactly up to where i'm at now and i'm getting this error. Can anyone help please. thanks in advance :).

anonymous@ubuntu:~/android/system/vendor/cm$ source build/envsetup.sh
bash: build/envsetup.sh: No such file or directory
[Nexus 7 Android Development] #define:
Re: [HOWTO] Build CM10.1 for Nexus 7

Why are you in vendor/cm??

The correct path to run the command would be :

anonymous@ubuntu:~/android/system$ source build/envsetup.sh

Sent from my Nexus 7
[Nexus 7 Android Development] jonah1234:
thanks it worked
[Nexus 7 Android Development] underwaterjr:
Re: [HOWTO] Build CM10.1 for Nexus 7

If I wanted to build for toro can I use the same source folder? Just have to do breakfast toro, so the device and kernel sources get added?
[Nexus 7 Android Development] #define:
Re: [HOWTO] Build CM10.1 for Nexus 7

Yes

Sent from my Nexus 7
[Nexus 7 Android Development] underwaterjr:
Re: [HOWTO] Build CM10.1 for Nexus 7

Thank you
[Nexus 7 Android Development] Nova163:
[never mind, didn't read well]
[Nexus 7 Android Development] apascual89:
Re: [HOWTO] Build CM10.1 for Nexus 7

Sorry about the late answer. Did you figure it out?
[Nexus 7 Android Development] TheDarkDefender:
Re: [HOWTO] Build CM10.1 for Nexus 7

Yes. Silly mistake. Cloned the wrong source.

Excuse typos. Sent from a handheld.
[Nexus 7 Android Development] #define:
Re: [HOWTO] Build CM10.1 for Nexus 7

Can someone explain to me what CTS is??

I couldnt find anything i could understand...

Sent from my Nexus 7
[Nexus 7 Android Development] AndDiSa:
AW: [HOWTO] Build CM10.1 for Nexus 7

Google is your friend:

http://blog.markloiseau.com/2012/07/how-to-compile-android-on-ubuntu-12-04/
[Nexus 7 Android Development] vasumit:
The link didnt open. I will see that again later. Anyway my problem resolved after fixing the java compiler path following this link http://eclipserom.com/thedark/content.php?11-Linux-Mint-14-Eclipse-AOSP-compiling-guide

Now I have successfully compiled my unofficial build for grouper and N7100. Many thanks to the OP fattire for putting up his knowledge for us to learn some cool tips.

Thanks for your reply mate. much appreciated.
[Nexus 7 Android Development] apascual89:
Building the kernel

Hi guys, how can you build the kernel alone instead of the whole build? Is that possible?

Thanks
[Nexus 7 Android Development] #define:
Re: [HOWTO] Build CM10.1 for Nexus 7

Go to kernel source directory, and assuming you have added toolchain path in bashrc, do :

make ARCH=arm CROSS_COMPILE=arm-eabi- device_defconfig

Replace device_defconfig with whatever applies..

Then, run :

make ARCH=arm CROSS_COMPILE=arm-eabi- -jX

And then the usual, packing boot.img with ramdisk, copying modules, and flashing..

Sent from my Nexus 7
[Nexus 7 Android Development] robertpalmerjr:
Mac OSX 10.8 Mountain Lion

So far the instructions seem to be working fine on my Mac OS X running Mountain Lion (10.8). I did the following:

- created a separate case preserving, case sensitive sparse disk image for the sources (because the standard AOSP instructions say that's a requirement, I didn't try without)

- manually had to build/install wget

- had to copy the MacOS.10.6.sdk from an older version of XCode to my latest version

Build is still running.

---------- Post added at 03:14 PM ---------- Previous post was at 03:06 PM ----------

I'm working on a driver to replace an existing driver. The new driver is designed to use the OpenFirmware style Device Tree (devicetree.org). I'm in the process of building the CM10.1 image, and I've searched the archives for references to device tree, but haven't found anything applicable. I did search the code base and found some device tree files (.dts) in android/system/kernel/asus/grouper/arch/arm/boot/dts but those appear to be for specific development boards and even then, very minimal, mainly just for booting (probably why they're under a directory called boot).

How would I go about adding a device tree file that would provide the information for my specific driver, where should the file be placed, how does it get included in the build, etc.

I've spent quite a bit of time looking at the device tree google search results and they do a great job of covering the syntax and how to access the device tree data, but I haven't found much on the build side of it.
[Nexus 7 Android Development] robertpalmerjr:
building on MacOS X

It built - haven't tested it yet. In addition to the above, I also had to:

- increase my sparse disk image from 25GB to 35GB and then finally to 40GB for it to build without running out of space

- grabbed a copy of elf.h from rockbox per the recommendations on Google Groups: Android Linux Kernel Development search for Kernel build error on Mac OS (sorry, I can't post the direct link)
[Nexus 7 Android Development] vasumit:
Hi Friends,

Anyone know how to backup synced repo and then restoring it, which can be very handy @ various situations like system crash, changing OS etc. I have tried copying the .repo folder to an external hard disk and restoring by copying back but this process dont work. For people with slow internet link like me, this could be a great thing.

Thanks & Cheers, Sumit