Welcome to XDA

Search to go directly to your device's forum

Register an account

Unlock full posting privileges

Ask a question

No registration required
Post Reply

[HOWTO] Build CyanogenMod 11.0 for Nexus 7

OP fattire

22nd August 2012, 05:52 AM   |  #1  
fattire's Avatar
OP Recognized Developer
Thanks Meter: 4,750
 
1,716 posts
Join Date:Joined: Oct 2010
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

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
Last edited by fattire; 7th November 2013 at 11:09 PM. Reason: Shortened intro & added a few more details
The Following 203 Users Say Thank You to fattire For This Useful Post: [ View ]
22nd August 2012, 06:03 AM   |  #2  
slick_rick's Avatar
Recognized Contributor
Immokalee/Tampa FL
Thanks Meter: 6,201
 
2,877 posts
Join Date:Joined: Sep 2011
Donate to Me
More
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
Last edited by slick_rick; 22nd August 2012 at 09:22 AM.
The Following 9 Users Say Thank You to slick_rick For This Useful Post: [ View ]
S0ckM0nk3y
22nd August 2012, 06:13 AM   |  #3  
Guest
Thanks Meter: 0
 
n/a posts
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.
Last edited by S0ckM0nk3y; 8th September 2012 at 05:48 AM.
22nd August 2012, 03:13 PM   |  #4  
Senior Member
Thanks Meter: 182
 
491 posts
Join Date:Joined: Apr 2011
More
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.
The Following User Says Thank You to biohazrd51 For This Useful Post: [ View ]
22nd August 2012, 04:16 PM   |  #5  
Recognized Developer
New Orleans
Thanks Meter: 3,513
 
1,977 posts
Join Date:Joined: Nov 2011
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...
The Following User Says Thank You to mateorod For This Useful Post: [ View ]
22nd August 2012, 08:10 PM   |  #6  
fattire's Avatar
OP Recognized Developer
Thanks Meter: 4,750
 
1,716 posts
Join Date:Joined: Oct 2010
Tablet
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

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: [ View ]
22nd August 2012, 08:42 PM   |  #7  
h00py's Avatar
Senior Member
Flag Glasgow
Thanks Meter: 54
 
205 posts
Join Date:Joined: Dec 2010
More
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: [ View ]
22nd August 2012, 09:55 PM   |  #8  
fattire's Avatar
OP Recognized Developer
Thanks Meter: 4,750
 
1,716 posts
Join Date:Joined: Oct 2010
Tablet Try this...
Quote:
Originally Posted by h00py

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.
Last edited by fattire; 22nd August 2012 at 10:14 PM.
The Following 3 Users Say Thank You to fattire For This Useful Post: [ View ]
22nd August 2012, 11:13 PM   |  #9  
h00py's Avatar
Senior Member
Flag Glasgow
Thanks Meter: 54
 
205 posts
Join Date:Joined: Dec 2010
More
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
22nd August 2012, 11:18 PM   |  #10  
fattire's Avatar
OP Recognized Developer
Thanks Meter: 4,750
 
1,716 posts
Join Date:Joined: Oct 2010
Tablet
Quote:
Originally Posted by h00py

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: [ View ]
Post Reply Subscribe to Thread

Tags
building, cyanogenmod, nexus, recovery, walkthrough
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes