1. Are you ready for the Galaxy S20? Here is everything we know so far!

Yet another "How-to" build, MTDEV style

Discussion in 'Android Devices' started by dsmryder, Dec 18, 2012.

  1. dsmryder

    dsmryder Android Expert
    Thread Starter

    As I sence a resergance in the desire to build ROMs from source, I decided to remake the HOW-TO. This is taken from the MTDEV website set up by g60madman. (Thanx Bra)

    Developing can be adicting! It can also give you bags under your eyes, put an arch in your back, and give you carple tunnle syndrom. You have been warned!

    Everything I put, in this post, into code boxes can be coppied and pasted. If I put it in a "notepad box" I am being more general and you will need to read what I am trying to get across. I can explain on later posts.
    Some things to understand, if I use a dollar sign ($) it is run from the terminal as a normal user. If I use a pound sign (#) it is run from the root account.

    First of all, all of my work is done on Ubuntu 10.04 64-bit desktop edition with a multi core and processor workstation with 8GB of RAM. It can be done on other versions of Linux, but I don't do it and will have trouble with helping you. I hope I don't need to help anybody setting the OS side of things.

    After you set up the OS, you will need to prepare the system. Go to System->Administration->Software Sources. On the “Other Software” tab, check the box next to http://archive.canonical.com/ ubuntu lucid partner and close.

    Now we can install the software to build and compile and whatnot.
    Open a terminal. (ctrl + alt + t) and you will get a propt($).

    We'll start with git. Git is a system for managing source codes that can work well in a bunch of way... anyway, we'll get to that.

    Code (Text):
    1. sudo add-apt-repository ppa:git-core/ppa
    This adds the repository so you can install it
    Code (Text):
    1. sudo apt-get update
    You will need to enter your passwod from time to time.
    Now that your repositories have been updated, you can proceed with installing the required packages.
    Code (Text):
    1. sudo apt-get install git gnupg flex bison gperf build-essential
    2. sudo apt-get install curl zlib1g-dev libc6-dev lib32ncurses5-dev ia32-libs
    3. sudo apt-get install pax11proto-core-dev libx11-dev lib32z-dev
    4. sudo apt-get install libgl1-mesa-dev g++-multilib mingw32 tofrodos
    5. sudo apt-get install python-markdown libxml2-utils xsltproc
    6. sudo apt-get install zip lib32readline5-dev
    Then you will need to install Java 6 JDK
    Code (Text):
    1. sudo apt-get install python-software-properties
    2. sudo add-apt-repository ppa:ferramroberto/java
    3. sudo apt-get update
    4. sudo apt-get install sun-java6-jdk sun-java6-plugin
    5. sudo apt-get install schedtool
    Now you need to download the source for what you want to build.
    First you will need to install "repo". It's a script that does a ton of work for you.
    For that you need to make a directory for it under your account. I would highly recommend not working out of your ROOT account. It's very bad practice. Your propt should still be something like this[HIGH]user@computername~(current path)$[/HIGH]
    the tilda (~) represents your home directory. Basicly /home/(user).
    So make the directory
    Code (Text):
    1. mkdir ~/bin
    Then add the path to your variables
    Code (Text):
    1. PATH=~/bin:$PATH
    Sometimes this won't stick and you will need to modify your bash (the terminal you are working under) initiator script, .bashrc (the period os sopposed to be there). It's hidden from the gnome visability so if you are looking for it you will need to unhide it with (crtl + h). So at the bottom add [HIGH]export PATH=$PATH:/home/(user)/bin[/HIGH]
    After setting that up
    Code (Text):
    1. curl [URL="https://dl-ssl.google.com/dl/googlesource/git-repo/repo"][COLOR=#0066cc]https://dl-ssl.google.com/dl/googlesource/git-repo/repo[/COLOR][/URL] > ~/bin/repo
    2. chmod a+x ~/bin/repo
    Now you have all of the tools. The next part depends on what you want to work with. I'll use CM7 as an example. Make a "working directory" and change to it
    Code (Text):
    1. mkdir cm7
    2. cd cm7
    Initialize the directory
    Code (Text):
    1. repo init -u [URL="https://github.com/MTDEV-CM7/cm7.git"][COLOR=#0066cc]https://github.com/MTDEV-CM7/cm7.git[/COLOR][/URL] -b cm7
    For CM7
    Code (Text):
    1. repo init -u git://github.com/MTCM9/android.git -b ics
    For CM9
    And then download all that source code
    Code (Text):
    1. repo sync
    That part will take quite a while. I recommend doing it and going to bed.
    When you wake up in the morning you should have no errors and will be able to build right away.
    Code (Text):
    1. . build/envsetup.sh && brunch triumph -j'grep 'processor' /proc/cpuinfo | wc -l'
    This sets up the enviroment and gets it running.
    The "-j" part splits up the build into jobs for the system to run semi-simultaneously. The rest of that looks to see how many logicle processors you have and thus how many jobs the computer can run.

    So there you have it. That should get things going. I hope people will ask lots of questions and we can hopefully move things along in 2013.

    I don't know about you guys, but I like the monitor on my main rig, so I use Teamviewer to connect either with one of my computers or on my phone (Deving at work, WHAT!)


    1. Download the Forums for Android™ app!


  2. MikeRL

    MikeRL Android Enthusiast

    When I do my FAQ update, I should probably add this if that's OK with you. Before it gets buried on the forums.
  3. dsmryder

    dsmryder Android Expert
    Thread Starter

    It's OK with me. I coppied a bunch from the MTDEV website. I just tried to make it semi general and thought that some of the community was thinking about it.
  4. g60madman

    g60madman Guest


    You may want to check out my updated environment setup, it has some extra stuff which allows the build to be optimized, and also a new version of git. So you will want to delete your bin folder in your home directory after updating it.

    EnvironmentSetup - htc-evov4g - Setting up your Ubuntu 10.04 environment - Virgin Mobile HTC Evo V 4G Devlopment - Google Project Hosting

    You also should be able to log into the MTDEV Wiki as I added you and the rest of Team MTDEV to update it. That includes you MikeRL
    dsmryder likes this.
  5. dsmryder

    dsmryder Android Expert
    Thread Starter

    Ok, I just updated the tut to reflect the changes that g60 suggested and added the note on teamviewer.
  6. Ken2Chill

    Ken2Chill Well-Known Member

    Can I use this on ubuntu 12.10? or will I have to change things.
  7. dsmryder

    dsmryder Android Expert
    Thread Starter

    Yeah, there's a lot of differences. Google has a setup for all of the versions. And there are some other things that are different. I would stay with 10.04 sense we know that works.
  8. dsmryder

    dsmryder Android Expert
    Thread Starter

    So today I decided to start over with my workstation. I am using the instructions that I have posted and will be testing it out personally.

    Ubuntu is loading as I type and will continue on the workstation.
  9. Ken2Chill

    Ken2Chill Well-Known Member

    when ever i try to to install Java 6 JDK, it ask me if i want to [Y/n] I type in Y but it still aborts...
  10. chilz

    chilz Well-Known Member

    type the full word yes i have dealt with the same error
  11. dsmryder

    dsmryder Android Expert
    Thread Starter

    That's weird, I don't type anythin else other than "y". I leave it as a lower case and everything. In fact I just did it yesterday and it worked. Ken2Chill, are you using Ubuntu 10.04?

    And I'm downloading the source now.

    And I'm building it now
  12. Ken2Chill

    Ken2Chill Well-Known Member

    Yes... I'm dual booting it with windows 8. BTW my native Ethernet isn't working. Im tethering
  13. dsmryder

    dsmryder Android Expert
    Thread Starter

    The native ethernet may have a driver that's not open source or too new. Have you ran a search on it? The relaibility of cell data connections will almost ensure you will have errors and major headachs.
  14. Ken2Chill

    Ken2Chill Well-Known Member

    I've read on "dd wrt" but it seems that Ubuntu isnt even reading the router. ( it "Seems" like it, im fairly new to Linux and I'm using "network tools" to check it.) and im not ready to brick my routor it seems pretty difficult. oh and if you would like to check out my set-up and possibly help me troubleshoot, we can set up some kind of remote view. I know that you don't have much time on your hands...
  15. Ken2Chill

    Ken2Chill Well-Known Member

    Its still not working, I don't know what to do, I wanna learn to start building lol.
  16. dsmryder

    dsmryder Android Expert
    Thread Starter

    I PMed you.
  17. DatNexus

    DatNexus Newbie

    I'm rockin linux mint 14. I'm actually really happy you guys use linux, as I have been using linux for well over 5 years, and know it better than any windows crap. Hope this works with all the ubuntu repo's you mentioned...
  18. DatNexus

    DatNexus Newbie

    Hey DSM I already have openJDK 7. Will this work for all Java compilation/running needs?
  19. dsmryder

    dsmryder Android Expert
    Thread Starter

    I don't think so. If you go to the developement website, they specify Java 1.6. If you are working with FroYo and earlier, 1.5. Also, they keep a revision of the old (1.5 and 1.6) in some repos and have you setup access to them.

    I know b_random14 was trying to use openJDK, though what version I don't know. I know he had some trouble with it. Maybe if he passes by he can comment on it.
  20. Ken2Chill

    Ken2Chill Well-Known Member

    I can get ethernet on peppermint os... so maybe its not linux?...
  21. DatNexus

    DatNexus Newbie

    I decided to just get another HDD from the magical basement of magic and loaded it up with 10.04. BTW dsm, your huge install command did not work right. It only installed the first three packages. I had to install them all individually, but it did work after that. Also, where are the CM9 and CM10 repos? When I searched on Github all I found was an MTDEV CM10 repo that 404'ed when I tried to add it and a TON of CM9 kernels from both MTDEV and Mantera.

    EDIT: NVM on the CM10, I got that working. I still cannot find the cm9 repo though.
  22. dsmryder

    dsmryder Android Expert
    Thread Starter

    I'll have to dig up the CM9 repo link. I know g60 deleted the one I was a part of, but I can redo it if nessacery.
  23. BSydz

    BSydz Android Expert

    Here you go

    repo init -u git://github.com/MTCM9/android.git -b ics
  24. DatNexus

    DatNexus Newbie

    Thank you! Sweet. What exactly should I do now that I have my repos synced? Where do I even start? So many folders lol.
  25. dsmryder

    dsmryder Android Expert
    Thread Starter

    The first thing I would do is just build a ROM with the code that's there. That way you know it works and have a base to start on. Also, do you know how to use git? If not look at my git and github questions thread.

    Once you have an idea that you want to work with, just make a new branch and code away.

Motorola Triumph Forum

Features and specs are not yet known.

Release Date

Share This Page