[Nexus 7 Q&A, Help & Troubleshooting] espionage724:
I would like to mess with trying to install my own customized ROM's to my Nexus 7, but the first place to probably start is with being able to build AOSP as-is from source.

As I understand currently, building is only supported on Linux and OS X, but I can easily get Ubuntu 10.04 and re-partition my HDD to give it about 100GB (if that much is even needed).

Looking at:

http://source.android.com/source/initializing.html

I need to choose a branch and setup the Linux environment. I'm a bit confused as to what branch I should choose though. I want the latest source of Android available at the time, so I should pick the master branch? Or since I'm only building for the Nexus 7, should I choose it's device-specific branch instead? Although looking at:

http://source.android.com/source/build-numbers.html

the Nexus 7 is only at android-4.1.1_r1.1, but I could of sworn I heard there was r4 out already.

As for setting up the Linux environment, I hope I can just follow all the commands listed there without any problem.

Proceeding on with:

http://source.android.com/source/downloading.html

It looks like a pretty straightforward process that I'm also hoping can be done successfully if I follow the commands exactly as presented. I don't have a proxy nor the need for a local mirror either.

And then moving onto:

http://source.android.com/source/building-devices.html

Some stuff there I find a little bit confusing. It would seem I have to first get proprietary drivers, which all 4 seem to be placed conveniently at:

https://developers.google.com/android/nexus/drivers#grouper

From there, I imagine I can move the script that's bundled inside to the root of the source folder, run it, and follow the instructions. I don't exactly know what the root of the source folder is, but it would probably be obvious once I did start trying to build this. But once I did find it, I would run (using Nvidia's Graphics driver for the example)

sh extract-nvidia-grouper.sh

in Terminal, and it would place the right files where they need to be.

I don't understand the

make clobber

part too well at all; should I run this on the very first build, later builds, or all builds?

And once the source and drivers are all downloaded and available, I should then run

lunch full_grouper-userdebug

and then finally

make -j#

(# being some number in accordance with how many cores on my CPU I have). I have a triple-core CPU at 3.5Ghz, and I have the ability to unlock to quad-core at 3.3Ghz (but prefer to stay on triple). Should I just run

-j32

? Also will this build the Kernel as well, or will I have to get the source for that and compile it separately?

And once the build completes, my plan from there was to just go back to Windows and flash it. And if I managed to get it to flash and boot properly, I assume I would of succeeded with compiling AOSP from source :)

I noticed that

userdebug

part on

full_grouper-userdebug

gives "root access and debuggability". Does this mean it comes with some program like Superuser or SuperSU already installed? Or does this mean I can easily install those?

Perhaps after I get comfortable with the basics of flashing AOSP as-is, I can then try to mess with different types of optimizations, like Linaro and perhaps even messing with many types of optimizations from different kernels like faux123 has done :).

I also have a 360kb/s DSL connection, so downloading the entire source the first time will probably take a good while. But once I have the source, I take it I don't have to redownload the entire thing for patches and stuff?

Any and all guidance is welcome :)