Compile Cyanogenmod 10 for Nexus 7

This tutorial is the companion to my previous article, Compile Cyanogenmod 10 for Galaxy Nexus and shows how to build for the Asus Nexus 7 tablet (aka grouper) on Ubuntu 12.04 LTS.   Begin by following that the previous tutorial through to the line:

./get-prebuilts

The next step is to get the proprietary device-specific binaries extracted into the source tree.  This can be accomplished in two ways: downloading from Google, and unzipping each individually into the tree (tedious), or by pulling from a another Nexus 7 running the same version (or close) of Cyanogenmod as you are attempting to build.  For the Nexus 7, this process is:

cd ~/cm/device/asus/grouper

./extract-files.sh

Now setup the environment with envsetup

cd ~/cm

. build/envsetup.sh

Execute the ‘brunch’ command to see the list of build targets, and make your selection.

brunch

Once a selection is made, the build should start. If it doesn’t, try running the ‘lunch’ instead. Make your selection, then run ‘mka bacon’

lunch

mka bacon

If that doesn’t work either, explicitly execute ‘make bacon’. You can use the -j compiler flag to enable parallel make.  The recommended use is ‘processor cores + 1′, e.g. 5 if you have a quad core processor:

make -j[#ofcpus] bacon

Once the build completes, the output will be located in ~/cm/out/target/product/grouper/.  This folder contains the system and boot images, as well as a compressed and signed update.zip. Push the file to the sdcard of the device, and reboot into recovery:

adb push ~/cm/out/target/product/grouper/cm-10-20121002-UNOFFICIAL-grouper.zip /sdcard/

adb reboot recovery

Once booted into recovery, MAKE A BACKUP, then flash the update.zip.

About Michael Mitchell

Michael received his MS in Computer Science from the Florida State University in 2011 and is currently working on a PhD. He serves as system administrator and tech lead for the FSU Mobile Lab, and is active in the FSU Operating Systems & Storage group. Michael’s research is currently funded by the National Science Foundation and includes work in mobile operating systems, context-aware computing, mobile security, and semantic file-systems. For more information about Michael and his work, check out michaeljmitchell.com and mitchtech.net