1. Download our Official Android App: Forums for Android!

Root [GUIDE] Building CM from source with Ubuntu 12.04 64bit

Discussion in 'Android Devices' started by totlth, Aug 10, 2013.

  1. totlth

    totlth Android Enthusiast
    Thread Starter
    Rank:
    None
    Points:
    143
    Posts:
    559
    Joined:
    Oct 2, 2011

    Oct 2, 2011
    559
    388
    143
    Male
    Saint Petersburg, Florida
    Set up build environment:

    install JDK6-

    Open terminal and issue:
    sudo add-apt-repository ppa:webupd8team/java
    sudo apt-get update
    sudo apt-get install oracle-java6-installer

    Install android SDK-

    Download Android SDK
    Get the one for existing IDE
    Move downloaded file to home directory and extract it

    Install platform-tools-

    Goto android-sdk-linux/tools and double-click android and the click run in terminal
    Make sure platform-tools and build-tools are checked and click install

    Add paths for Android Tools-

    Goto home dir and hold "ctrl" and hit "h"
    open .bashrc
    Add these lines to top:
    export PATH=${PATH}:~/android-sdk-linux/tools
    export PATH=${PATH}:~/android-sdk-linux/platform-tools

    Add USB permissions-

    Download this file: 51-android.rules
    Open terminal and issue:
    sudo nautilus
    When file window opens, grab file you just downloaded and move it to:
    etc/udev/rules.d (note: click on File System then goto etc/udev/rules.d)

    Install build packages-

    Open terminal and issue:
    sudo apt-get install git gnupg flex bison gperf build-essential \
    zip curl libc6-dev libncurses5-dev:i386 x11proto-core-dev \
    libx11-dev:i386 libreadline6-dev:i386 libgl1-mesa-glx:i386 \
    libgl1-mesa-dev g++-multilib mingw32 tofrodos \
    python-markdown libxml2-utils xsltproc zlib1g-dev:i386 schedtool

    sudo ln -s /usr/lib/i386-linux-gnu/mesa/libGL.so.1 /usr/lib/i386-linux-gnu/libGL.so

    Install Repo-

    Open terminal and issue:
    mkdir bin
    PATH=~/bin:$PATH
    curl https://dl-ssl.google.com/dl/googlesource/git-repo/repo > ~/bin/repo
    chmod a+x ~/bin/repo

    Repo-notes:
    add "export PATH=${PATH}:~/bin" to your .bashrc so you don't have to add path everytime you reboot
    issue these two commands in terminal so you don't have to enter it each time:
    git config --global user.name "your-username"
    git config --global user.email your-email

    Reboot pc so paths and usb permissions are started.

    Download CM Source:

    Create a folder in your home dir for the source. I will be calling it source for this guide.
    Open terminal and issue:
    cd source
    repo init -u git://github.com/CyanogenMod/android.git -b cm-10.1
    repo sync

    Syncing repo takes a bit of time depending on your pc and internet speed.
    Once sync is completed issue:
    cd vendor/cm
    ./get-prebuilts (this downloads CM prebuilt stuff)
    cd ../../ (this takes you back to source root)
    cd device
    mkdir zte
    cd zte
    git clone https://github.com/totlth/cm10.1_device_zte_elden.git elden (this will clone the device tree into a folder named "elden")
    cd elden
    (make sure that both extract-files.sh and setup-makefiles.sh are executable & connect your phone to pc with usb cord)
    ./extract-files.sh (proprietary blobs)
    cd ../../../ (this takes you back to source root)
    cd hardware/qcom
    git clone https://github.com/totlth/cm10.1-elden_hardware_qcom_audio-legacy.git audio-legacy
    git clone https://github.com/totlth/cm10.1-elden_hardware_qcom_display-legacy.git display-legacy
    git clone https://github.com/totlth/cm10.1-elden_hardware_qcom_media-legacy.git media-legacy
    cd ../../ (this takes you back to source root)
    mkdir kernel
    cd kernel
    mkdir zte
    cd zte
    git clone https://github.com/totlth/android_kernel_zte_elden.git elden
    cd ../../ (this takes you back to source root)

    Start Build
    From source root dir issue:
    . build/envsetup.sh && brunch elden
    ---when the build completes, the flashable zip will be in source/out/target/product/elden

    In between builds make sure you clean out the last build
    From source root dir issue:
    make clobber

    The sources referenced in this guide assume you are building CM10.1 for ZTE Avid 4G

    Hope this helps and stay groovy yall.
    Any and all questions and comments are welcome.
     

    Advertisement

    GTurn, DjSidEShoW, Killah1994 and 4 others like this.
  2. dadcup

    dadcup Android Expert
    Rank:
     #139
    Points:
    103
    Posts:
    834
    Joined:
    Jan 29, 2012

    Jan 29, 2012
    834
    232
    103
    I want to know who build now we are working in the phone problem I have a few fix if someone is build let me know or post to share the link because I can only build weekends
     
  3. dadcup

    dadcup Android Expert
    Rank:
     #139
    Points:
    103
    Posts:
    834
    Joined:
    Jan 29, 2012

    Jan 29, 2012
    834
    232
    103
  4. dadcup

    dadcup Android Expert
    Rank:
     #139
    Points:
    103
    Posts:
    834
    Joined:
    Jan 29, 2012

    Jan 29, 2012
    834
    232
    103
  5. GTurn

    GTurn Android Enthusiast
    Rank:
    None
    Points:
    93
    Posts:
    602
    Joined:
    Apr 3, 2012

    Apr 3, 2012
    602
    100
    93
    Male
    Dallas, TX
    is anyone working on this?
     
  6. totlth

    totlth Android Enthusiast
    Thread Starter
    Rank:
    None
    Points:
    143
    Posts:
    559
    Joined:
    Oct 2, 2011

    Oct 2, 2011
    559
    388
    143
    Male
    Saint Petersburg, Florida
    Got cm10.1 to boot with init. It is stuck in loop tho. Getting closer with this one
     
  7. GTurn

    GTurn Android Enthusiast
    Rank:
    None
    Points:
    93
    Posts:
    602
    Joined:
    Apr 3, 2012

    Apr 3, 2012
    602
    100
    93
    Male
    Dallas, TX
    I want to start learning how to do this. So far I have followed the steps up to syncing the repos. Hopefully tonight I will be able to finish everything else and be able to get started. The repos took a long time to sync.
     
  8. GTurn

    GTurn Android Enthusiast
    Rank:
    None
    Points:
    93
    Posts:
    602
    Joined:
    Apr 3, 2012

    Apr 3, 2012
    602
    100
    93
    Male
    Dallas, TX
    ok. so i did everything in the tutorial. now what do i do?
     
  9. GTurn

    GTurn Android Enthusiast
    Rank:
    None
    Points:
    93
    Posts:
    602
    Joined:
    Apr 3, 2012

    Apr 3, 2012
    602
    100
    93
    Male
    Dallas, TX
    in the out/target/product/elden folder i have have a file called clean_steps.mk and one called previous_build_config.mk. is this correct?
     
  10. totlth

    totlth Android Enthusiast
    Thread Starter
    Rank:
    None
    Points:
    143
    Posts:
    559
    Joined:
    Oct 2, 2011

    Oct 2, 2011
    559
    388
    143
    Male
    Saint Petersburg, Florida
    Is that all that's there?
     
  11. GTurn

    GTurn Android Enthusiast
    Rank:
    None
    Points:
    93
    Posts:
    602
    Joined:
    Apr 3, 2012

    Apr 3, 2012
    602
    100
    93
    Male
    Dallas, TX

    Yes
     
  12. GTurn

    GTurn Android Enthusiast
    Rank:
    None
    Points:
    93
    Posts:
    602
    Joined:
    Apr 3, 2012

    Apr 3, 2012
    602
    100
    93
    Male
    Dallas, TX
    What do you mean when you say say to make sure the files are executable? I think this is where my problem is.
     
  13. totlth

    totlth Android Enthusiast
    Thread Starter
    Rank:
    None
    Points:
    143
    Posts:
    559
    Joined:
    Oct 2, 2011

    Oct 2, 2011
    559
    388
    143
    Male
    Saint Petersburg, Florida
    Right click on it an look at property tab and make sure its checked to allow executing as program
     
    GTurn likes this.
Tags:

Share This Page

Loading...