How to Compile an android based ROM

Discussion in 'Droid Concepts' started by woodyman, Sep 19, 2010.

  1. woodyman

    woodyman Senior Member Developer

    Joined:
    Jan 27, 2010
    Messages:
    1,610
    Likes Received:
    4
    Trophy Points:
    68
    Location:
    Ohio
    Ratings:
    +4
    An alternative guide to the one put together by CVPCS, and sniffle can be found at the link below...

    https://sites.google.com/site/teamdroidconcepts/experimental/compile

    The information found in this guide is from http://source.android.com/, and http://howto.ccroms.net/
    It has been edited and revised in parts and left alone in others, and parts have been added and removed where Droid Concepts has seen fit. We also tried to give more detailed explanations to all the steps, to help the average person better understand what they are doing with all these commands.

    CVPCS and Sniffle wrote a great guide, and this is not meant to replace it, or say theirs is wrong. This is just another alternative to the one that they have produced, and Droid Concepts thanks them for their dedication to the android community.
     
    Last edited: Sep 19, 2010
  2. Tanknspank

    Tanknspank Beta Team Premium Member

    Joined:
    Jan 13, 2010
    Messages:
    3,506
    Likes Received:
    0
    Trophy Points:
    151
    Location:
    North Carolina
    Ratings:
    +0
    Afaik, the origional guide was written by sniffle13, and not cvpcs. Otherwise I plan on reading through to see what you have come up with :)

    Sent from my Droid
     
  3. Discover

    Discover Member

    Joined:
    Jun 16, 2010
    Messages:
    41
    Likes Received:
    0
    Trophy Points:
    6
    Ratings:
    +0
    i cant even begin to thank you enough for putting this information together.


    thank you
    thank you
    thank you
    thank you
    thank you
    thank you
    thank you
    thank you
    thank you
     
  4. UltraDroid

    UltraDroid DF Super Moderator Staff Member

    Joined:
    Apr 21, 2010
    Messages:
    2,623
    Likes Received:
    234
    Trophy Points:
    143
    Location:
    Cleveland, Ohio - The North Coast!
    Ratings:
    +251
    Woodyman, you're turning into a virtual encyclopedia of Droid knowledge! :)

    -Mike
     
  5. woodyman

    woodyman Senior Member Developer

    Joined:
    Jan 27, 2010
    Messages:
    1,610
    Likes Received:
    4
    Trophy Points:
    68
    Location:
    Ohio
    Ratings:
    +4

    Thank you my friend.. :D
     
  6. Abe21599

    Abe21599 DF Super Moderator Rescue Squad

    Joined:
    Dec 22, 2009
    Messages:
    6,334
    Likes Received:
    30
    Trophy Points:
    163
    Location:
    Ohio
    Ratings:
    +30
    wow very impressive. looks like i got something to read tomorrow :)
     
  7. woodyman

    woodyman Senior Member Developer

    Joined:
    Jan 27, 2010
    Messages:
    1,610
    Likes Received:
    4
    Trophy Points:
    68
    Location:
    Ohio
    Ratings:
    +4


    lol, ive got to clean up a few portions, was more worried about getting it done at the time..
     
  8. Discover

    Discover Member

    Joined:
    Jun 16, 2010
    Messages:
    41
    Likes Received:
    0
    Trophy Points:
    6
    Ratings:
    +0
    ive followed this guide to a T however im stuck at this point.


    cd ~
    cd android/system
    . build/envsetup.sh
    lunch


    choose option 6 for the Motorola Droid


    im only getting 3 options.



    You're building on Linux

    Lunch menu... pick a combo:
    1. generic-eng
    2. simulator
    3. generic_sholes-userdebug

    ive looked around and cant really figure out where i went wrong. i went back and redid some steps.. but i still cant get an option 6.

    any help would be greatly appreciated as ive already learned so much from this great guide i would love to finish it :)

    Thanks in Advanced :)
     
  9. tcrews

    tcrews Premium Member Premium Member Developer

    Joined:
    Jan 27, 2010
    Messages:
    1,353
    Likes Received:
    22
    Trophy Points:
    38
    Location:
    Lexington, SC
    Ratings:
    +22
    Option 3 for you is generic_sholes-userdebug. That is normally option 6.


     
  10. Discover

    Discover Member

    Joined:
    Jun 16, 2010
    Messages:
    41
    Likes Received:
    0
    Trophy Points:
    6
    Ratings:
    +0
    I found out what the issue was.. ive followed this guide exactly a total of 6 times.

    to be fair ive only installed linux twice, the first time was to follow the original start [CVPCS Android Wiki] however it was to "guru" for me if you will. initially i gave up, However when i saw this guide and it was broken down and explained a little more i got instantly hooked again.

    i have an extensive back ground in windows environment and ive had to dissect and learn and research items on linux to get awnsers from gaps or things i need further explanation of in this learning experience thats called linux.

    Im Running Ubuntu 10.04 LTS- the Lucid Lynx

    First problem i ran into was this line.

    tar -zxvf ~/Downloads/android-sdk_r07-linux_x86.tgz.tar i could never get this to un-tar for me. but i found that removing the ".tar" the file unpacked just fine.

    "This guide will setup your android related build files (excluding Eclipse) into the android subdirectory which will be located in the home folder. This is designed to keep the build environment clean and centralized, and very easy to navigate."

    The problem i posted before about the "lunch option 6 command" was because whenever i ran the mkdir command it would be put into my home folder. eventually i thought well... if im running a command from the ~/android/system folder maybe all these other things in the home folder need to be moved to the android system folder. after i did this, i was able to get the 1-6 options. and the android source would load into Eclipse with no errors. and i was able to make the files. then add the files to the Make otapackage.

    im not sure why i was having the home folder issue.. for a while i thought it had to do with the

    export PATH=${PATH}:~/android/sdk/tools

    and that i wasnt adding it correctly but after 2 hours of research and trial and error i found no matter what i did i still had to move the files from home to ~/android/system.

    without everything in android/system i would get a TON of make errors and warnings. also Eclipse wouldnt load the source correctly and would report errors.

    Also when i do the make command, it tells me that i should have added superuser to core.mk instead.

    after all this i was able to run a successful make.
    then run a make otapackage
    there were no errors and it completed with "done"

    the zip file was a 57meg file that i renamed to update.zip and ran recovery but it loops on the android screen.

    I hate to be the guy that keeps asking for help. but i want to learn this and im doing everything i can to not be here asking all the time.

    Any help would be greatly appreciated. :)
     
  11. tcrews

    tcrews Premium Member Premium Member Developer

    Joined:
    Jan 27, 2010
    Messages:
    1,353
    Likes Received:
    22
    Trophy Points:
    38
    Location:
    Lexington, SC
    Ratings:
    +22
    If you add the path to .bashrc but don't close and open a new terminal window.....your current terminal window hasn't executed .bashrc so does not know your added path.

    as for the rest.....the size is about right. Open the .zip file and delete the recovery folder and it's contents.
    Remember, you are compiling an "open source" rom, so there will not be any of the proprietary Google applications (Gmail, Market, Maps, etc....).

    The statement on Superuser is just because how it's configured. Ignore it.
     
    Last edited: Sep 23, 2010
  12. Discover

    Discover Member

    Joined:
    Jun 16, 2010
    Messages:
    41
    Likes Received:
    0
    Trophy Points:
    6
    Ratings:
    +0
    Thanks Tcrews, i appreciate the help :)

    also i read somewhere on the ubuntu forums that even though you save the .bashrc file. it is recomended that you command "source .bashrc" to make sure it is loaded in the current shell that you are working on. i have been doing this but maybe its not the right thing to do. in any event i dont mind having to copy the contents over im just worried that i might miss something.

    Thanks for the replies i really appreciate it!!

    Discover
     
  13. burgeke

    burgeke Member

    Joined:
    Aug 4, 2010
    Messages:
    63
    Likes Received:
    0
    Trophy Points:
    6
    Ratings:
    +0
    Can't thank you enough! Always wanted to learn this. Followed the guide and am typing this from my first ROM.... a speedy one. I loaded P3's lv 125-1000 and used gapps from CM (there's a very recent one posted). As mentioned in a previous post, whack the recovery folder from the ota zip. I also whacked a checkprereq(?) file from the ota zip. Not sure what that is.

    Does anyone know how to 'clean' the build environment similar to how a linux kernel is compiled?

    Thanks
     
  14. tjkriegel

    tjkriegel Member

    Joined:
    Mar 6, 2010
    Messages:
    153
    Likes Received:
    0
    Trophy Points:
    16
    Ratings:
    +0
    I'm getting this when executing make:

    make: *** No rule to make target `vendor/motorola/sholes/proprietary/act_mirred.ko', needed by `out/target/product/sholes/system/lib/modules/act_mirred.ko'. Stop.


    Any ideas?
     
  15. tcrews

    tcrews Premium Member Premium Member Developer

    Joined:
    Jan 27, 2010
    Messages:
    1,353
    Likes Received:
    22
    Trophy Points:
    38
    Location:
    Lexington, SC
    Ratings:
    +22
    have you attached your phone to the system and run the extract_files.sh to pull the proprietary files which also creates the vendor/motorola folder and required .mk files?
     
Search tags for this page
android compile browser
,
android lunch menu... pick a combo
,
android rom compile
,
build/core/base rules.mk:130
,

compile android rom

,

how to compile a rom

,

how to compile android rom

,
lunch menu... pick a combo
,
module.target.static libraries
,
rom compiler