Compile AOSP From Source - Semi-Complete Guide (it worked for me!)

This is a discussion on Compile AOSP From Source - Semi-Complete Guide (it worked for me!) within the Beginning Developers forums, part of the Android Development category; Wrote this up while doing it, so it's by no means my best work, but devs should love screwing around with this stuff anyway. Please ...

Page 1 of 4 123 ... LastLast
Results 1 to 10 of 39
Like Tree1Likes

Thread: Compile AOSP From Source - Semi-Complete Guide (it worked for me!)

  1. #1
    Android Sr Member maderschramm's Avatar
    Join Date
    Jan 2011
    Location
    Madison, WI
    Posts
    100
    Thanked
    7 times

    Thumbs up Compile AOSP From Source - Semi-Complete Guide (it worked for me!)

    Wrote this up while doing it, so it's by no means my best work, but devs should love screwing around with this stuff anyway. Please don't pm me asking me for help because I probably can't help you... :S sorry.

    Expect this to take ~3 hours

    This is for ubuntu 11.04 64 bit. If you have a different version upgrade. It might work, I don't know. If you have 32-bit you need 64, sorry.

    Directions are from here:
    Get Android Source Code | Android Open Source
    But I made them work for me.

    I use vim, you should too. If you'd rather use gedit, simply replace [vim] with [gedit] in the commands.

    All these commands are run in a terminal window. When you're supposed to type something, I have it listed with brackets - [] - everything else is descriptive. NEVER INCLUDE BRACKETS UNLESS SPECIFIED (which is never, just fyi)!!!

    I'm no expert, but this worked for me, so it should for you too, these are simply the way I did it so don't expect many updates or a lot of support, I just did it as a favor.

    Good luck!

    Note: All commands are run in a terminal window - if you don't know what that is, learn how to use linux before proceeding.

    ------------------
    Set Up Machine
    ------------------

    • [sudo apt-get install vim]
    • [sudo vim /etc/apt/sources.list]
      • (opens sources for ubuntu)



    press "insert" to allow inputting into the file

    scroll to bottom
    press "enter" to get a new line

    add:




    to bottom of list

    press "escape" to quit input mode
    type ":w" "enter" to save
    type ":q" "enter" to quit

    • [sudo aptitude update]
      • (update repository list)




    • [sudo apt-get install git-core gnupg flex bison gperf build-essential zip curl sun-java5-jdk zlib1g-dev gcc-multilib g++-multilib libc6-dev-i386 lib32ncurses5-dev ia32-libs x11proto-core-dev libx11-dev lib32readline5-dev lib32z-dev]
      • (installs sh--)



    • [sudo update-java-alternatives -s java-1.5.0-sun]
      • (set java 1.5 default)




    • [sudo ln -s /usr/lib32/libX11.so.6 /usr/lib32/libX11.so]
      • (symlynk to workaround lack of packages for X11)



    --------------------
    Installing Repo
    --------------------

    you need to have a ~/bin/ file that is in your path. change to home dir


    • [cd ~]
    • [ls]


    if you don't see a "bin" dir:


    • [mkdir bin]
    • [ls]


    you should now see a "bin" dir

    now type


    • [echo $PATH]


    you should see "~/bin" somewhere in your path, if not:


    • [sudo vim /etc/profile]


    press "insert" to switch to edit mode
    scroll to bottom of the file
    press enter to get to a new line
    enter:


    • PATH="/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin:/usr/bin/X11:/usr/games:~/bin"


    press "esc" to get out of input mode
    press ":" then "w" "enter" to save the file
    press ":" then "q" "enter "to quit

    run /etc/profile to make your changes


    • [. /etc/profile]
      • (note that there's a space character between "." and "/")



    download the Repo and put it into /bin:




    make it executable


    • [chmod a+x ~/bin/repo]


    ----------------------
    Initializing Repo
    ----------------------

    make a working directory somewhere on your computer, eg:


    • [mkdir mydroid]


    change to the directory


    • [cd mydroid]


    you can make it wherever you want however. Mine is:
    "~/Documents/AOSP"

    inside your directory, run repo init


    • [repo init -u git://android.git.kernel.org/platform/manifest.git]


    this installs a master copy. if you want a different version, use the modifier -b, eg:

    [repo init -u git://android.git.kernel.org/platform/manifest.git -b cupcake]

    When prompted, configure Repo with your real name and email, make your email address your one that is associated with your google account if you plan to submit code

    ----------------------
    Get ze Files!!!
    ----------------------


    • [repo sync]


    now ve vait....a long time

    ----------------------
    Verifying Git Tags
    ----------------------


    • [gpg --import]


    paste the following into the terminal (ctrl + shift + v):
    Code:
    -----BEGIN PGP PUBLIC KEY BLOCK-----
    Version: GnuPG v1.4.2.2 (GNU/Linux)
    
    mQGiBEnnWD4RBACt9/h4v9xnnGDou13y3dvOx6/t43LPPIxeJ8eX9WB+8LLuROSV 
    lFhpHawsVAcFlmi7f7jdSRF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YxAmHYX79EMKHDSThf/8AAwUIAJPWsB/M 
    pK+KMs/s3r6nJrnYLTfdZhtmQXimpoDMJg1zxmL8UfNUKiQZ6esoAWtDgpqt7Y7s 
    KZ8laHRARonte394hidZzM5nb6hQvpPjt2OlPRsyqVxw4c/KsjADtAuKW9/d8phb 
    N8bTyOJo856qg4oOEzKG9eeF7oaZTYBy33BTL0408sEBxiMior6b8LrZrAhkqDjA 
    vUXRwm/fFKgpsOysxC6xi553CxBUCH2omNV6Ka1LNMwzSp9ILz8jEGqmUtkBszwo 
    G1S8fXgE0Lq3cdDM/GJ4QXP/p6LiwNF99faDMTV3+2SAOGvytOX6KjKVzKOSsfJQ 
    hN0DlsIw8hqJc0WISQQYEQIACQUCSedYRAIbDAAKCRDorT+BmrEOeCUOAJ9qmR0l 
    EXzeoxcdoafxqf6gZlJZlACgkWF7wi2YLW3Oa+jv2QSTlrx4KLM=
    =Wi5D 
    -----END PGP PUBLIC KEY BLOCK-----
    to end input process, type


    • [ctrl + d]


    Now you can validate anything by typing

    [git tag -v (tagname)]
    where (tagname) is defined by you

    ----------------
    Build the Code
    ----------------

    From within your working directory (eg mydroid), type:


    • [source build/envsetup.sh]
    • [lunch]
      • (you have some options here, press "enter" to select "full-eng")

    • [make]


    I got an error telling me "Your version is: java version "1.5.0_19". The correct version is: 1.6."

    Which means google lied, so now I set my java back to 1.6


    • [sudo apt-get install sun-java6-jdk]
      • (installs java 6 jdk)



    and then re-ran the command to build


    • [make]


    wait for awhile...

    and you're done! congrats... maybe?

    as I said, good luck!

    edit: cleaned up the formatting a bit
    Last edited by maderschramm; 01-22-2011 at 08:14 PM.
    Dorian likes this.
    <- ignore the dancing android - I want to murder everyone

  2. Android.net is the premier Android Forum. Registered users do not see these ads. .

  3. #2
    Super Moderator Dorian's Avatar
    Join Date
    Jan 2011
    Location
    between 850-1900MHz
    Posts
    885
    Thanked
    71 times
    Twitter
    @Dorian_At_ATT
    Your initial "sudo-apt-get" from the repo is all 32-bit, so 32-bit versions of Ubuntu should run this just fine.

    Nice writeup!

    Need Assistance? Contact me at dorian@android.net

  4. #3
    Super Moderator Droid-Xer's Avatar
    Join Date
    Jan 2011
    Location
    El Paso, TX
    Posts
    2,239
    Thanked
    59 times
    Twitter
    _B0BB0_
    Damn Mader! Makes me wanna get Ubuntu up and running just to play around with this...great write up!

  5. #4
    Android Sr Member maderschramm's Avatar
    Join Date
    Jan 2011
    Location
    Madison, WI
    Posts
    100
    Thanked
    7 times
    That's what I thought, but when I ran [make] at my work 9.10 32 bit I got an error stating that the later version (I assume gingerbread) can only be compiled on 64 bit. Theoretically you could compile froyo with -b froyo, but I cannot confirm or deny this.

    Quote Originally Posted by Dorian View Post
    Your initial "sudo-apt-get" from the repo is all 32-bit, so 32-bit versions of Ubuntu should run this just fine.

    Nice writeup!


    Sent from my DROIDX using Android.net App
    <- ignore the dancing android - I want to murder everyone

  6. #5
    Android Sr Member maderschramm's Avatar
    Join Date
    Jan 2011
    Location
    Madison, WI
    Posts
    100
    Thanked
    7 times
    Thanks x-er! Do it! Linux pwns

    Quote Originally Posted by Droid-Xer View Post
    Damn Mader! Makes me wanna get Ubuntu up and running just to play around with this...great write up!


    Sent from my DROIDX using Android.net App
    <- ignore the dancing android - I want to murder everyone

  7. #6
    Super Moderator Droid-Xer's Avatar
    Join Date
    Jan 2011
    Location
    El Paso, TX
    Posts
    2,239
    Thanked
    59 times
    Twitter
    _B0BB0_
    I'll have to put my training wheels on! Lol

  8. #7
    Super Moderator Dorian's Avatar
    Join Date
    Jan 2011
    Location
    between 850-1900MHz
    Posts
    885
    Thanked
    71 times
    Twitter
    @Dorian_At_ATT
    Quote Originally Posted by maderschramm View Post
    That's what I thought, but when I ran [make] at my work 9.10 32 bit I got an error stating that the later version (I assume gingerbread) can only be compiled on 64 bit. Theoretically you could compile froyo with -b froyo, but I cannot confirm or deny this.

    Sent from my DROIDX using Android.net App
    Interesting. I've been using Fedora. Ima have to give Ubuntu a go to see what it's like!

    Need Assistance? Contact me at dorian@android.net

  9. #8
    Android Sr Member maderschramm's Avatar
    Join Date
    Jan 2011
    Location
    Madison, WI
    Posts
    100
    Thanked
    7 times
    It's super easy to use. Love it. Huge support community as well. The support and ease of use it what really wins me - plus I use it for work so I like to keep everything together. I was thinking of trying xubuntu but then realized I didn't really care and am just going to stick with what I know

    Tell me what you think of the distro!
    <- ignore the dancing android - I want to murder everyone

  10. #9
    Themer cush2push's Avatar
    Join Date
    Jan 2011
    Location
    new mexicos
    Posts
    48
    Thanked
    1 times
    im using ubuntu 10.10 for my builds its a pretty sweet system takes a minute to get used to froyo requires 1.5 as primary you can use 1.6 for gingerbread just use
    Code:
      sudo update-alternatives --config java
    Code:
    sudo update-java-alternatives -s java-1.5.0-sun
    to make java 1.5 default for froyo
    CUSHZERO
    IS
    COMING
    ARE YOU
    READY

  11. #10
    Developer davros's Avatar
    Join Date
    Jan 2011
    Posts
    3
    yes gingerbread is a 64bit build only

Page 1 of 4 123 ... LastLast

Remove Ads

http://www.scramblerducati.org/

Sponsored Links

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

Similar Threads

  1. Replies: 13
    Last Post: 01-26-2011, 09:12 PM
  2. Complete Droid X .sbf Flashing Guide
    By maderschramm in forum Motorola Droid X
    Replies: 11
    Last Post: 01-19-2011, 08:46 PM
  3. [Droid X Guide] Undervolting Guide
    By xrazedx in forum Android Rooting
    Replies: 1
    Last Post: 01-14-2011, 05:53 PM
  4. AOSP Will Have Gingerbread 2.3 Source Today
    By danDroid in forum Android News
    Replies: 0
    Last Post: 12-28-2010, 04:27 PM
  5. HTC Desire HD Source Code Released
    By DF Member in forum HTC Desire
    Replies: 0
    Last Post: 10-25-2010, 01:55 PM

Search tags for this page

build aosp from source

,
build aosp gingerbread
,
build aosp ubuntu 11.04
,

building aosp from source

,
building aosp on snow leopard
,

compile aosp

,

compile aosp from source

,
compiling aosp
,
compiling aosp from source
,
compiling aosp on redhat
,
how to build aosp for htc desire
,

how to build aosp from source

,

how to compile aosp

,
how to compile aosp from source
,
yet build aosp
Click on a term to search our sites for related topics.
Android Forum