Attend XDA's Second Annual Developer Conference, XDA:DevCon 2014!
5,771,243 Members 52,087 Now Online
XDA Developers Android and Mobile Development Forum

[HOWTO] Build CyanogenMod 11.0 for Nexus 7

Tip us?
 
fattire
Old
(Last edited by fattire; 7th November 2013 at 10:09 PM.) Reason: Shortened intro & added a few more details
#1  
fattire's Avatar
Recognized Developer - OP
Thanks Meter 4391
Posts: 1,522
Join Date: Oct 2010
Info 2 [HOWTO] Build CyanogenMod 11.0 for Nexus 7

11-5-13 -- See here for the start of the CM 11.0 (based on Android 4.4 KitKat) discussion.



7-27-13 --- See here for my build instructions for CyanogenMod 10.2 (based on AOSP 4.3)...

Hey all,

So I've ported my "Build CyanogenMod" instructions (Nook Color, Nook Tablet, and HP Touchpad) to the Nexus 7.

The doc basically covers unlocking the N7, getting the build environment ready, downloading source, building, installing, and updating the source. The walkthrough is for Linux, but you should be able to do it via a virtual machine running on OS X and Windows such as Virtualbox (free).

The idea is that building Android from scratch should be possible for almost anyone to learn. So this guide walks you through it.

If you're running into difficulties, this thread is a place to exchange info, tips, questions, etc.

It's also a good place to proclaim loud and clear to the world...

"I'm running an OS I built myself from source!"

Thanks to eyeballer for reviewing.

Quote:
Originally Posted by CyberCitizen View Post
Sorry for my ignorance, but besides bragging rights, what is the whole point of self compiling stock cm10 for your device?
Off the top of my head...
  • You never, ever have to wait for a nightly
  • You can add or remove as-yet uncommitted features with ease.
  • You learn how Android works under the hood
  • You learn how to use Linux
  • You'll learn how to use git
  • You may, even accidentally, pick up a little C, Java, C++, and learn about the build system.
  • You can personalize Android-- make your own tweaks, replace kernels, modules, graphics, add or remove projects, overclock, underclock etc. In other words, you have control over every aspect of your device's functionality. Your build is custom to you.
  • You can audit the code for potential security issues such as back doors or trojans (as opposed to just trusting a random person who posts a build). Since CM10 source is open, you can examine every commit, and there are many eyes looking at the code. (does not apply to proprietary blobs, but these are pulled from your device, so you have and are using them already)
  • You can contribute features/fixes back upstream
  • You can start ports to other as-yet-unsupported devices (start by copying folders from similar devices to devices/manufacturer/model)
  • You come to really understand that Android phones and tablets are full-fledged general-purpose computers just like laptops and desktops.
  • AAAAND....you get huge bragging rights

The extent to which you delve into the above is entirely up to you. The walkthrough is just an introduction to that world. If N7 is anything like the NookColor/NookTablet/TouchPad, some people will build once and never do it again... but others will start to tinker and make changes to their own build and want to share them with others, and soon some will start making contributions back to official CM10 upstream... or port to new devices... and by fixing bugs and all this... everyone benefits.

Plus...
  • It's fun.

ALSO: Here are some little bits that resulted from this thread:

Update: A lot of the above info, as well as much more original articles, can now be found on the CyanogenMod wiki. So check there, especially the dev center.

That's it! Happy building!
How to Build CM10.1 Instructions for the Nexus 7 (CM Wiki version)
Addendum for CyanogenMod 10.2
The Following 202 Users Say Thank You to fattire For This Useful Post: [ Click to Expand ]
 
slick_rick
Old
(Last edited by slick_rick; 22nd August 2012 at 08:22 AM.)
#2  
slick_rick's Avatar
Recognized Contributor
Thanks Meter 6201
Posts: 2,877
Join Date: Sep 2011
Location: Immokalee/Tampa FL

 
DONATE TO ME
Highly recommend fattires walkthrough. I was a total noob when I had the nook color and he initially made a build from source guide but now I know the basics and can make personal builds for my nexus 7 and epic 4g touch

Sent from my Nexus 7 using Tapatalk 2
I don't answer rom support questions through PM! You will be ignored! Post your question in the relevant thread instead.
The Following 9 Users Say Thank You to slick_rick For This Useful Post: [ Click to Expand ]
 
S0ckM0nk3y
Old
(Last edited by S0ckM0nk3y; 8th September 2012 at 04:48 AM.)
#3  
S0ckM0nk3y's Avatar
Recognized Developer
Thanks Meter 361
Posts: 641
Join Date: Nov 2010
Location: Michigan

 
DONATE TO ME
Totally forgot I reserved this spot lol. Anyways great guide fattire. For those of u that want to learn how to build from source whether its cm, aokp, bamf, aosp or whatever u want to build this guide is a great start. While this guide is strictly for CM it will give u an understanding of the steps of building from source. Great work again fattire.
Follow The Rules, Be Respectful and Hit The Thanks Button
 
biohazrd51
Old
#4  
Senior Member
Thanks Meter 182
Posts: 491
Join Date: Apr 2011
Highly highly highly recommend for anyone that loves to flash ROMs, but never built one before. fattire is one of several who have done absolute wonders for the Nook Color community. Not just developing for the device, but pulling people together to get this stuff running.
T-Mobile G2 - JB
Nook Color - JB/ICS
Nexus 7 - JB
The Following User Says Thank You to biohazrd51 For This Useful Post: [ Click to Expand ]
 
mateorod
Old
#5  
Recognized Developer
Thanks Meter 3506
Posts: 1,976
Join Date: Nov 2011
Location: New Orleans

 
DONATE TO ME
I am one of the obsessives who almost didn't buy this machine when I saw they yanked the sdcard. But when fat-tire said he was getting one, I immediately went to the Play store.

His walk-thru for encore ICS was how I first learned to build. I have been building CM10 for my grouper for several weeks, although the repo sync was incomplete. I ended up having to write m own cm.mk files as well as several other weird little changes in order to make it boot. Glad those changes are finally checked I, I am going to delete my home-baked files so I can get any changes from upstream.

I have an issue I am hoping you can shed some light one, fat-tire. Inconsistencies in the ContentResolver file between my builds and those in Official Cyanogen night lies. I haven't seen any commits that change those files.

I have asked eyeballer about it, but he isn't sure either. I am building a clobber right now, but if I still have the issue, I will post particulars.

I am real glad to see you here...it has been a pretty wild and wooly forum thus far...
Support Beloko Games' source ports of Doom and Quake 1-3, Jedi Knight, etc.

He is hurting from piracy...I need Doom 3 on my phone, you guys. Buy them, ok?
The Following User Says Thank You to mateorod For This Useful Post: [ Click to Expand ]
 
fattire
Old
#6  
fattire's Avatar
Recognized Developer - OP
Thanks Meter 4391
Posts: 1,522
Join Date: Oct 2010
Whoa. How come this thread got moved from Nexus 7 Android Development to Nexus 7 General? I can't think of anything more Develop-y than building Android.

In any event- thanks all for the kind words. Mateorod, not sure from your description what issue you're having. I'll def. need more specifics.

Glad you got the N7? I am-- I use it for hours daily...



Quote:
Originally Posted by mateorod View Post
I am one of the obsessives who almost didn't buy this machine when I saw they yanked the sdcard. But when fat-tire said he was getting one, I immediately went to the Play store.

His walk-thru for encore ICS was how I first learned to build. I have been building CM10 for my grouper for several weeks, although the repo sync was incomplete. I ended up having to write m own cm.mk files as well as several other weird little changes in order to make it boot. Glad those changes are finally checked I, I am going to delete my home-baked files so I can get any changes from upstream.

I have an issue I am hoping you can shed some light one, fat-tire. Inconsistencies in the ContentResolver file between my builds and those in Official Cyanogen night lies. I haven't seen any commits that change those files.

I have asked eyeballer about it, but he isn't sure either. I am building a clobber right now, but if I still have the issue, I will post particulars.

I am real glad to see you here...it has been a pretty wild and wooly forum thus far...
The Following 6 Users Say Thank You to fattire For This Useful Post: [ Click to Expand ]
 
h00py
Old
#7  
h00py's Avatar
Senior Member
Thanks Meter 54
Posts: 205
Join Date: Dec 2010
Location: Glasgow
Hey, n00b builder here. First off big thanks for posting the guide I'm afraid I'm having a problem though. Once I've sync'd the cyanogenmod repo I don't seem to have "asus/grouper" in my device folder. Any idea what I could've done wrong?
The Following User Says Thank You to h00py For This Useful Post: [ Click to Expand ]
 
fattire
Old
(Last edited by fattire; 22nd August 2012 at 09:14 PM.)
#8  
fattire's Avatar
Recognized Developer - OP
Thanks Meter 4391
Posts: 1,522
Join Date: Oct 2010
Tablet Try this...

Quote:
Originally Posted by h00py View Post
Hey, n00b builder here. First off big thanks for posting the guide I'm afraid I'm having a problem though. Once I've sync'd the cyanogenmod repo I don't seem to have "asus/grouper" in my device folder. Any idea what I could've done wrong?
Did you try the "lunch grouper" command? (you have to do . build/envsetup.sh first as described in the documents)

If this command doesn't work, you may need to add these directories to the repository manifest (a list of all the different projects that make up CM10). To add it to the list, try creating a file called local_manifest.xml in the .repo directory (it is a hidden directory as it starts with a period) and put this in the file:

<?xml version="1.0" encoding="UTF-8"?>
<manifest>
<remote fetch="git://github.com/" name="gh" review="review.cyanogenmod.com" />
<project name="CyanogenMod/android_kernel_asus_grouper" path="kernel/asus/grouper" remote="github" revision="jellybean" />
<project name="CyanogenMod/android_device_asus_grouper" path="device/asus/grouper" remote="github" revision="jellybean" />
</manifest>


Alternately, you can do it this way from your root (~/android/system or wherever you put the source)

Code:
curl https://raw.github.com/gist/dcef0eadc4c8d31ae46d/d27a0cc718607b1a6e4958f9d0e57887b2eb4eb3/gistfile1.xml > .repo/local_manifest.xml
This local_manifest.xml file will add the needed grouper repos to the manifest. So then just repo sync again and see if they show up. If so, let me know and I'll add it to the instructions.

Update: I added it to the instructions. Let me know if it works. At some point these will be added to the official manifest so the local_manifest.xml won't be needed.
The Following 3 Users Say Thank You to fattire For This Useful Post: [ Click to Expand ]
 
h00py
Old
#9  
h00py's Avatar
Senior Member
Thanks Meter 54
Posts: 205
Join Date: Dec 2010
Location: Glasgow
Deleted my whole source folder and started again following the updated instructions. Everything worked fine this time. It's building now and I'll report back if/when it finishes.

Thanks again for the help
 
fattire
Old
#10  
fattire's Avatar
Recognized Developer - OP
Thanks Meter 4391
Posts: 1,522
Join Date: Oct 2010
Quote:
Originally Posted by h00py View Post
Deleted my whole source folder and started again following the updated instructions. Everything worked fine this time. It's building now and I'll report back if/when it finishes.

Thanks again for the help
Heh np. Thought you didn't need to delete the folder-- the nice thing about repo sync is that it will update everything automatically, even if you change the manifest

The Following User Says Thank You to fattire For This Useful Post: [ Click to Expand ]
Tags
building, cyanogenmod, nexus, recovery, walkthrough
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes