How to Compile an android based ROM

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

  1. woodyman
    Offline

    woodyman New Member Developer

    Joined:
    Jan 27, 2010
    Messages:
    1,610
    Likes Received:
    4
    Trophy Points:
    0
    Location:
    Ohio
    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
    Offline

    Tanknspank Beta Team Premium Member

    Joined:
    Jan 13, 2010
    Messages:
    3,506
    Likes Received:
    0
    Trophy Points:
    0
    Location:
    North Carolina
    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
    Offline

    Discover New Member

    Joined:
    Jun 16, 2010
    Messages:
    41
    Likes Received:
    0
    Trophy Points:
    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
    Offline

    UltraDroid DF Super Moderator Staff Member

    Joined:
    Apr 21, 2010
    Messages:
    2,643
    Likes Received:
    127
    Trophy Points:
    63
    Location:
    Cleveland, Ohio - The North Coast!
    Woodyman, you're turning into a virtual encyclopedia of Droid knowledge! :)

    -Mike
  5. woodyman
    Offline

    woodyman New Member Developer

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

    Thank you my friend.. :D
  6. Abe21599
    Offline

    Abe21599 DF Super Moderator Rescue Squad

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

    woodyman New Member Developer

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


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

    Discover New Member

    Joined:
    Jun 16, 2010
    Messages:
    41
    Likes Received:
    0
    Trophy Points:
    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
    Offline

    tcrews Premium Member Premium Member Developer

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


  10. Discover
    Offline

    Discover New Member

    Joined:
    Jun 16, 2010
    Messages:
    41
    Likes Received:
    0
    Trophy Points:
    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
    Offline

    tcrews Premium Member Premium Member Developer

    Joined:
    Jan 27, 2010
    Messages:
    1,354
    Likes Received:
    22
    Trophy Points:
    38
    Location:
    Lexington, SC
    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
    Offline

    Discover New Member

    Joined:
    Jun 16, 2010
    Messages:
    41
    Likes Received:
    0
    Trophy Points:
    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
    Offline

    burgeke New Member

    Joined:
    Aug 4, 2010
    Messages:
    63
    Likes Received:
    0
    Trophy Points:
    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
    Offline

    tjkriegel New Member

    Joined:
    Mar 6, 2010
    Messages:
    153
    Likes Received:
    0
    Trophy Points:
    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
    Offline

    tcrews Premium Member Premium Member Developer

    Joined:
    Jan 27, 2010
    Messages:
    1,354
    Likes Received:
    22
    Trophy Points:
    38
    Location:
    Lexington, SC
    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?
  16. tjkriegel
    Offline

    tjkriegel New Member

    Joined:
    Mar 6, 2010
    Messages:
    153
    Likes Received:
    0
    Trophy Points:
    0
    Did that... I think I'm just going to wipe it clean and start over, see where it takes me this time! Thanks for trying to help.
  17. woodyman
    Offline

    woodyman New Member Developer

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

    like t said, you have to do this step..
    https://sites.google.com/site/teamdroidconcepts/experimental/compile/h-basic-vendor-setup

    if you did, just retry the step, and if you still can't get it, post and let me know, but it seems like your proprietary files, didn't get set up right..
  18. woodyman
    Offline

    woodyman New Member Developer

    Joined:
    Jan 27, 2010
    Messages:
    1,610
    Likes Received:
    4
    Trophy Points:
    0
    Location:
    Ohio
    the checkprereq you don't have to delete, just the recovery folder.
  19. tjkriegel
    Offline

    tjkriegel New Member

    Joined:
    Mar 6, 2010
    Messages:
    153
    Likes Received:
    0
    Trophy Points:
    0
    That's where the problem was. At . extract-files.sh I was getting this:

    remote object '/system/lib/modules/act_mirred.ko' does not exist
    remote object '/system/lib/modules/act_police.ko' does not exist
    remote object '/system/lib/modules/cls_u32.ko' does not exist
    remote object '/system/lib/modules/em_u32.ko' does not exist
    remote object '/system/lib/modules/ifb.ko' does not exist
    remote object '/system/lib/modules/sch_htb.ko' does not exist
    remote object '/system/lib/modules/wl127x_test.ko' does not exist

    Reinstalled rom on phone and tried again and all went well.

    Thanks tcrews!
    Thanks for the help and great guide Woody!
  20. burgeke
    Offline

    burgeke New Member

    Joined:
    Aug 4, 2010
    Messages:
    63
    Likes Received:
    0
    Trophy Points:
    0
    Thank you! Any idea how I clean up after a build prior to building again? Or maybe it is not needed.
Search tags for this page
android compile browser
,
android lunch menu... pick a combo
,
android make error base rules.mk module.target.static librar
,
android rom compile
,
build/core/base rules.mk:130
,
compile android for motorola
,

compile android rom

,

how to compile a rom

,

how to compile android rom

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