5,599,616 Members 44,907 Now Online
XDA Developers Android and Mobile Development Forum

How to build a CM9 ROM from source

Tip us?
 
JackpotClavin
Old
#1  
JackpotClavin's Avatar
Recognized Developer - OP
Thanks Meter 2090
Posts: 771
Join Date: Feb 2011
Location: New York

 
DONATE TO ME
Smile How to build a CM9 ROM from source

It was almost exactly this time last year that I got my first Android device. I had absolutely no development experience whatsoever, so if anybody told me that I'd make a Cyanogenmod 7 Gingerbread ROM for the Kindle Fire in 11 months from that time, I would've thought they were crazy.

Android is the easiest to build on Linux, primarily Ubuntu. This guide is designed around building on Ubuntu as well. The first thing you need to build from source is to actually get the source. For Cyanogenmod 9 (Ice Cream Sandwich) you'll have to pull from the Cyanogenmod repository. You'll also have to download a few packages for Linux like Java, and they will have to be put in a PATH folder. In the guide here (which is meant to build CM7 for the Droid X) it's identical for the Kindle Fire. You can follow that guide up until you do this command "cd ~/android/system/" The next step of that guide would pull the CM7 repository, but we want CM9 (ICS). Instead of pulling Gingerbread, you'll want to pull ICS copy this:

repo init -u git://github.com/CyanogenMod/android.git -b ics

It may ask you for your name and email address. Once that's done, you can "repo sync -j16" and it will start downloading the source. This will take a very long time ~2 hours here, but once that's done, you can move on :)

Each device has its own device configuration and vendor files for building. Luckily for you, I've already setup the necessary stuff to get ICS to build for the Fire. You can download my source from my github here https://github.com/jackpotclavin You'll have to download the ICS-Kindle-Fire-Device and ICS-Kindle-Fire-Vendor files and place them in specific spots. For the vendor files, they go into /android/system/vendor/amazon/otter

You'll have to make the amazon and otter folders, but the vendor files should go in them so any random file, say, otter-vendor.mk will be placed so it's like this

/android/system/vendor/amazon/otter/otter-vendor.mk, with the proprietary folder inside /amazon/otter/.

It's almost the same with the device files. Once you download those, you place them into the /android/system/device/amazon/otter/ folder that you'll have to make, so any random file, say, system.prop goes would be located at /android/system/device/amazon/otter/system.prop

Once that's all done, you can download the prebuilts. For this you'll have to navigate into /android/system/vendor/cm and execute the get-prebuilts file. This will download a few files needed for building that will halt the build process if they're missing. Once those are done, it's building time. In the terminal, navigate to your /android/system/ folder, and type the command:

. build/envsetup.sh && brunch otter

That should be it! If somebody gets stuck, reply in this thread and I'll tell them where to go, and I'll update the post to help out :) happy building
The Following 48 Users Say Thank You to JackpotClavin For This Useful Post: [ Click to Expand ]
 
ttabbal
Old
#2  
Senior Member
Thanks Meter 421
Posts: 1,662
Join Date: Jul 2009
Thanks for getting the code up! And the post I'm sure will be very useful for people to get started building.
 
Sad Panda
Old
#3  
Senior Member
Thanks Meter 106
Posts: 342
Join Date: Sep 2011
Location: Mesa

 
DONATE TO ME
Quote:
Originally Posted by JackpotClavin View Post
It was almost exactly this time last year that I got my first Android device. I had absolutely no development experience whatsoever, so if anybody told me that I'd make a Cyanogenmod 7 Gingerbread ROM for the Kindle Fire in 11 months from that time, I would've thought they were crazy.

Android is the easiest to build on Linux, primarily Ubuntu. This guide is designed around building on Ubuntu as well. The first thing you need to build from source is to actually get the source. For Cyanogenmod 9 (Ice Cream Sandwich) you'll have to pull from the Cyanogenmod repository. You'll also have to download a few packages for Linux like Java, and they will have to be put in a PATH folder. In the guide here (which is meant to build CM7 for the Droid X) it's identical for the Kindle Fire. You can follow that guide up until you do this command "cd ~/android/system/" The next step of that guide would pull the CM7 repository, but we want CM9 (ICS). Instead of pulling Gingerbread, you'll want to pull ICS copy this:

repo init -u git://github.com/CyanogenMod/android.git -b ics

It may ask you for your name and email address. Once that's done, you can "repo sync -j16" and it will start downloading the source. This will take a very long time ~2 hours here, but once that's done, you can move on :)

Each device has its own device configuration and vendor files for building. Luckily for you, I've already setup the necessary stuff to get ICS to build for the Fire. You can download my source from my github here https://github.com/jackpotclavin You'll have to download the ICS-Kindle-Fire-Device and ICS-Kindle-Fire-Vendor files and place them in specific spots. For the vendor files, they go into /android/system/vendor/amazon/otter

You'll have to make the amazon and otter folders, but the vendor files should go in them so any random file, say, otter-vendor.mk will be placed so it's like this

/android/system/vendor/amazon/otter/otter-vendor.mk, with the proprietary folder inside /amazon/otter/.

It's almost the same with the device files. Once you download those, you place them into the /android/system/device/amazon/otter/ folder that you'll have to make, so any random file, say, system.prop goes would be located at /android/system/device/amazon/otter/system.prop

Once that's all done, you can download the prebuilts. For this you'll have to navigate into /android/system/vendor/cm and execute the get-prebuilts file. This will download a few files needed for building that will halt the build process if they're missing. Once those are done, it's building time. In the terminal, navigate to your /android/system/ folder, and type the command:

. build/envsetup.sh && brunch otter

That should be it! If somebody gets stuck, reply in this thread and I'll tell them where to go, and I'll update the post to help out :) happy building
(Place holder for later)

Thanks for this post, hoping to start my first aneroid programming contribution soon. This should help get me started. I am assuming though we still need to build drivers to get all the hardware working right? Unless. We can somehow rip drivers from the stock kindle and edit them. Any guide on that type of work, or examples to get started?
 
teookie
Old
#4  
teookie's Avatar
Senior Member
Thanks Meter 39
Posts: 210
Join Date: Feb 2011
Kewl. Going to try this tonight.

Sent from my Kindle Fire using Tapatalk
 
foxdog66
Old
#5  
Senior Member
Thanks Meter 43
Posts: 406
Join Date: Jul 2010
could you do something like this https://gist.github.com/908477 or maby make a extract-files.sh that pulls the proprietary files from the device please? or would doing a git clone https://github.com/JackpotClavin/ICS...ire-Vendor.git set everything up to build?
 
JackpotClavin
Old
#6  
JackpotClavin's Avatar
Recognized Developer - OP
Thanks Meter 2090
Posts: 771
Join Date: Feb 2011
Location: New York

 
DONATE TO ME
Yeah sure I'll do that. Right now the the prop files in the vendor folder come from 6.2.1 so there won't be any new files or features you're missing out on

So yeah, cloning the vendor files will get you same files, but once amazon releases a new revision it will be needed so I'll get on that

Sent from my Galaxy Nexus using XDA App
The Following User Says Thank You to JackpotClavin For This Useful Post: [ Click to Expand ]
 
ytt3r
Old
(Last edited by ytt3r; 31st December 2011 at 06:13 AM.)
#7  
ytt3r's Avatar
Recognized Developer
Thanks Meter 322
Posts: 556
Join Date: Dec 2010
Location: GA

 
DONATE TO ME
excited to see this I have a lot of catching up to do, but I'll be of what help I can to this project...
Like my contributions to whatever? Buy me a root beer.
The Following User Says Thank You to ytt3r For This Useful Post: [ Click to Expand ]
 
teookie
Old
#8  
teookie's Avatar
Senior Member
Thanks Meter 39
Posts: 210
Join Date: Feb 2011
I've tried to sync that repo twice now and it's failed both times. I have successfully synced the CM7 repo in another directory so I'm pretty sure my computer is set up correctly.

It goes for about and hour and then stops with an error. Said something like "unable to fetch objects" or something. So, I just did repo sync again and it errored out almost immediately.

I deleted the source directory and tried again but failed in the same spot. Any ideas?
 
romified
Old
#9  
romified's Avatar
Senior Member
Thanks Meter 50
Posts: 111
Join Date: Jul 2011
Quote:
Originally Posted by teookie View Post
I've tried to sync that repo twice now and it's failed both times. I have successfully synced the CM7 repo in another directory so I'm pretty sure my computer is set up correctly.

It goes for about and hour and then stops with an error. Said something like "unable to fetch objects" or something. So, I just did repo sync again and it errored out almost immediately.

I deleted the source directory and tried again but failed in the same spot. Any ideas?
Yes, I had the same error last night and again early this morning. Will try it later to see if it was a temporary server or network issue.
[R_O_M_I_F_I_E_D] www.romified.com

If you like my work and would like to donate:

 
JackpotClavin
Old
#10  
JackpotClavin's Avatar
Recognized Developer - OP
Thanks Meter 2090
Posts: 771
Join Date: Feb 2011
Location: New York

 
DONATE TO ME
It's not an issue with your setup. Google has reported some syncing issues for some including myself (took me over 20 times yesterday to sync)

Sent from my Galaxy Nexus using XDA App

The Following User Says Thank You to JackpotClavin For This Useful Post: [ Click to Expand ]
Tags
building, guide, ics, rom, source
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes