COMPILE From Source For Any Phone On Linux Distros [BUILD ENVIRONMENT TO COMPILE]

Search This thread

skinzy98

Senior Member
May 30, 2012
1,768
521
How exactly do I check that? I don't remember setting a specific size. I just no I freed up that space and installed Ubuntu on it. So how do I check it? Thanks for your help

Sent from my Nexus 4 using xda app-developers app
 

Zeljko1234

Senior Member
May 7, 2010
5,898
2,766
Stockholm
How exactly do I check that? I don't remember setting a specific size. I just no I freed up that space and installed Ubuntu on it. So how do I check it? Thanks for your help

Sent from my Nexus 4 using xda app-developers app

Start Disk Utility or in terminal type: cat /proc/swaps or use any other way (swapon -s, gparted...)
 
Last edited:

skinzy98

Senior Member
May 30, 2012
1,768
521
I have 3.1 GB swap partition. Just to let you know I have it dual booted with windows 7

Sent from my Nexus 4 using xda app-developers app
 

patraanjan23

Senior Member
Nov 1, 2012
186
131
Put the ~/bin directory in your path of execution
Make sure that the ~/bin directory you just created is in your path of execution so that you can easily run the repo command even when you're not in ~/bin. Assuming you are using the BASH shell, the default in recent versions of Ubuntu, you can set it like this:
Code:
export PATH=${PATH}:~/bin

can you explain this part a little more elaborately? I don't understand which path to give? can you give me an example of how it's done? I mean giving a path where you're working.
 

Zeljko1234

Senior Member
May 7, 2010
5,898
2,766
Stockholm
can you explain this part a little more elaborately? I don't understand which path to give? can you give me an example of how it's done? I mean giving a path where you're working.

Just go to the folder where is bin subfolder and type this command or you can add your full path.

To make it permanent after reboot:
$ gedit ~/.bashrc

then add:
export PATH=${PATH}:~/bin

Just experiment a little ;)
 
  • Like
Reactions: patraanjan23

jjhiza

Senior Member
Dec 19, 2010
3,163
2,697
Dirty Jersey
Help please. Using Ubuntu 13.10

1.) using pastebin or the code feature here on XDA would make things a little easier to read - just mentioning this for future reference.

2) the make error points to line 77 in your .../sepolicy_intermediaries/policy.conf. file. Follow the path, outlined in terminal, and check to see if there are spelling errors, misaligned text, or spaces where they shouldn't be.

Unfortunately, files do occasionally get messed up, even if you don't edit them. Check for those errors first, and make clean. Hopefully it's a quick fix... If you're still getting errors, report back. :)

Sent from my Nexus 5 using Tapatalk
 
Last edited:
  • Like
Reactions: Cuzz1369

Cuzz1369

Senior Member
Jan 25, 2013
4,060
4,458
Kitchener
1.) using pastebin or the code feature here on XDA would make things a little easier to read - just mentioning this for future reference.

2) the make error points to line 77 in your .../sepolicy_intermediaries/policy.conf. file. Follow the path, outlined in terminal, and check to see if there are spelling errors, misaligned text, or spaces where they shouldn't be.

Unfortunately, files do occasionally get messed up, even if you don't edit them. Check for those errors first, and make clean. Hopefully it's a quick fix... If you're still getting errors, report back. :)

Sent from my Nexus 5 using Tapatalk

It was an error on my part. Make gnu wasn't installed properly. I reinstalled and all went well. Thanks for the tips though.

Sent from my Nexus 7 using Tapatalk
 
  • Like
Reactions: jjhiza

afi1982

Senior Member
Aug 7, 2009
1,805
4,063
hey guys i'm compiling cm11 for xperia x8 and i have this problem when compiling ..

bionic/libc/include/string.h:108: error: undefined reference to '__memcpy_chk'

can you help me ?
 

Olivier

Recognized Developer / Retired Forum Moderator
Nov 6, 2011
2,664
6,942
Do you use androidarmv6 repos?

Gesendet von meinem Xperia S mit Tapatalk
 

skinzy98

Senior Member
May 30, 2012
1,768
521
alright this will be a bit long. I had followed this guide and with some help from a friend successfully built liquidsmooth for the samsung vibrant. well literally the build completed and the machine ran out of space at the same time. so i moved the build to desktop and i was forced to get of the computer by my mother. she then shut the computer down and ubuntu corrupted. i then booted to windows and deleted the ubuntu partition. i didnt know i had to fix the boot partition with the installation disc and ended up completely wiping the computer and reinstalling windows. next i tried ubuntu gnome through a usb drive and it had glitches so i decided to go back to regular ubuntu. here i started to set up the build enviroment and was setting paths following another guide to install make gnu and python(still not completely sure how to do thay properly a guide would be lovely) alll of a sudden sudo, su, and ls were not recognized as a command nothing i did or googled worked permanately. so i wiped the partition fixed the boot partition and reinstalled the ubuntu again and just started using this guide. just got done installing the sdk and i went to install the 64bit only libs(the ubuntu is 64 bit but windows is 32) and it says the very first one is not a command. so i tried sudo apt-get and then the command and it says that it is incorrect. i tried the 32 bit and 64 bit system and that didnt work either. Does anyone know what could be going on? i have java jdk6 installed.
 

lols21.10

Senior Member
Dec 22, 2012
361
135
★ ★ ★ ★ ★ ★ ★ ★
@mithun46 can you tell me the size of cm10.2 source :confused::confused::confused:


And while compiling for my phone grand quattro i am stuck at this error

Code:
Import includes file: /home/himanshu/cm11/out/target/product/delos3geur/obj/EXECUTABLES/reboot_intermediates/import_includes
Export includes file: system/core/reboot/Android.mk -- /home/himanshu/cm11/out/target/product/delos3geur/obj/EXECUTABLES/reboot_intermediates/export_includes
make: *** No rule to make target `/home/himanshu/cm11/out/target/product/delos3geur/obj/SHARED_LIBRARIES/libril_intermediates/export_includes', needed by `/home/himanshu/cm11/out/target/product/delos3geur/obj/EXECUTABLES/rild_intermediates/import_includes'.  Stop.
make: *** Waiting for unfinished jobs....

Any help????
 

jjhiza

Senior Member
Dec 19, 2010
3,163
2,697
Dirty Jersey
alright this will be a bit long. I had followed this guide and with some help from a friend successfully built liquidsmooth for the samsung vibrant. well literally the build completed and the machine ran out of space at the same time. so i moved the build to desktop and i was forced to get of the computer by my mother. she then shut the computer down and ubuntu corrupted. i then booted to windows and deleted the ubuntu partition. i didnt know i had to fix the boot partition with the installation disc and ended up completely wiping the computer and reinstalling windows. next i tried ubuntu gnome through a usb drive and it had glitches so i decided to go back to regular ubuntu. here i started to set up the build enviroment and was setting paths following another guide to install make gnu and python(still not completely sure how to do thay properly a guide would be lovely) alll of a sudden sudo, su, and ls were not recognized as a command nothing i did or googled worked permanately. so i wiped the partition fixed the boot partition and reinstalled the ubuntu again and just started using this guide. just got done installing the sdk and i went to install the 64bit only libs(the ubuntu is 64 bit but windows is 32) and it says the very first one is not a command. so i tried sudo apt-get and then the command and it says that it is incorrect. i tried the 32 bit and 64 bit system and that didnt work either. Does anyone know what could be going on? i have java jdk6 installed.

Wow man, that was a doozy of a read, lol. If I'm understanding you correctly, you're installing the 64bit Ubuntu on a 32bit machine, correct? If so, that's your issue right there... You can't compile Android in a 32bit architecture.

If I'm wrong, and you have a 64bit box, then I suggest following this guide, which has updated instructions, pertinent to 13.10 and its derivatives (Mint 16, Xubuntu, etc) - http://xdaforums.com/showthread.php?t=2224142. The guide is for building AOSP, but you can repo sync anything you want, when you get to the corresponding step.

As for building gnu and python, I wouldn't even bother if I were you...at least not in your build machine. If you want to learn how to do it, do so on another box. Just use "sudo apt-get install python" and "apt-get install gnu blah blah blah" (related libs) when necessary, and you should be good.

Also, how are you setting up you Ubuntu install? If you're losing the ability to sudo, you may not have set your home directory mount point correctly... It should be mounted as root or simply "/" (without quotes obviously), and should anyways be a primary directory. Hopefully this will help you, but if not, report back, and we'll try again. :)

Sent from my Nexus 5 using Tapatalk
 
Last edited:

skinzy98

Senior Member
May 30, 2012
1,768
521
Wow man, that was a doozy of a read, lol. If I'm understanding you correctly, you're installing the 64bit Ubuntu on a 32bit machine, correct? If so, that's your issue right there... You can't compile Android in a 32bit architecture.

If I'm wrong, and you have a 64bit box, then I suggest following this guide, which has updated instructions, pertinent to 13.10 and its derivatives (Mint 16, Xubuntu, etc) - http://xdaforums.com/showthread.php?t=2224142. The guide is for building AOSP, but you can repo sync anything you want, when you get to the corresponding step.

As for building gnu and python, I wouldn't even bother if I were you...at least not in your build machine. If you want to learn how to do it, do so on another box. Just use "sudo apt-get install python" and "apt-get install gnu blah blah blah" (related libs) when necessary, and you should be good.

Also, how are you setting up you Ubuntu install? If you're losing the ability to sudo, you may not have set your home directory mount point correctly... It should be mounted as root or simply "/" (without quotes obviously), and should anyways be a primary directory. Hopefully this will help you, but if not, report back, and we'll try again. :)

Sent from my Nexus 5 using Tapatalk

Alright so part of it was correct for one the computer shipped with 32 bit but has 2 GB of ram and can run 64 bit that's what I successfully compiled on when Ubuntu corrupted. As for the second part thanks I didn't know that you could just run the sudo apt-get ins all pythonand i installed Ubuntu the same as last time I accidentally cha he'd the execution line and corrupted it

sent from the bottom of a red solo cup
 

afi1982

Senior Member
Aug 7, 2009
1,805
4,063
can someone help me? im trying to run cm11 on my device and that what i'm getting

I/SystemServer( 5948): Entropy Mixer
I/EntropyMixer( 5948): Writing entropy...
I/SystemServer( 5948): User Service
I/SystemServer( 5948): Account Manager
I/SystemServer( 5948): Content Manager
I/SystemServer( 5948): System Content Providers
I/SystemServer( 5948): Lights Service
I/SystemServer( 5948): Battery Service
E/System ( 5948): ******************************************
E/System ( 5948): ************ Failure starting core service
E/System ( 5948): java.lang.NullPointerException
E/System ( 5948): at com.android.server.BatteryService.<init>(BatteryService.java:192)
E/System ( 5948): at com.android.server.ServerThread.initAndLoop(SystemServer.java:337)
E/System ( 5948): at com.android.server.SystemServer.main(SystemServer.java:1342)
E/System ( 5948): at java.lang.reflect.Method.invokeNative(Native Method)
E/System ( 5948): at java.lang.reflect.Method.invoke(Method.java:515)
E/System ( 5948): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:791)
E/System ( 5948): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:607)
E/System ( 5948): at dalvik.system.NativeStart.main(Native Method)
I/SystemServer( 5948): Input Method Service
W/InputMethodManagerService( 5948): Couldn't create dir.: /data/system/inputmethod
W/InputMethodManagerService( 5948): No IME selected. Choose the most applicable IME.
I/InputMethodManagerService( 5948): No default found, using com.android.inputmethod.latin/.LatinIME
I/SystemServer( 5948): Accessibility Manager
W/SystemServer( 5948): ***********************************************
F/SystemServer( 5948): BOOT FAILURE making display ready
F/SystemServer( 5948): java.lang.NullPointerException
F/SystemServer( 5948): at com.android.server.ServerThread.initAndLoop(SystemServer.java:447)
F/SystemServer( 5948): at com.android.server.SystemServer.main(SystemServer.java:1342)
F/SystemServer( 5948): at java.lang.reflect.Method.invokeNative(Native Method)
F/SystemServer( 5948): at java.lang.reflect.Method.invoke(Method.java:515)
F/SystemServer( 5948): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:791)
F/SystemServer( 5948): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:607)
F/SystemServer( 5948): at dalvik.system.NativeStart.main(Native Method)
D/AndroidRuntime( 5948): Shutting down VM
W/dalvikvm( 5948): threadid=1: thread exiting with uncaught exception (group=0x4162fc20)
I/Process ( 5948): Sending signal. PID: 5948 SIG: 9
E/AndroidRuntime( 5948): *** FATAL EXCEPTION IN SYSTEM PROCESS: main
E/AndroidRuntime( 5948): java.lang.NullPointerException
E/AndroidRuntime( 5948): at com.android.server.am.ActivityManagerService.showBootMessage(ActivityManagerService.java:5201)
E/AndroidRuntime( 5948): at com.android.server.ServerThread.initAndLoop(SystemServer.java:459)
E/AndroidRuntime( 5948): at com.android.server.SystemServer.main(SystemServer.java:1342)
E/AndroidRuntime( 5948): at java.lang.reflect.Method.invokeNative(Native Method)
E/AndroidRuntime( 5948): at java.lang.reflect.Method.invoke(Method.java:515)
E/AndroidRuntime( 5948): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:791)
E/AndroidRuntime( 5948): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:607)
E/AndroidRuntime( 5948): at dalvik.system.NativeStart.main(Native Method)
I/ServiceManager( 1374): service 'sensorservice' died
I/ServiceManager( 1374): service 'power' died
I/ServiceManager( 1374): service 'usagestats' died
I/ServiceManager( 1374): service 'scheduling_policy' died
I/ServiceManager( 1374): service 'appops' died
I/ServiceManager( 1374): service 'display' died
I/ServiceManager( 1374): service 'telephony.registry' died
I/ServiceManager( 1374): service 'batterystats' died
I/ServiceManager( 1374): service 'account' died
I/ServiceManager( 1374): service 'content' died
I/ServiceManager( 1374): service 'package' died
I/ServiceManager( 1374): service 'activity' died
I/ServiceManager( 1374): service 'procstats' died
I/ServiceManager( 1374): service 'meminfo' died
I/ServiceManager( 1374): service 'gfxinfo' died
I/ServiceManager( 1374): service 'dbinfo' died
I/ServiceManager( 1374): service 'cpuinfo' died
I/ServiceManager( 1374): service 'permission' died
I/ServiceManager( 1374): service 'entropy' died
I/ServiceManager( 1374): service 'user' died
I/ServiceManager( 1374): service 'accessibility' died
I/ServiceManager( 1374): service 'hardware' died
I/ServiceManager( 1374): service 'input_method' died
E/installd( 1383): eof
E/installd( 1383): failed to read transaction id
I/installd( 1383): closing connection
I/Zygote ( 5627): Exit zygote because system server (5948) has terminated
I/ServiceManager( 1374): service 'media.audio_policy' died
I/ServiceManager( 1374): service 'media.audio_flinger' died
I/ServiceManager( 1374): service 'media.player' died
I/ServiceManager( 1374): service 'media.camera' died
 

jdegreef

Senior Member
Oct 24, 2013
520
165
Brussels
Building CM 11.0 for P5100

Hi,

This is my first attempt at building a rom,
I try to build CM 11.0 for Galaxy Tab 2 10.1 and I've followed the guide at http://wiki.cyanogenmod.org/w/Build_for_p5100.

Everything went ok up until I made this step
Code:
source build/envsetup.sh
breakfast p5100

I get this :

Code:
jdegreef@nexus8:~/android/system$ breakfast p5100
including vendor/cm/vendorsetup.sh
build/core/product_config.mk:238: *** _nic.PRODUCTS.[[device/samsung/p5100/cm.mk]]: "vendor/samsung/omap4-common/common-vendor.mk" does not exist.  Stop.
Device p5100 not found. Attempting to retrieve device repository from CyanogenMod Github (http://github.com/CyanogenMod).
Found repository: android_device_samsung_p5100
Default revision: cm-11.0
Checking branch info
CyanogenMod/android_device_samsung_p5100 already exists
Syncing repository to retrieve project.
Fetching project CyanogenMod/android_device_samsung_p5100

Repository synced!
Looking for dependencies
Done
build/core/product_config.mk:238: *** _nic.PRODUCTS.[[device/samsung/p5100/cm.mk]]: "vendor/samsung/omap4-common/common-vendor.mk" does not exist.  Stop.

** Don't have a product spec for: 'cm_p5100'
** Do you have the right repo manifest?

I have no idea on what's happening. I'm learning but currently I'm stucked :(
And this time Google was not my friend.

Any help would be appreciated..
 
Last edited:

ibub

Senior Member
Oct 22, 2012
1,728
1,522
Louisville,Ky
Hi,

This is my first attempt at building a rom,
I try to build CM 11.0 for Galaxy Tab 2 10.1 and I've followed the guide at http://wiki.cyanogenmod.org/w/Build_for_p5100.

Everything went ok up until I made this step
Code:
source build/envsetup.sh
breakfast p5100

I get this :

Code:
jdegreef@nexus8:~/android/system$ breakfast p5100
including vendor/cm/vendorsetup.sh
build/core/product_config.mk:238: *** _nic.PRODUCTS.[[device/samsung/p5100/cm.mk]]: "vendor/samsung/omap4-common/common-vendor.mk" does not exist.  Stop.
Device p5100 not found. Attempting to retrieve device repository from CyanogenMod Github (http://github.com/CyanogenMod).
Found repository: android_device_samsung_p5100
Default revision: cm-11.0
Checking branch info
CyanogenMod/android_device_samsung_p5100 already exists
Syncing repository to retrieve project.
Fetching project CyanogenMod/android_device_samsung_p5100

Repository synced!
Looking for dependencies
Done
build/core/product_config.mk:238: *** _nic.PRODUCTS.[[device/samsung/p5100/cm.mk]]: "vendor/samsung/omap4-common/common-vendor.mk" does not exist.  Stop.

** Don't have a product spec for: 'cm_p5100'
** Do you have the right repo manifest?

I have no idea on what's happening. I'm learning but currently I'm stucked :(
And this time Google was not my friend.

Any help would be appreciated..

You initially did not have device folder(s). Now try repo sync again, and try brunch again (or breakfast, or lunch, or whatever).

Sent from my LG-P509 using Tapatalk 2
 
Last edited:

Top Liked Posts

  • There are no posts matching your filters.
  • 197
    buildve.png

    This is a guide to Compile From any CyanogenMod and CyanogenMod Source-Based source for Any Phone. This guide is for linux , Ubuntu etc.

    What you’ll need
    • A Phone Which runs Android :p
    • A relatively recent computer (Linux, OS X, or Windows) w/a reasonable amount of RAM and storage. The less RAM you have, the longer the build will take. Using SSDs results in faster builds than traditional hard drives.
    • A micro USB cable
    • A decent Internet connection & reliable electricity :)
    • Some familiarity with basic Android operation and terminology. It would help if you’ve installed custom roms on other devices and are familiar with what a recovery image such as ClockworkMod is, for example. It may also be useful to know some basic command line concepts such as cd for “change directory”, the concept of directory hierarchies, that in Linux they are separated by /, etc.

    Note:
    You want to use a 64-bit version of Linux. According to Google, 32-bit Linux environment will only work if you are building older versions prior to Gingerbread (2.3.x)/CyanogenMod 7.

    Using a VM allows Linux to run as a guest inside your host computer-- a computer in a computer, if you will. If you hate Linux for whatever reason, you can always just uninstall and delete the whole thing. (There are plenty of places to find instructions for setting up Virtualbox with Ubuntu, so I’ll leave it to you to do that.)

    So let’s begin!

    Build ROM and ClockworkMod Recovery



    buildenvironment.png


    Prepare the Build Environment


    Note:
    You only need to do these steps the first time you build. If you previously prepared your build environment and have downloaded the CyanogenMod source code for another device, skip to Next Post.

    Install the SDK
    If you have not previously installed adb and fastboot, install the Android SDK. "SDK" stands for Software Developer Kit, and it includes useful tools that you will can use to flash software, look at the system logs in real time, grab screenshots, and more-- all from your computer.

    Helpful Tip!
    While the SDK contains lots of different things-- the two tools you are most interested in for building Android are adb and fastboot, located in the /platform-tools directory.

    Install the Build Packages
    Several "build packages" are needed to build From Source. You can install these using the package manager of your choice.
    Helpful Tip!
    A package manager in Linux is a system used to install or remove software (usually originating from the Internet) on your computer. With Ubuntu, you can use the Ubuntu Software Center. Even better, you may also use the apt-get install command directly in the Terminal. (Learn more about the apt packaging tool system from Wikipedia.)

    For 32-bit & 64-bit systems, you'll need:
    Code:
    git-core gnupg flex bison gperf libsdl1.2-dev libesd0-dev libwxgtk2.8-dev squashfs-tools build-essential zip curl 
    libncurses5-dev zlib1g-dev openjdk-6-jre openjdk-6-jdk pngcrush schedtool
    For 64-bit only systems, get these:
    Code:
    g++-multilib lib32z1-dev lib32ncurses5-dev lib32readline-gplv2-dev gcc-4.7-multilib g++-4.5-multilib
    For Linux Mint, you'll need:
    Code:
    libc6-dev x11proto-core-dev libx11-dev libgl1-mesa-dev mingw32 tofrodos python-markdown libxml2-utils

    Create the directories
    Code:
    mkdir -p ~/bin

    Install the repo command
    Enter the following to download the "repo" binary and make it executable (runnable):
    Code:
    curl http://commondatastorage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
    chmod a+x ~/bin/repo

    Put the ~/bin directory in your path of execution
    Make sure that the ~/bin directory you just created is in your path of execution so that you can easily run the repo command even when you're not in ~/bin. Assuming you are using the BASH shell, the default in recent versions of Ubuntu, you can set it like this:
    Code:
    export PATH=${PATH}:~/bin

    Helpful Tip!
    You can make this change to the path permanent for all future Terminal sessions:
    Code:
    gedit ~/.bashrc
    This will launch a graphical text editor. Enter
    Code:
    export PATH=${PATH}:~/bin
    on its own line, then save the file.

    Initialize the source repository
    repox.png


    Make a Folder to Download the Sources and cd to it. For That:
    Code:
    mkdir -p ~/Source
    Code:
    cd Source

    Enter the following to initialize the repository:

    REPOSITORY'S OF FAMOUS ROMS (Select One)

    PAC-Man :
    Code:
    repo init -u git://github.com/PAC-man/android.git -b cm-10.2
    CM 11.0 :
    Code:
    repo init -u git://github.com/CyanogenMod/android.git -b cm-11.0
    CM 10.1 :
    Code:
    repo init -u git://github.com/CyanogenMod/android.git -b cm-10.2
    CM10 :
    Code:
    repo init -u git://github.com/CyanogenMod/android.git -b jellybean

    Download the source code
    Code:
    repo sync

    Helpful Tip!
    The repo sync command is used to update the latest source code from CyanogenMod and Google. Remember it, as you can do it every few days to keep your code base fresh and up-to-date.


    Get prebuilt apps
    Code:
    cd ~/Source/vendor/cm
    Code:
    ./get-prebuilts

    How To Compile is there on next post :D
    105
    Prepare the device-specific code

    After the source downloads, type:
    Code:
    . build/envsetup.sh

    Then Do This

    Code:
    breakfast ******
    Where ***** is the codename for your device

    MAKE SURE YOUR PHONE IS ON OFFICIAL LATEST CYANOGENMOD ROM


    Helpful Tip!
    If you get a command not found error for lunch, be sure you’ve done the “. build/envsetup.sh” command from ~/Source. Notice there is a period and space (“. ”) in that command.

    Extract proprietary blobs

    Now ensure that your Phone is connected to your computer via the USB cable and that you are in the ~/Source/device/***/***** directory (you can cd ~/Source/device/***/****** if necessary). Run as Root if on Debian using sudo. Then run the this script:
    Code:
    ./proprietary-files.sh
    or
    Code:
    ./extract-files.sh

    Here ***** is Device codename and *** is the Phone Company like Samsung or HTC
    For Example if my phone is note 2 then this will be the device path : ~/Source/device/Samsung/n7100

    You should see the proprietary files (aka “blobs”) get pulled from the device and moved to the right place in the vendor directory. If you see errors about adb being unable to pull the files, adb may not be in the path of execution

    Note:
    It’s important that these proprietary files are properly extracted and moved to the vendor directory. Without them, CyanogenMod will build without error, but you’ll be missing important functionality, such as the ability to see anything!

    Turn on caching to speed up build

    Code:
    export USE_CCACHE=1

    Start the build

    Code:
    cd ~/Source
    brunch *****
    Here ***** is the Phone Codename

    Helpful Tip!
    If the build doesn't start, try lunch and choose your device from the menu. If that doesn't work, try breakfast and choose from the menu. The command make ***** should then work.

    If the build breaks...
    If you experience this not-enough-memory-related error...
    Code:
    ERROR: signapk.jar failed: return code 1make: *** [out/target/product/n7100/cm_n7100-ota-eng.root.zip] Error 1
    ...you may want to make the following change to This File : system/build/tools/releasetools/common.py
    Change: java -Xmx2048m to java -Xmx1024m or java -Xmx512m
    Then start the build again (with brunch).
    If you see a message about things suddenly being “killed” for no reason, your (virtual) machine may have run out of memory or storage space. Assign it more resources and try again.

    Install the build
    Assuming the build completed without error (it will be obvious when it finishes), type:
    Code:
    # cd $OUT

    in the same terminal window that you did the build. Here you’ll find all the files that were created. The stuff that will go in /system is in a folder called system. The stuff that will become your ramdisk is in a folder called root. And your kernel is called... kernel.
    But that’s all just background info. The two files we are interested in are (1) recovery.img, which contains ClockworkMod recovery, and (2) cm-[something].zip, which contains ROM.

    Install ROM
    Back to the $OUT directory on your computer-- you should see a file that looks something like:
    Code:
    cm-10-20120718-UNOFFICIAL-***.zip
    Here *** is the phone codename

    Now you can flash the ...zip file above as usual via recovery mode. (Be sure you have backed up any previous installation before trying your new build.)


    Feedbacks to this guide
    I got my build working!
    Great tutorial by the way!
    Tom

    Well i finally sucessfully build.
    thank you for your help

    Works like a charm, used it a while ago too set up on 12.10 :)

    Compiling cm10.1 worked great for my sgs3 d2tmo.Thank's for the tutorial it's been fun setting this up.

    really really good guide, very detailed and precise.

    Hi there,
    I was finally able to compile Cyanogenmod from source.
    So, thanks for your guide an your support.Thanks a lot.
    Regards Koetermann

    Used your guide again to setup my PC for building! Worked like a charm on 11.04

    thanks for post this, great and simple guide for n00bs (like me)

    This tutorial ROCKS! :good: . Successfully built i9300 starting from fresh ubuntu 12.10 installation w/o even a hickup :D





    Read the Below Command Before Asking question regarding Device tree : Credit @speed_bot
    HTML:
    #include
    #include /ps my own header/
    main()
    {
    int device tree,rom;
    for((device==1) || (device tree =1))
    printf("you can build a rom");
    else 
    printf("you cant :P");
    }
    18
    The issue with guides like these is they are specific to one version of Ubuntu. I successfully build Android on gentoo, which has about as little in common with Ubuntu as possible. Hence we prefer to go for guides which, where possible, teach the reasoning, rather than the method.

    For building CM, this might be worthwhile merging into the "how to build android from source" one?

    Unfortunately this guide isn't usable for most people, as it relies on the hacksung build scripts, so you can only build for certain devices...

    What might be better is a guide on using roomservice via lunch, to build for any device?
    6
    What if i want to compile the PAC rom?
    https://github.com/PAC-man

    Downloading Ubuntu now!! Excited!! :)

    Edit figured it out myself!!
    repo init -u git://github.com/PAC-man/android.git -b jellybean
    thankx anyways...

    ya and you might need a minor edits to makefiles in the config ...


    btw

    this is a thread maintained by me
    http://xdaforums.com/showthread.php?t=2059939

    so feel free to post your errors that you encounter....

    @op

    explain what every step means rather then just copy paste....

    ---------- Post added at 06:37 PM ---------- Previous post was at 06:35 PM ----------

    Isn't "apt" the "stock" package manager in (K)Ubuntu?

    But I've another question @mithun46: Is it possible, that your guide only works on a 64bit edition of ubuntu? So that 32bit installations ain't supported?

    32bit systems don't have the packages to build jb and above.. so it wont work with 32bit systems..
    6
    Guys The Developer Comitee said me to apply for RC title. Don't know what to do.
    If I get more than ten thanks on this post I will apply

    Sent from my GT-P7300 using xda premium