[GUIDE] How To Build CM9 From Source Code Ubuntu 11.10 64-Bit

Search This thread

deciple

Senior Member
Sep 22, 2010
325
45
Salem
In the out folder you repo synced....Cm9 in this tutorial....packages/apps......our framework for framework_res....So your looking for...Cm9/packages/apps
Broadcast to the public; to promote self awareness.
 
Last edited:
  • Like
Reactions: monstaX

monstaX

Senior Member
Dec 24, 2011
450
143
Texas
Sweet thanks,. I found the apps but I couldnt seem to find the framework-res. I want to modify that apk. There was no folder in there for framework. Any suggestions?
 

Tectas

Senior Member
Jul 26, 2011
3,344
2,942
Do you maybe also can lend me a hand and tell how i can merge the repo tree of an custom (cm9 based [also splitted in git repositories but no repo support or i do something wrong, but i don't want to clone them all myself if i can avoid it]) rom into the cm9 tree or the other way round?
 
Last edited:

deciple

Senior Member
Sep 22, 2010
325
45
Salem
Do you maybe also can lend me a hand and tell how i can merge the repo tree of an custom (cm9 based [also splitted in git repositories but no repo support or i do something wrong, but i don't want to clone them all myself if i can avoid it]) rom into the cm9 tree or the other way round?

Repo sync another folder

Broadcast to the public; to promote self awareness.
 

wtogami

Retired Recognized Developer
Dec 6, 2010
312
1,082
CM Dev Training and Recruitment

Hey folks,

We have an invite-only IRC channel on irc.irondust.net to act as an incubator to help train new developers to understand CM9 to eventually become productive CM developers.

Epic IRC Discussion Channels
  1. General Public #epic channel on irc.irondust.net
  2. Incubator Channel (invite only)
  3. Epic CM Team Channel (invite only)

Requirements for Incubator Channel

  • We would prefer to invite people only after they have demonstrated enough Linux knowledge to setup the build environment and to successfully build CM9.
  • In order to fix bugs in the source code, you need to learn an intermediate level of Java and C programming languages and how to use git. We unfortunately cannot teach you how to use Linux or how to code. For those that have some coding skills this is a great opportunity to grow your skills by practicing on a fun project that benefits many other people.
  • The devs are very busy so there is a limited amount of energy we can devote to helping the incubator trainees. You must have patience and able to sit in IRC all day as answers to questions may happen only when developers have time to answer.

How to Apply
If you meet the above requirements send me a private message containing the following points. The Epic CM team will review your submissions and invite people who demonstrate moderate coding ability and some measure of being helpful to the community.

  • Links to stuff you have developed in the past.
  • Links demonstrating that you have been helpful to the community.
  • Register with NickServ, and include the identity of that nickname in your message so that we may invite you. You must figure out how to do this on your own.

Requirements for Epic CM Team Channel
The goal of the Epic CM team is to together fix the many bugs and improve the user experience of CM9 on our phone (see CM9 Status).
  • People may be invited to the Epic CM team channel after they have demonstrated their ability to improve CM, usually by fixing several bugs and having patches accepted through gerrit code review. For example, a source port to integrate the circle battery option into CM9 that is accepted by CM code review would be a welcome addition to CM upstream.
  • A certain level of maturity is expected from Epic CM team members.
  • Compliance with the GPL source disclosure is required of all members.
  • By helping other people in the Incubator channel and the forums, you demonstrate your abilities.

The reality of the situation is that the Epic CM tea is comprised of volunteers with their own busy lives. Please understand that a great deal of patience is necessary when dealing with other volunteers.

If you demonstrate to us and the greater CM community your ability to improve CM9 and the Epic user experience, you too may eventually join the Epic CM team. Epic CM is already the largest and best organized of all CM development teams. In the long-term, we hope to continue this centralized, collaborative development model with Sprint's next flagship slider phone.
 
Last edited:
  • Like
Reactions: duce102 and sirkilo

gooch1025

Senior Member
Jan 3, 2012
305
266
Added the make clobber command in the tutorial. No need for bleachbit lol. This will empty the root trash as well.
 

wtogami

Retired Recognized Developer
Dec 6, 2010
312
1,082
Added the make clobber command in the tutorial. No need for bleachbit lol. This will empty the root trash as well.

Technically you only need to delete out/target to 100% ensure safe builds. Out/host almost never changes. This can shave a few minutes from the build.

Sent from my SPH-D700 using XDA
 

deciple

Senior Member
Sep 22, 2010
325
45
Salem
You have to . build/envsetup.sh first don't forget the dot then space "."
Also....you don't install it; once you do the build command it makes brunch...so then you just type brunch epicmtd.... Then it'll create the the epicmtd folder at which point it'll start to build....that's when you close the terminal to stop the build (because there's nothing in there yet) then reopen the terminal and connect your phone to do the extract command etc.....
Broadcast to the public; to promote self awareness.
 
Last edited:

deciple

Senior Member
Sep 22, 2010
325
45
Salem
I dont have a framework folder in the system folder. Am I doing something wrong?

Sweet thanks,. I found the apps but I couldnt seem to find the framework-res. I want to modify that apk. There was no folder in there for framework. Any suggestions?

I'm sorry dude, I told you wrong........here's where you find it

Cm9/frameworks/base/core/res/res/

then you can make edits to values or drawables or whatever.......
 

jdelano

Senior Member
Sep 10, 2010
3,004
1,983
Buford, GA
little help please :)

Hello .. I'm taking a dip in the pool but have run into a snag:

I am on Windows 7 ultimate 64 sp1 24g ram
virtualbox 4.1.10
Ubuntu 11.04

I am near the start of the process; all has gone fine until I try to install the packages by running: (copied and pasted from OP)

apt-get install python git-core gnupg flex bison gperf build-essential zip curl zlib1g-dev libc6-dev libncurses5-dev lib32ncurses5-dev ia32-libs x11proto-core-dev libx11-dev lib32readline-gplv2-dev lib32z-dev libgl1-mesa-dev g++-multilib mingw32 tofrodos python-markdown libxml2-utils libsdl1.2-dev libesd0-dev libwxgtk2.6-dev squashfs-tools build-essential pngcrush schedtool gcc-multilib

I press return and receive:

Reading package lists... Done
Building dependency tree
Reading state information... Done
Package lib32ncurses5-dev is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

Package lib32readline-gplv2-dev is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

Package ia32-libs is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

E: Package 'lib32ncurses5-dev' has no installation candidate
E: Package 'ia32-libs' has no installation candidate
E: Package 'lib32readline-gplv2-dev' has no installation candidate
E: Unable to locate package lib32z-dev

I imagine this is not the desired output as I wasn't given the prompt for Y/n.

Any help would be appreciated.

Thanks
 

gooch1025

Senior Member
Jan 3, 2012
305
266
Hello .. I'm taking a dip in the pool but have run into a snag:

I am on Windows 7 ultimate 64 sp1 24g ram
virtualbox 4.1.10
Ubuntu 11.04

I am near the start of the process; all has gone fine until I try to install the packages by running: (copied and pasted from OP)

apt-get install python git-core gnupg flex bison gperf build-essential zip curl zlib1g-dev libc6-dev libncurses5-dev lib32ncurses5-dev ia32-libs x11proto-core-dev libx11-dev lib32readline-gplv2-dev lib32z-dev libgl1-mesa-dev g++-multilib mingw32 tofrodos python-markdown libxml2-utils libsdl1.2-dev libesd0-dev libwxgtk2.6-dev squashfs-tools build-essential pngcrush schedtool gcc-multilib

I press return and receive:

Reading package lists... Done
Building dependency tree
Reading state information... Done
Package lib32ncurses5-dev is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

Package lib32readline-gplv2-dev is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

Package ia32-libs is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

E: Package 'lib32ncurses5-dev' has no installation candidate
E: Package 'ia32-libs' has no installation candidate
E: Package 'lib32readline-gplv2-dev' has no installation candidate
E: Unable to locate package lib32z-dev

I imagine this is not the desired output as I wasn't given the prompt for Y/n.

Any help would be appreciated.

Thanks

In the guide I explain that I am using Ubuntu 11.10 64-bit. If you're using a different distro such as 11.04, some of the packages may vary. Its best to follow my guide exactly since you're basically copying and pasting everything into the terminal.

Sent from my Purple Haze Epic using xda premium
 

bodi524

Senior Member
Apr 10, 2010
470
448
Google Pixel 3 XL
Hello .. I'm taking a dip in the pool but have run into a snag:

I am on Windows 7 ultimate 64 sp1 24g ram
virtualbox 4.1.10
Ubuntu 11.04

I am near the start of the process; all has gone fine until I try to install the packages by running: (copied and pasted from OP)

apt-get install python git-core gnupg flex bison gperf build-essential zip curl zlib1g-dev libc6-dev libncurses5-dev lib32ncurses5-dev ia32-libs x11proto-core-dev libx11-dev lib32readline-gplv2-dev lib32z-dev libgl1-mesa-dev g++-multilib mingw32 tofrodos python-markdown libxml2-utils libsdl1.2-dev libesd0-dev libwxgtk2.6-dev squashfs-tools build-essential pngcrush schedtool gcc-multilib

I press return and receive:

Reading package lists... Done
Building dependency tree
Reading state information... Done
Package lib32ncurses5-dev is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

Package lib32readline-gplv2-dev is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

Package ia32-libs is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

E: Package 'lib32ncurses5-dev' has no installation candidate
E: Package 'ia32-libs' has no installation candidate
E: Package 'lib32readline-gplv2-dev' has no installation candidate
E: Unable to locate package lib32z-dev

I imagine this is not the desired output as I wasn't given the prompt for Y/n.

Any help would be appreciated.

Thanks

You Can try this set of packages. This is what I used but my computer has little ram and the load is still trying to build. I am not sure if you will get any errors.

git-core gnupg flex bison gperf libsdl1.2-dev libesd0-dev libwxgtk2.6-dev squashfs-tools build-essential zip curl libncurses5-dev zlib1g-dev sun-java6-jdk pngcrush schedtool

Sent from my SPH-D700 using Tapatalk
 
  • Like
Reactions: jdelano

Top Liked Posts

  • There are no posts matching your filters.
  • 39
    Building CM9 From Source On The Epic 4G

    I just recently built CM9 for the Epic 4G since Contacts.apk and the Honeycomb Ripple Lockscreen Mod need to be built from source to work properly on our phones. If you follow my instructions exactly, you should have a working CM9 build for the Epic 4G. You can then modify whatever you need to customize your apks, jar files, etc.

    Now lets get started. You will need to install Ubuntu 11.10 64-Bit on your computer. It can be a virtual machine, an install using Wubi, or an actual partition for Ubuntu. You will need at least 30gb available for Ubuntu since the repository and the build take up a lot of space.

    (Note: It Must Be Ubuntu 11.10 64-Bit And Have A Working Internet Connection!)

    Install Java JDK

    Once Ubuntu is installed the first thing you will need to do is install Java JDK. Open up a terminal or press Ctrl+Alt+T on the keyboard and copy the following commands:

    Code:
    sudo add-apt-repository ppa:ferramroberto/java
    sudo apt-get update
    sudo apt-get install sun-java6-jdk sun-java6-plugin

    After the first command is entered, it will ask you for your password. Enter it and continue with the commands. Once Java is about to install, it will tell you how much additional disk space Java will add to your hard drive and ask if you want to continue. Press Y and hit Enter. When Java is done installing, you should see a window that pops up with the Java Licensing Agreement. Use the arrow keys or the Tab key on your keyboard to navigate to the OK button and press Enter. Then Navigate to Yes and hit Enter again. Java is now installed on your Computer!

    Install Android SDK For Linux

    Next, you will need to install android sdk. Google search android sdk and it should be the first link that pops up. Click on it and download android-sdk_r18-linux.tgz for Linux. Now go back to your terminal and enter the following commands:

    Code:
    cd Downloads
    tar -xvzf android-sdk_r18-linux.tgz 
    rm *.tgz
    mv android-sdk-linux/ ..
    cd ../android-sdk-linux/

    In case you don't know what you just did, you navigated to your Downloads folder and extracted the android-sdk-linux folder. Then you deleted the compressed file and moved your android-sdk-linux folder to your Home directory. Finally, you navigated to your android-sdk-linux folder.

    Now we need to open the Android SDK Manager and download the necessary packages. In the terminal, copy:

    Code:
    tools/android

    It should pop up the Android SDK Manager. Now make sure the Tools folder, and Android 4.0.3 (API 15) packages are selected and click on Install Packages. Check Accept All and click on Install. Once all the packages have been loaded, close out of the Download window and the Android SDK Manager. Go back to your terminal and Type:

    Code:
    cd

    This will navigate you back to your Home Directory.

    The Rest Of The Guide Will Need To Be Done In The Root Terminal!

    In the terminal type:

    Code:
    sudo -i

    Then enter your password. You are now logged in as root! (Or superuser) :D

    Install Packages

    Now we need to install all the necessary packages to make the CM9 build. In the terminal, copy:

    Code:
    apt-get install python git-core gnupg flex bison gperf build-essential zip curl zlib1g-dev libc6-dev libncurses5-dev lib32ncurses5-dev ia32-libs x11proto-core-dev libx11-dev lib32readline-gplv2-dev lib32z-dev libgl1-mesa-dev g++-multilib mingw32 tofrodos python-markdown libxml2-utils libsdl1.2-dev libesd0-dev libwxgtk2.6-dev squashfs-tools build-essential pngcrush schedtool gcc-multilib

    Again, press Y and hit Enter.

    Configuring USB

    Time to set up all devices to work with USB.

    Code:
    gksudo gedit /etc/udev/rules.d/51-android.rules

    This will create a new file to configure the USB devices. Copy and paste this into the file:

    Code:
    #Acer
    SUBSYSTEM==usb, SYSFS{idVendor}==0502, MODE=0666
    #ASUS
    SUBSYSTEM==usb, SYSFS{idVendor}==0b05, MODE=0666
    #Dell
    SUBSYSTEM==usb, SYSFS{idVendor}==413c, MODE=0666
    #Foxconn
    SUBSYSTEM==usb, SYSFS{idVendor}==0489, MODE=0666
    #Garmin-Asus
    SUBSYSTEM==usb, SYSFS{idVendor}==091E, MODE=0666
    #Google
    SUBSYSTEM==usb, SYSFS{idVendor}==18d1, MODE=0666
    #HTC
    SUBSYSTEM=="usb", SYSFS{idVendor}=="0bb4", MODE=0666
    #Huawei
    SUBSYSTEM==usb, SYSFS{idVendor}==12d1, MODE=0666
    #K-Touch
    SUBSYSTEM==usb, SYSFS{idVendor}==24e3, MODE=0666
    #KT Tech
    SUBSYSTEM==usb, SYSFS{idVendor}==2116, MODE=0666
    #Kyocera
    SUBSYSTEM==usb, SYSFS{idVendor}==0482, MODE=0666
    #Lenevo
    SUBSYSTEM==usb, SYSFS{idVendor}==17EF, MODE=0666
    #LG
    SUBSYSTEM==usb, SYSFS{idVendor}==1004, MODE=0666
    #Motorola
    SUBSYSTEM==usb, SYSFS{idVendor}==22b8, MODE=0666
    #NEC
    SUBSYSTEM==usb, SYSFS{idVendor}==0409, MODE=0666
    #Nook
    SUBSYSTEM==usb, SYSFS{idVendor}==2080, MODE=0666
    #Nvidia
    SUBSYSTEM==usb, SYSFS{idVendor}==0955, MODE=0666
    #OTGV
    SUBSYSTEM==usb, SYSFS{idVendor}==2257, MODE=0666
    #Pantech
    SUBSYSTEM==usb, SYSFS{idVendor}==10A9, MODE=0666
    #Philips
    SUBSYSTEM==usb, SYSFS{idVendor}==0471, MODE=0666
    #PMC-Sierra
    SUBSYSTEM==usb, SYSFS{idVendor}==04da, MODE=0666
    #Qualcomm
    SUBSYSTEM==usb, SYSFS{idVendor}==05c6, MODE=0666
    #SK Telesys
    SUBSYSTEM==usb, SYSFS{idVendor}==1f53, MODE=0666
    #Samsung
    SUBSYSTEM==usb, SYSFS{idVendor}==04e8, MODE=0666
    #Sharp
    SUBSYSTEM==usb, SYSFS{idVendor}==04dd, MODE=0666
    #Sony Ericsson
    SUBSYSTEM==usb, SYSFS{idVendor}==0fce, MODE=0666
    #Toshiba
    SUBSYSTEM==usb, SYSFS{idVendor}==0930, MODE=0666
    #ZTE
    SUBSYSTEM==usb, SYSFS{idVendor}==19D2, MODE=0666

    Save the file and close the window. Next set the permissions for the file you just created:

    Code:
    chmod a+r /etc/udev/rules.d/51-android.rules

    Installing Repo

    Next, we need to install the CM9 repository.

    Code:
    mkdir ~/bin
    gedit /etc/environment

    This will open up your Environment Variables so you can use adb and other commands no matter what directory you're in.

    Copy and paste this into the end of the file:

    Code:
    :/home/gooch/android-sdk-linux/tools:/home/gooch/android-sdk-linux/platform-tools:/root/bin

    Replace gooch with your Username that you set up and make sure to leave the quotes! It should look like one big line.

    Now Logout and Log back in! This will update your Environment Variables.

    Once you're logged back in, open up the terminal and log back in as root:

    Code:
    sudo -i

    Enter your password and then copy the following commands:

    Code:
    curl https://dl-ssl.google.com/dl/googlesource/git-repo/repo > ~/bin/repo
    chmod a+x ~/bin/repo
    mkdir CM9
    cd CM9
    repo init -u git://github.com/CyanogenMod/android.git -b ics
    repo sync

    These commands will set everything up and download the CM9 repository. (This will take a long time to download!)

    (Note: If your download freezes or hangs, close the terminal and open up a new one. Log back into root and repeat these steps)

    Code:
    cd CM9
    repo sync

    This will continue where you left off. Once everything is synced, enter in the terminal:

    Code:
    nautilus

    This will open up a root file explorer. navigate to the CM9/device/samsung folder and see if there is a folder called "epicmtd". If there is, skip to Copy Proprietary Files. If not, close the file explorer and type:

    Code:
    brunch epicmtd


    This should gather the epicmtd folder for you. If it starts to build, exit the terminal Immediately!


    Open another terminal, log into root, and open up the root file explorer again:

    Code:
    nautilus

    Check if the "epicmtd" is there again. If it's there, Navigate back to the CM9 folder and then navigate to the out/target/product folder. If there is a folder called "epicmtd", delete it and close the root file explorer.

    Copy Proprietary Files

    Next you need to download the proprietary files from your phone. You must have a working CM9 ROM currently on your phone. Make sure USB Debugging is on and plug your phone into your computer. (You can find this under Settings-Developer Options-USB Debugging)

    In the terminal, navigate the the "CM9" folder if you're not already there:

    Code:
    cd CM9

    Then copy the following commands:

    Code:
    cd device/samsung/epicmtd
    ./extract-files.sh

    This will gather all the necessary files needed from your phone. Once this is finished, navigated back to the "CM9" folder by entering:

    Code:
    cd
    cd CM9

    Now enter:

    Code:
    vendor/cm/get-prebuilts

    (Note: The whole "Copy Proprietary Files" step only needs to be done once to set everything up!)


    Build Source

    Finally, We can build the CM9 Source Code.

    In the terminal, copy the commands:

    Code:
    . build/envsetup.sh
    brunch epicmtd

    This will take a while, but if you set up everything correct, you should have a working, flashable CM9 ROM in the CM9/out/target/product/epicmtd folder. The .zip is called something like "update-cm-9.0.0-RC0-epicmtd-KANG-signed".

    Copy that to your phone's SD Card and reboot into recovery mode. Wipe user data, cache, and dalvik cache, and flash. If it installs and your phone boots up with CM9, You just made a successful build!

    You can delete the "epicmtd" folder created in the CM9/out/target/product directory by running in CM9 directory:

    Code:
    make clobber

    Now you can modify the Source Code, and build again by issuing these two simple commands:

    Code:
    . build/envsetup.sh
    brunch epicmtd

    I hope you enjoyed this tutorial and that it helped you. Start building!




    Thanks to UberPinguin for helping me with my Source Build
    2
    CM Dev Training and Recruitment

    Hey folks,

    We have an invite-only IRC channel on irc.irondust.net to act as an incubator to help train new developers to understand CM9 to eventually become productive CM developers.

    Epic IRC Discussion Channels
    1. General Public #epic channel on irc.irondust.net
    2. Incubator Channel (invite only)
    3. Epic CM Team Channel (invite only)

    Requirements for Incubator Channel

    • We would prefer to invite people only after they have demonstrated enough Linux knowledge to setup the build environment and to successfully build CM9.
    • In order to fix bugs in the source code, you need to learn an intermediate level of Java and C programming languages and how to use git. We unfortunately cannot teach you how to use Linux or how to code. For those that have some coding skills this is a great opportunity to grow your skills by practicing on a fun project that benefits many other people.
    • The devs are very busy so there is a limited amount of energy we can devote to helping the incubator trainees. You must have patience and able to sit in IRC all day as answers to questions may happen only when developers have time to answer.

    How to Apply
    If you meet the above requirements send me a private message containing the following points. The Epic CM team will review your submissions and invite people who demonstrate moderate coding ability and some measure of being helpful to the community.

    • Links to stuff you have developed in the past.
    • Links demonstrating that you have been helpful to the community.
    • Register with NickServ, and include the identity of that nickname in your message so that we may invite you. You must figure out how to do this on your own.

    Requirements for Epic CM Team Channel
    The goal of the Epic CM team is to together fix the many bugs and improve the user experience of CM9 on our phone (see CM9 Status).
    • People may be invited to the Epic CM team channel after they have demonstrated their ability to improve CM, usually by fixing several bugs and having patches accepted through gerrit code review. For example, a source port to integrate the circle battery option into CM9 that is accepted by CM code review would be a welcome addition to CM upstream.
    • A certain level of maturity is expected from Epic CM team members.
    • Compliance with the GPL source disclosure is required of all members.
    • By helping other people in the Incubator channel and the forums, you demonstrate your abilities.

    The reality of the situation is that the Epic CM tea is comprised of volunteers with their own busy lives. Please understand that a great deal of patience is necessary when dealing with other volunteers.

    If you demonstrate to us and the greater CM community your ability to improve CM9 and the Epic user experience, you too may eventually join the Epic CM team. Epic CM is already the largest and best organized of all CM development teams. In the long-term, we hope to continue this centralized, collaborative development model with Sprint's next flagship slider phone.
    2
    Ok....I got the whole source tree. Was able to compile. Now I want to make a change. I tried and it doesn't play well with Beta1. I found its due to updates made between when Beta1 was released and now. Is there a way to roll back to Beta1 source files?

    Sent from my SPH-D700 using Tapatalk

    delete the files in your /device/Samsung/epicmtd folder then connect your phone and ./extract-files.sh again and that'll give you whatever version you have on your phone to build for

    Broadcast to the public; to promote self awareness.
    2
    Soooooo.....git://github.com/CyanogenMod/android.git -b Samsung epicmtd?


    Broadcast to the public; to promote self awareness.

    modify the .repo/local_manifest.xml in the CM9 folder.

    This has the device, vendor and kernel files.

    Code:
    <?xml version="1.0" encoding="UTF-8"?>
      <manifest>
         <project path="device/samsung/epicmtd" name="CyanogenMod/android_device_samsung_epicmtd" remote="github" revision="ics"/>
         <project path="kernel/samsung/victory" name="CyanogenMod/android_kernel_samsung_victory" remote="github" revision="ics"/>
         <project path="vendor/samsung" name="koush/proprietary_vendor_samsung" remote="github" revision="ics"/>
      </manifest>
    2
    It have to be specifically on 11.10? I have 10.04 for compatibility reasons and plan on giving this a whirl :).

    Sent from my SPH-D700 using xda premium

    It will work on every debian based OS. I am using Linux Mint Debian and I can compile fine.

    Sent from my SPH-D700 using Tapatalk