Related
First, follow these instructions to get your system setup for build:
http://wiki.cyanogenmod.com/index.php?title=Compile_CyanogenMod_for_Sholes
You'll need at least 15GB of disk space. Once you've got all the prerequisites installed:
Code:
mkdir ~/android
cd ~/android
repo init -u git://github.com/Mioze7Ae/android.git -b froyo
repo sync -j 2
. build/envsetup.sh
lunch cyanogen_sholest-eng
vendor/cyanogen/get-rommanager
make -j 2 bacon
If everything goes well, the update package will be something like out/target/product/sholest/update-cm-6.1.2-0.10-11.08.08-MilestoneXT720-signed.zip
This is my current understanding of the voodoo:
repo init : sets up your repository and downloads a manifest file that identifies other repositories
repo sync : downloads all the repositories and checks out a working copy
. build/envsetup.sh : parses all the makefiles and such to create a menu of available devices to build
lunch : configures the source tree to build a specific device (run lunch with no arguments to get a menu)
get-rommanager : apparently needed for some reason
make bacon : actually builds everything and creates the ota package. You may want to consider something like "make -j 8 bacon >build.out 2>build.err"
repo sync takes either metric or imperial eons (whichever is larger) (-j N can help by opening multiple concurrent downloads if you have a fast uplink). On a dual AMD Opteron 248 machine with 6GB build takes about 3 hours (Ubuntu 11.04 64-bit). On a dual Xeon [email protected] (8 cores total) with 16GB RAM running debian lenny 64-bit, build takes ~15 min. You want to pick the -j to be 1-2 times the number of CPUs (I used -j 2 on the AMD and -j 8 on the Xeon). The android build system does a pretty good job at pegging your CPUs.
I don't currently know how to tag the state of the entire tree, so when nadlabak or milaq or anyone else updates repositories that I didn't fork, there's a chance it may break things from time-to-time. I'm currently waiting for a build from a fresh checkout to complete. Hopefully it's not broken...
Edit: Fresh compile succeeded, update applied and booted. Happy hacking!
Feel free to peruse my repositories at http://github.com/Mioze7Ae
See also: http://android.doshaska.net/cm6build
Thanks: nadlabak, milaq, stlifey, #milestone-modding
Thanks, will add cm6 to mine build server. =)
Maybe we should make todo list and make changes that we need?
Then move it to main build tree?
fjfalcon said:
Thanks, will add cm6 to mine build server. =)
Maybe we should make todo list and make changes that we need?
Then move it to main build tree?
Click to expand...
Click to collapse
Im on it.. flashing once i have finished uploading XT720 XDA Special Hellmonger Edition, il collect data and proc
i was able to compile configs.ko
so we can dump the config of the running moto kernel
Code:
insmod configs.ko
zcat /proc/config.gz
attached is tar with module and dumped config from Central Europe kernel...
so may be finally we will be able to "debug" why on the singapore kernel it is stated that tvout works, and did not work on other kernels....
So please do:
Code:
adb push configs.ko /tmp
adb shell
/system/bin/insmod /tmp/configs.ko
exit from adb shell
Code:
adb pull /proc/config.gz
and post
Which Kernel (e.g. Central European, Korean, Singapore, Cincinaty etc....) is used
and the corresponding config.gz
edit: forget to attache
badly.... it is not the runing kernel config, but the config i have compiled.... sorry
du -h .repo - how much it has?
fjfalcon said:
du -h .repo - how much it has?
Click to expand...
Click to collapse
$ du -hs .repo
4.2G .repo
$ du -hs .
12G .
FYI, I just merged updates from milaq's repo and broke the build. Will update when I get it sorted again.
Mioze7Ae said:
FYI, I just merged updates from milaq's repo and broke the build. Will update when I get it sorted again.
Click to expand...
Click to collapse
It's working again. I'm still getting the hang of this repo/git stuff. What appears to have happened is that when I first forked milaq's repo a few weeks ago I happened to fork after the first part of a two-part commit. So, now the tree is sync'd up with milaq's latest (0.12--screenshot in powermenu, w00t!). It installs and boots but it's minimally tested.
Maybe you can archive android dir and paste it to some speed hosting?
Cause i still getting it at build server at mine work that currently free....
fjfalcon said:
Maybe you can archive android dir and paste it to some speed hosting?
Cause i still getting it at build server at mine work that currently free....
Click to expand...
Click to collapse
Hmm. I'm I'll see about that, but .repo is 4GB... and android is 12GB... that's going to be slow nomatter what... and those stupid rapid/multi/whatevers don't seem to handle resume... after the initial repo sync, the next sync is much faster.
Is repo sync still down? Or rather, is android.git.kernel.org still down? I tried repo syncing from RC2 to RC3, so I could implement a patch for Exchange security features (more on this later, I will update when I get it working).
For now, I will try the compile on RC2.
I do know it was down last Friday, but I haven't had a chance to try more recently.
hi,
I'm wondering if someone can help me with compiling android from source. I've set up the build environment as described here: http://developer.android.com/guide/index.html
and downloaded the CM sources via repo.
the biggest question that I have at the moment is, how do I merge the code from our devs with the CM sources and then start compiling the whole thing? e.g. if I downloaded CM10 and want to merge it with marcellusbe's git development files..
I'm a bit confused about all the shell scripts in the CM sources..
do I need the kernel sources? or can I use for example one of the flashable zip files?
maybe someone can lead me through this step by step, or make a step by step tutorial, which would be great.
I do have linux experience but I'm not really into development stuff.
thanks in advance
sharukins said:
hi,
I'm wondering if someone can help me with compiling android from source. I've set up the build environment as described here: http://developer.android.com/guide/index.html
and downloaded the CM sources via repo.
the biggest question that I have at the moment is, how do I merge the code from our devs with the CM sources and then start compiling the whole thing? e.g. if I downloaded CM10 and want to merge it with marcellusbe's git development files..
I'm a bit confused about all the shell scripts in the CM sources..
do I need the kernel sources? or can I use for example one of the flashable zip files?
maybe someone can lead me through this step by step, or make a step by step tutorial, which would be great.
I do have linux experience but I'm not really into development stuff.
thanks in advance
Click to expand...
Click to collapse
1. Download sources from CM
Code:
# mkdir cm10
# cd cm10
cm10 # repo init -u git://github.com/CyanogenMod/android.git -b jellybean
cm10 # repo sync -j4
2. Take my cm10 device config from git and put it in device/samsung folder. It is not updated yet with all the fixes but good to start compiling.
there are problems in compiling with external/valgrind and external/regex-re2 : thanks to aaa801, he gave me link to a valgrind patch that solves the compile failure for armv6.
For regex-re2, for now, just delete the folder.
then you can compile jellybean :
Code:
cm10 # . build/envsetup.sh
cm10 # lunch
You're building on Linux
Lunch menu... pick a combo:
1. full-eng
2. full_x86-eng
3. vbox_x86-eng
4. mini_armv7a_neon-userdebug
5. mini_armv7a-userdebug
[B]6. cm_apollo-userdebug[/B]
7. full_panda-userdebug
8. cm_grouper-userdebug
9. cm_maguro-userdebug
10. cm_toro-userdebug
11. cm_toroplus-userdebug
Which would you like? [full-eng] [B]6[/B]
cm10 # make -j4
Jellybean needs modifications in the initial ramdisk ... I can provide you the kernel until I upload the changes to github.
providing the kernel would be great
but I can wait until you upload the latest changes and fixes, too
Hi,
I'm going to port Firefox OS to my I9082 but I have some problems after "./config.sh i9082".
It can't get some repositories from android.git.linaro.com and after that it stuck at "Fetching objects: 25% (20/78)" and after this, I waited for 8 hours!!!!! :crying:
after this, i closed the terminal.
I tried again using "repo sync" to continue but there is a new problem! It says that some of repos not found! for example i can't get "platform/external/freetype" and "platform/external/dbus" from linaro git.
Can anybody help me?
Delete broken projects and sync again
DataUnit said:
Hi,
I'm going to port Firefox OS to my I9082 but I have some problems after "./config.sh i9082".
It can't get some repositories from android.git.linaro.com and after that it stuck at "Fetching objects: 25% (20/78)" and after this, I waited for 8 hours!!!!! :crying:
after this, i closed the terminal.
I tried again using "repo sync" to continue but there is a new problem! It says that some of repos not found! for example i can't get "platform/external/freetype" and "platform/external/dbus" from linaro git.
Can anybody help me?
Click to expand...
Click to collapse
Delete all folder expect .repo and start over.
arky_r said:
Delete all folder expect .repo and start over.
Click to expand...
Click to collapse
I did this action 4 times and when I executed the command again, it will stop at another project! :crying:
DataUnit said:
I did this action 4 times and when I executed the command again, it will stop at another project! :crying:
Click to expand...
Click to collapse
Did you reading the repo tips at xda-universityDOTcom ?
Syncing a full new source tree in minutes!
Time might come when you’ll need to work with several full source trees. For example, you may want to have an AOKP source tree as well as a CM tree.
Obvisouly, you could repeat the same steps, to repo init and then repo sync -j 8 -c for both. But that would be twice as time consuming.
There is an alternative that should be much faster. Lets say that you have already initialized and synced a CM source tree, in ~/android/cm.
Now, we will prepare a new repo for AOKP tree, in ~/android/aokp. Here comes the trick: We will use the --reference flag of repo init to indicate to repo that we already have a local repository that it can take information from, instead of downloading everything from Internet again:
mkdir ~/android/aokp cd ~/android/aokp repo init --reference=~/android/cm -u git://github.com/AOKP/platform_manifest.git -b jb
1
2
3
mkdir ~/android/aokp
cd ~/android/aokp
repo init --reference=~/android/cm -u git://github.com/AOKP/platform_manifest.git -b jb
You should notice a big time diference, from hours for a full repo sync, down to minutes using this trick!
Docker template for building CyanogenMod
Building CyanogenMod requires quite a lot of work. You will need to install a large number of dependencies, and you will need to read through lots of documentation.
Docker is a rather new software to automate the deployment of applications inside a software container.
Here is a Docker container for running an environment which contains everything that is needed to compile CyanogenMod. It will be very easy to install, and it will just work! The Github page contains some further information on how to get started.
NOTE: You will need to install Docker to proceed: https://www.docker.io/gettingstarted/
How to run:
Code:
git clone https://github.com/stucki/docker-cyanogenmod.git
cd docker-cyanogenmod
./run.sh
How to build CyanogenMod for your device:
Code:
repo init -u git://github.com/CyanogenMod/android.git -b cm-13.0
repo sync
source build/envsetup.sh
brunch <device codename> # example: brunch grouper
Download:
Github URL: https://github.com/stucki/docker-cyanogenmod
ChangeLog:
see https://github.com/stucki/docker-cyanogenmod/blob/master/CHANGELOG.md
Questions and Answers:
see http://forum.xda-developers.com/android/help/qa-docker-template-building-cyanogenmod-t3173025
Any feedback is welcome. Enjoy!
michael_ch said:
Docker template for building CyanogenMod
Building CyanogenMod requires quite a lot of work. You will need to install a large number of dependencies, and you will need to read through lots of documentation.
Docker is a rather new software to automate the deployment of applications inside a software container.
Here is a Docker container for running an environment which contains everything that is needed to compile CyanogenMod. It will be very easy to install, and it will just work! The Github page contains some further information on how to get started.
How to build:
Code:
git clone https://github.com/stucki/docker-cyanogenmod.git
cd docker-cyanogenmod
./build.sh
How to run:
Code:
cd docker-cyanogenmod
./run.sh
How to build CyanogenMod for your device:
Code:
repo init -u git://github.com/CyanogenMod/android.git -b cm-11.0
repo sync
source build/envsetup.sh
breakfast <device codename> # example: breakfast grouper
brunch <device codename> # example: brunch grouper
Download:
Github URL: https://github.com/stucki/docker-cyanogenmod
ChangeLog:
Code:
2014-02-16
* Initial release
Any feedback is welcome. Enjoy!
Click to expand...
Click to collapse
seems interesting!!!!
Awesome !!! Thanks a lot OP
michael_ch said:
Docker template for building CyanogenMod
Click to expand...
Click to collapse
:good: nice.......
You missed one point though .....
Code:
BUILD_HOST_32bit=1 (Cyanogenmod needs 32 bit binaries to compile)
and you can incorporate this in your code
Code:
RUN apt-get purge openjdk-\* icedtea-\* icedtea6-\*
RUN add-apt-repository ppa:webupd8team/java
RUN apt-get update && sudo apt-get install oracle-java6-installer
This installs the correct jdk for cyanogenmodand resolves the incorrect jre errors some people will get..Just my 2 cents!!..
There is scope for expansion, I have a built a similar tool but not getting the time anymore to push new updates..,,,anyways keep up the good work..
Wow. This is superb. ! This will really reduce our most of the work. Thanks op
Dark Wraith said:
:good: nice.......
You missed one point though .....
Code:
BUILD_HOST_32bit=1 (Cyanogenmod needs 32 bit binaries to compile)
Click to expand...
Click to collapse
32bit libraries are installed on the system. Just try it out, I successfully built images for i9100 and grouper without specifying this line...
Dark Wraith said:
and you can incorporate this in your code
Code:
RUN apt-get purge openjdk-\* icedtea-\* icedtea6-\*
RUN add-apt-repository ppa:webupd8team/java
RUN apt-get update && sudo apt-get install oracle-java6-installer
Click to expand...
Click to collapse
Again, I don't get those errors. Anyone else encountering these problems?
Dark Wraith said:
This installs the correct jdk for cyanogenmodand resolves the incorrect jre errors some people will get..Just my 2 cents!!..
There is scope for expansion, I have a built a similar tool but not getting the time anymore to push new updates..,,,anyways keep up the good work..
Click to expand...
Click to collapse
Thank you! I will do my best...
I get this error when running
"./build.sh"
./build.sh: 10: ./build.sh: docker: not found
Dasmikko said:
I get this error when running
"./build.sh"
./build.sh: 10: ./build.sh: docker: not found
Click to expand...
Click to collapse
Well. You will need to install Docker, of course, see https://www.docker.io/gettingstarted/#h_installation.
Sorry, I thought it's clear. But I will update the post accordingly...
very interesting. will try
ubuntu 32 bit not works for this???
michael_ch said:
Well. You will need to install Docker, of course, see https://www.docker.io/gettingstarted/#h_installation.
Sorry, I thought it's clear. But I will update the post accordingly...
Click to expand...
Click to collapse
Works now
So does this create a local_manifest.xml(which is needed) for you if you're trying to build for an unsupported device
sent from my JEDI ELITE Note 3
for best xda results, click to enlarge ?
http://img268.imageshack.us/img268/9564/searchitnoob.gif
markbencze said:
So does this create a local_manifest.xml(which is needed) for you if you're trying to build for an unsupported device
Click to expand...
Click to collapse
Nope, the manifest is created by running the "breakfast" command. Check the 1st post for more info.
I have also used this box to successfully build an image for the Motorola Moto G. As this is not part of the CyanogenMod project yet, I had to install the manifest using the steps described on the following Github page: https://github.com/razrqcom-dev-team/android_local_razrqcom
Code:
# see https://github.com/razrqcom-dev-team/android_local_razrqcom
mkdir .repo/local_manifests
repo init -u git://github.com/CyanogenMod/android.git -b cm-11.0
curl -L -o .repo/local_manifests/msm8226.xml -O -L https://raw.github.com/razrqcom-dev-team/android_local_razrqcom/msm8226-kk/msm8226.xml
curl -L -o .repo/local_manifests/vendor.xml -O -L https://raw.github.com/razrqcom-dev-team/android_local_razrqcom/msm8226-kk/vendor.xml
# after that, sync all repositories
repo sync
# start building falcon (that's the codename for the Moto G)
source build/envsetup.sh
brunch falcon
Kudos for this goes to @dhacker29 and his team!
michael_ch said:
Nope, the manifest is created by running the "breakfast" command. Check the 1st post for more info.
I have also used this box to successfully build an image for the Motorola Moto G. As this is not part of the CyanogenMod project yet, I had to install the manifest using the steps described on the following Github page: https://github.com/razrqcom-dev-team/android_local_razrqcom
Click to expand...
Click to collapse
Ok well maybe I'll give it a whirl then. I was trying to build beanstalk for the n3 and I init the repo referencing the cm repo I already had synced, then sunced repo etc. When I tried breakfast there was no option to choose my device.
So by using this tool and following your directions will it allow me to do so then?
sent from my JEDI ELITE Note 3
for best xda results, click to enlarge ?
http://img268.imageshack.us/img268/9564/searchitnoob.gif
Is this only cyanogenmod restricted or we can use on other ROMs also?
Sent from my GT-I9100 using XDA Premium 4 mobile app
I get permission denied?
safariking said:
I get permission denied?
Click to expand...
Click to collapse
Run with sudo
markbencze said:
So by using this tool and following your directions will it allow me to do so then?
Click to expand...
Click to collapse
This is not a tool, it is just a script which creates a virtual machine with all that is needed for building CyanogenMod.
koolkunz said:
Is this only cyanogenmod restricted or we can use on other ROMs also?
Click to expand...
Click to collapse
Looking at the build requirements for OmniROM, I think it will also work for other ROMs: http://docs.omnirom.org/Setting_Up_A_Compile_Environment
In case that something is missing, just update the Dockerfile and run build.sh to rebuild the image.
michael_ch said:
This is not a tool, it is just a script which creates a virtual machine with all that is needed for building CyanogenMod.
Looking at the build requirements for OmniROM, I think it will also work for other ROMs: http://docs.omnirom.org/Setting_Up_A_Compile_Environment
In case that something is missing, just update the Dockerfile and run build.sh to rebuild the image.
Click to expand...
Click to collapse
OK..thanks...I wanna build omni
Sent from my GT-I9100 using XDA Premium 4 mobile app
I just did a build for grouper, but I can't find the builded file.. Where does it go? and does it output a zip file?
michael_ch said:
Docker template for building CyanogenMod
Building CyanogenMod requires quite a lot of work. You will need to install a large number of dependencies, and you will need to read through lots of documentation.
Docker is a rather new software to automate the deployment of applications inside a software container.
Here is a Docker container for running an environment which contains everything that is needed to compile CyanogenMod. It will be very easy to install, and it will just work! The Github page contains some further information on how to get started.
NOTE: You will need to install Docker to proceed: https://www.docker.io/gettingstarted/
How to build:
Code:
git clone https://github.com/stucki/docker-cyanogenmod.git
cd docker-cyanogenmod
./build.sh
How to run:
Code:
cd docker-cyanogenmod
./run.sh
How to build CyanogenMod for your device:
Code:
repo init -u git://github.com/CyanogenMod/android.git -b cm-11.0
repo sync
source build/envsetup.sh
breakfast <device codename> # example: breakfast grouper
brunch <device codename> # example: brunch grouper
Download:
Github URL: https://github.com/stucki/docker-cyanogenmod
ChangeLog:
Code:
2014-02-16
* Initial release
Any feedback is welcome. Enjoy!
Click to expand...
Click to collapse
bro can this be used to make unofficial ports too???
I assume you already have all your build packages installed. This guide is merely showing how to obtain a mirror copy of the android source for local purposes.
I will be using OmniRom for the duration of this guide, but for those who use CM or other projects, the concept should remain the same.
I do not expect this guide to be useful for everyone but there will be many who are going to be thankful that did not initially know this could be done.
Due to the rapid development, I ran into a huge issue pretty quickly when having to nuke/resync the various repos for building. The total space required for a full omni source is roughly 508,334 items, totaling 14.4 GB based on today from branch android-5.1 and requires pulling from a massive number of git repos online. So if bandwidth is an issue then constantly syncing after nuking the source could become an issue for you real quick. Not to mention the time it takes just to pull all of this data from the internet onto your computer.
However, by creating a Mirror of the source and its numerous git repos, the source is roughly 19,696 items, totalling 16.5 GB based on today from branch android-5.1.
Now, for those asking, why do a mirror? It is relatively simple. When using several sources, especially in situations where bandwidth is scarce, it is better to create a local mirror of the entire content, and to sync from that mirror (which requires no network access). The download for a full mirror is smaller than the download of two sources, while containing more information.
These instructions assume that the mirror is created in /path/to/home/android/mirror. The first step is to create and sync the mirror itself.
Code:
mkdir -p ~/android/mirror
Code:
cd ~/android/mirror
Code:
repo init -u https://github.com/omnirom/android.git -b android-5.1 [COLOR="Red"]--mirror[/COLOR]
Code:
repo sync -j# -f --no-clone-bundle
Basically this allows you to initialize a local mirror of an android repo (--mirror) and then later allow you to point subsequent repo pulls to that local copy which will be explained further into this guide. The mirror looks nothing like the actual source used to make builds.
Once the mirror repo has synced, then we are ready to establish the actual source in another directory that will pull directly from the mirror locally.
Code:
mkdir -p ~/android/omni
Code:
cd ~/android/omni
Code:
repo init -u git://github.com/omnirom/android.git -b android-5.1 [COLOR="Red"]--reference=/path/to/home/android/mirror/[/COLOR]
Code:
repo sync -j# -f --no-clone-bundle
Note the use of the ‘–-reference’ parameter. This uses my local mirror of the android sources instead of pulling across the network again.
Now I can pull one of the various repos, using that same ‘--reference’ parameter (pointed at my local omni mirror) and profit!
From here on out, should I want to update the omni source with the latest changes I just go to the mirror directory and run:
Code:
repo sync
Then, I switch over to the omni directory and run the same command to pull those changes from the local directory.
Even further, should I nuke something in the omni directory, I can simply delete it and run repo sync to pull from the local mirror to fix the problem and never have to worry about pulling data from the network itself.
Here is an example for a clearer picture:
I make changes in /android/omni/bootable/recovery
I do not like the changes I have made
I delete /android/omni/bootable recursively
I run repo sync to restore /android/omni/bootable
The sync pulls from the local mirror instead of downloading the repo from the internet.
Time for syncing is cut in half if not more
Everything is still intact
Thanks for that bro us Linux noobs will find it very useful