How to build a CM9 ROM from source

Search This thread

JackpotClavin

Inactive Recognized Developer
Feb 27, 2011
1,024
3,814
New York
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
 

Sad Panda

Senior Member
Sep 1, 2011
352
106
Mesa
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?
 

JackpotClavin

Inactive Recognized Developer
Feb 27, 2011
1,024
3,814
New York
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
 
  • Like
Reactions: zone23

ytt3r

Retired Recognized Developer
Dec 7, 2010
557
321
GA
excited to see this :D I have a lot of catching up to do, but I'll be of what help I can to this project...
 
Last edited:
  • Like
Reactions: icebuck

teookie

Senior Member
Feb 5, 2011
227
42
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

Senior Member
Jul 11, 2011
111
50
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.
 

JackpotClavin

Inactive Recognized Developer
Feb 27, 2011
1,024
3,814
New York
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
 
  • Like
Reactions: jerryz16 and zone23

Icetech3

Senior Member
Sep 24, 2011
401
51
Detroit
Just curious.. since we all use the same exact hardware why not just 1 person build it and post the rom? Or is there something special that needs to be done?
 

thrasherht

Senior Member
Feb 5, 2011
66
6
Saginaw
So I feel like a tard. I am trying to setup my copy of ubuntu so I can hopefully learn some devving skills. But when i try and install this stuff I get errors.

git-core gnupg flex bison gperf libsdl1.2-dev libesd0-dev libwxgtk2.6-dev squashfs-tools build-essential zip curl libncurses5-dev zlib1g-dev sun-java6-jdk pngcrush schedtool
 

ttabbal

Senior Member
Jul 1, 2009
2,076
723
Samsung Galaxy S21 Ultra
So I feel like a tard. I am trying to setup my copy of ubuntu so I can hopefully learn some devving skills. But when i try and install this stuff I get errors.

git-core gnupg flex bison gperf libsdl1.2-dev libesd0-dev libwxgtk2.6-dev squashfs-tools build-essential zip curl libncurses5-dev zlib1g-dev sun-java6-jdk pngcrush schedtool

It's probably java causing the problem. Oracle changed the license and ubuntu can't distribute it anymore. There might be a ppa, but if not you will need to get it from oracle.
 

thrasherht

Senior Member
Feb 5, 2011
66
6
Saginaw
It's probably java causing the problem. Oracle changed the license and ubuntu can't distribute it anymore. There might be a ppa, but if not you will need to get it from oracle.

So how am I suppose to get java jdk installed? I am at a loss. I downloaded the tar, but I didn't understand what they wanted me to do from the instructions on the oracle website.
 

zone23

Senior Member
Feb 16, 2009
5,437
2,309
Just curious.. since we all use the same exact hardware why not just 1 person build it and post the rom? Or is there something special that needs to be done?

It doesn't "need" to be done but some of us like doing it ourselves IF possible. Honestly your statement comes off as "I'm lazy" but I'm sure you just don't have time. Besides the more people you teach the stronger the development will become. You want more ROMs don't you?


-----------------------------------


I found the information on the following page very useful if your running Ubuntu 11.10 like I am.

http://mjanja.co.ke/2011/11/building-android-4-0-on-ubuntu-11-10/


-----------------------------------


I'm hoping to modify the source so no matter what device I compile for they will all have the same look. That will be sweet.


Thanks OP I love posts like this and hope you can add more useful information in the future. I used to do these "how to"s on the HTC Touch Pro before I actually started modding entire ROMs.
 
Last edited:
  • Like
Reactions: Chiggins

Top Liked Posts

  • There are no posts matching your filters.
  • 48
    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
    3
    Anyone want to take a stab at this error? Anyone else getting it?
    Code:
    make: *** No rule to make target `frameworks/base/packages/SystemUI/SystemUI/../../../ex/carousel/java/com/android/ex/carousel/carousel.rs', needed by `out/target/common/obj/APPS/SystemUI_intermediates/src/RenderScript.stamp'.  Stop.

    Sorry, there is a typo in the readme on github, please run again:

    Code:
    rm -rf frameworks/base/packages/SystemUI
    git clone git://github.com/JackpotClavin/SystemUI-For-CM9-Kindle-Fire.git frameworks/base/packages/SystemUI


    ---------- Post added at 09:10 AM ---------- Previous post was at 09:06 AM ----------

    I just set up my environment yesterday and I have been able to build CM7 in the past but after getting it all setup I am receiving the following error:

    Code:
    target SharedLib: libcrypto (out/target/product/otter/obj/SHARED_LIBRARIES/libcrypto_intermediates/LINKED/libcrypto.so)
    collect2: ld terminated with signal 7 [Bus error]

    Ideas what might be causing this? I am building on a Laptop running Ubuntu 11.10 and like I said I was able to build CM7 on this same machine.

    Thanks!

    Hmm, there might be a packages missing, did you check if you have done everything on http://source.android.com/source/initializing.html ?
    3
    okay here's what happened:

    i changed files under my /hardware/cm/audio which made it build with mine but not yours. the deal is the audio under cm/audio makes audio.primary.(whatever the bootloader name is) so ours would be otter. in the mk file in the device folder, we create a library called audio.primary.otter. you cannot build files with the name so it was barking that it audio.primary.otter has two different locations. luckily for us, when mediaserver calls for the audio.primary library, it can use audio.primary.otter OR audio.primary.omap4430 which is our board, so instead i changed the name of the target library to audio.primary.omap4430 and that will be the new name for our audio.primary library :)
    2
    I have the same problem while syncing too

    Sent from my Galaxy Nexus using XDA App
    2
    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