Ok so I was searching and searching for a guide on how to compile CM7 source, and finally found a way to do it on the latest Ubuntu 11.10 oneiric
Updated info for non-debian based systems thanks to Vicodan:
If you want to use this on fedora or non-debian based systems you will need to replace every command that says apt-get to yum. Thanks to Vicodan for pointing this out as I do not use fedora myself.
Hardware Requirements:
- A minimum dual core pc, the more ram the better
- A working wifi connection
- Linux Operating System. Either 32-bit or 64-bit will work
NOTE: 64-bit will run faster
Optional Recommended Software:
Many of these can be found in the software center using the search box
If you find multiple versions it's ok to install them all, unless it says
otherwise
- Python
Alternatively open the terminal application and type
Code:
$ sudo app-get install python
Note: Enter your login password to install
- awk and gawk
- 7zip
- RAR
Code:
$ sudo apt-get install rar
Step 1 java:
Setting up java is one of the most important step to getting your pc prepared for a build environment. First check the java version that is installed on your pc
NOTE: On Ubuntu 11.10, and variants, you need to enable the
parter repository to install sun-java6-jdk:
Code:
$ sudo add-apt-repository "deb http://archive.canonical.com/ maverick partner"
Code:
$ java -version
The correct version is:
Code:
java -version
java version "1.6.0_26"
Java(TM) SE Runtime Environment (build 1.6.0_26-b03)
Java HotSpot(TM) 64-Bit Server VM (build 20.1-b02, mixed mode)
You must have a 1.6.x to compile on the gingerbread branch of cyanogenmod. If you have the correct version skip down to Step 2.
1a - First install the correct version:
Code:
$ sudo apt-get install sun-java6-jdk sun-java6-jre
1b - Now you will need to manually remove the other java version
Code:
$ sudo nautilus
This will open up a root file explorer. Once it opens click on the "file
system" tab on the left and navigate to the /usr/lib/jvm
Once there you should see two types of java. If you see java open jdk
you need to delete it, along with it's associated bin folder. Close the
root file explorer window
1c - Edit .bashrc
Next navigate to your home folder and open up the .bashrc file. This is
a hidden file so you will have to press Ctrl + H to see it. Add the
following lines to the top section, and change accordingly to your path
Example:
Code:
#JavaDev PATH
export JAVA_HOME=/usr/lib/jvm/java-6-sun-1.6.0.24
export PATH=$PATH:$JAVA_HOME/bin
Save the file and exit, then changes will not take effect until reboot
Verify java version again
Code:
$ java -version
Step 2 - Install git
http://help.github.com/linux-set-up-git/
or
Code:
$ sudo apt-get install git
Step 3 - Prepare the Build Environment
NOTE: You only need to do these steps the first time you build.
If you previously prepared your build environment, skip to Copy
proprietary files.
3a - Install the ADB
Install the Android SDK. http://wiki.cyanogenmod.com/index.php?
title=Howto:_Install_the_Android_SDK
3b - Install the Build Packages
Install using the package manager of your choice:
For 32-bit & 64-bit systems:
Code:
$ [COLOR="red"]sudo apt-get install[/COLOR] 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
For 64-bit only systems:
Code:
$ [COLOR="red"]sudo apt-get install[/COLOR] g++-multilib lib32z1-dev lib32ncurses5-dev [COLOR="Red"]lib32readline-gplv2-dev[/COLOR] [COLOR="Red"]gcc-multilib g++-multilib[/COLOR]
3c - Create the Directories
You will need to set up some directories in your build environment.
To create them:
Code:
$ mkdir -p ~/bin
$ mkdir -p ~/android/system
3d - Install the Repository
Enter the following to download make executable the "repo" binary:
Code:
$ [COLOR="red"]curl https://raw.github.com/android/tools_repo/master/repo > ~/bin/repo[/COLOR]
$ chmod a+x ~/bin/repo
NOTE: You may need to reboot for these changes to take effect.
Now enter the following to initialize the repository:
Code:
$ cd ~/android/system/
$ [COLOR="red"]repo init -u git://github.com/CyanogenMod/android.git -b gingerbread --repo-url=git://github.com/android/tools_repo.git[/COLOR]
$ repo sync
3e - Copy proprietary files
NOTE: This only needs done the first time you build. If you have
already done these steps, you may skip to Download RomManager.
You will need to have a speedy with a working copy of CyanogenMod
install and ADB working on the computer. This script will copy the
proprietary files from the device.
Connect the device to the computer and ensure that ADB is working
properly.
Code:
$ cd ~/android/system/device/htc/speedy/
./extract-files.sh
3f - Download RomManager
NOTE: This only needs to be done when an update to
RomManager is released. If you are-up-to date, you may skip to Building
CyanogenMod. Download RomManager which is needed by the build:
Code:
$ ~/android/system/vendor/cyanogen/get-rommanager
3g - Building CyanogenMod
Check for updates
First, check for updates in the source:
Code:
$ cd ~/android/system/
$ repo sync
$ cp build/core/root.mk -f Makefile
3h - Set up your Compiler
This is optional but helpful for kernel compiling
There are a lot of things that need to be added to the .bashrc to let your
pc know about which type of compiler you want to use. The best way is
to use the one provided in the CM7 work tree.
Code:
[COLOR="red"]#Android[/COLOR]
export ARCH=arm
export CCOMPILE=$CROSS_COMPILE
export PATH=$PATH:~/android/system/prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin
3i - Configure Build & Compile
Now, the environment must be configured to build and the ROM
compiled, from code, for the Speedy.
Code:
$ . build/envsetup.sh && brunch speedy
3j - Install
Copy your .zip file from
~/android/system/out/target/product/speedy/update.cm-XXXXX-
signed.zip to the root of the SD card.
Optional: Download Google Apps for CyanogenMod 7 and place it on the
root of the SD card.
Flash both of these .zip files from recovery.
Nice write up. When I have time I'll see if it works for me.
riggsandroid said:
Nice write up. When I have time I'll see if it works for me.
Click to expand...
Click to collapse
Yeah this was a quick write up. The main thing is you have to reboot every time you edit your .bashrc, or copy and paste it into terminal
Also I'll be doing a how to compile kernel, hopefully soon
Or just when you change your bashrc, just source the bashrc script
. ~/.bashrc
Sent from my PG06100 using XDA App
Has anyone tried a swap file yet? I just set mine up and it seems to speed compiling up quite a bit. I went off of this guide but I made mine 1.6GB in size
https://help.ubuntu.com/community/SwapFaq
You are a savior... I have been trying to get this running on my natty tower, but have had little success... This write up will be very handy... Thank you for the excellent write up and the time for doing it...
Sent from my PG06100 using Tapatalk
New java update?
I noticed that my java was not all the way up to date. I went into recovery and selected fix broken packages and then it updated my java to this version:
~$ java -version
java version "1.6.0_25"
Java(TM) SE Runtime Environment (build 1.6.0_25-b06)
Java HotSpot(TM) 64-Bit Server VM (build 20.0-b11, mixed mode)
On a side note it also updated my python and some other things. Make sure you have internet that is not wifi
guide updated for korg workaround. Changes are labeled in red
Repo not found?
Followed Directions to the T, Currently Hung up on
Code:
$ repo init -u git://github.com/CyanogenMod/android.git -b gingerbread --repo-url=git://github.com/android/tools_repo.git
Tells me repo command not Found
EDIT: I'm sorry hows about more info?, Ubuntu 11.10 64bit need anymore just ask
Nice guide. Can I do this on Fedora?
riggsandroid said:
Nice write up. When I have time I'll see if it works for me.
Click to expand...
Click to collapse
...6 months later.
Ya find any of that time yet, Riggs?
JaceAlvejetti said:
Followed Directions to the T, Currently Hung up on
Code:
$ repo init -u git://github.com/CyanogenMod/android.git -b gingerbread --repo-url=git://github.com/android/tools_repo.git
Tells me repo command not Found
EDIT: I'm sorry hows about more info?, Ubuntu 11.10 64bit need anymore just ask
Click to expand...
Click to collapse
Did you set up ~/bin/repo yet? Never had that issue before. Probably need to reboot once for the repo to take effect. Just like it says on the OP.
Sent from my PG06100 using xda premium
VICODAN said:
Nice guide. Can I do this on Fedora?
Click to expand...
Click to collapse
I wish I knew more about fedora, but I just don't, sorry.
Sent from my PG06100 using xda premium
sparksco said:
I wish I knew more about fedora, but I just don't, sorry.
Sent from my PG06100 using xda premium
Click to expand...
Click to collapse
It works fine on fedora just change the apt-get to yum
Great guide, thanks sparksco
Sent from my PG06100 using Tapatalk
VICODAN said:
It works fine on fedora just change the apt-get to yum
Click to expand...
Click to collapse
Sweet thanks for pointing that out. I've been meaning to update this guide when I have time later when I get home I'll update more info on it. I've also been wanting to try fedora for quite some time.
Sent from my PG06100 using xda premium
jesusice said:
...6 months later.
Ya find any of that time yet, Riggs?
Click to expand...
Click to collapse
I was wondering about this too
Sent from my PG06100 using xda premium
OP updated
Updated OP to include Vicodan's instructions and this is to build kanged editions of Cyanogenmod. I will also start posting my own versions of the kanged builds here when I get a build that will include my own extra mods.
Awesome guide. I'll be trying this soon. Tonight, if the wife and kids cooperate. Which usually translates to 'a week from now' lol...
Sent from my SPH-D700 using Tapatalk
NawtyB78 said:
Awesome guide. I'll be trying this soon. Tonight, if the wife and kids cooperate. Which usually translates to 'a week from now' lol...
Sent from my SPH-D700 using Tapatalk
Click to expand...
Click to collapse
Its all good. me and sparksco use regular Ubuntu and it runs great
This is a guide to build CyanogenMOD 10.2 (Android 4.3) for the HTC One. This guide is for OS X Mountain Lion (10.8.X).
[size=+1]Pre Requirements:[/size]
1) go to App Store on your OS X and Download Xcode 4. Once that is installed, open Xcode and go to preferences. There you find a tab “DOWNLOADS”, open it and there you can find “Command line tools” and next to it click INSTALL. It will take a few minutes to download and install
2) Make sure you have the android-sdk downloaded and setup adb and fastboot, so they work. It is recommended to place the android-sdk to /usr/local/
[size=+1]Initializing the build environment[/size]
First we need to set up our OS X to be able to build Android. This needs some extra things compared to for example, building in Linux, but the main stuff is pretty much the same. So let’s get started then, shall we?
Open up Terminal and type
Code:
java
If you don’t have java installed you will get a prompt to install it.
Next we will install homebrew (you can also use macports if you like)
Code:
ruby <(curl -fsSk https://raw.github.com/mxcl/homebrew/go)
Now make sure android-sdk and homebrew are in $PATH
Code:
touch ~/.bash_profile && echo "PATH=/usr/local/bin:/usr/local/sbin:$PATH:/usr/local/android-sdk/tools:/usr/local/android-sdk/platform-tools" >> ~/.bash_profile
I also recommend to add this edit to the .bash_profile file:
Code:
nano –w ~/.bash_profile
Code:
export BUILD_MAC_SDK_EXPERIMENTAL=1
Now run this and see if you need to update anything.
Code:
brew doctor
If you do (and you probably will once a day) type:
Code:
brew update
Now we need to get our dev packages
Code:
brew install git coreutils findutils gnu-sed gnupg pngcrush repo
Once that is done, run
Code:
brew outdated
if it shows anything, run
Code:
brew upgrade
Now run this the correct a few symlinks [Not sure if these are needed anymore]:
Code:
ln -s /usr/local/bin/gfind /usr/local/bin/find && ln -s /usr/local/bin/gsed /usr/local/bin/sed
Now to create our case sensitive image for our CM work [NOTE: the 60g can be changed to anything. It only takes up what it needs but I used 60GB]:
Code:
hdiutil create -type SPARSE -fs "Case-sensitive Journaled HFS+" -size 60g -volname "android" -attach ~/Desktop/Android
Now to create our working directory
Code:
cd /Volumes/Android && mkdir cm10.2 && cd cm10.2
[size=+1]Getting the source[/size]
Now to initialize the git and to download it
Code:
repo init -u git://github.com/CyanogenMod/android.git -b cm-10.2
Download the sources:
Code:
repo sync
Wait until it is finished. It will take a long time, depending on your internet connection.
[size=+1]Obtain the device build files and proprietary files:[/size]
To do this we will use CyanogenMods "tool" called roomservice. Roomservice is replacing the old local_manifest.xml file. Just run the code below to create the file directly into the folder.
Code:
nano -w /Volumes/android/cm10.2/.repo/local_manifests/roomservice.xml
Paste the following lines into the file:
Code:
<manifest>
<project name="TheMuppets/proprietary_vendor_htc.git" path="vendor/htc" remote="github" revision="cm-10.2"/>
</manifest>
It seems that nowadays you only need to have the TheMuppets repo there, the roomservice process takes care of the rest and downloads the needed mako bits automatically. And actually it doesn't matter what you name the xml file under the local_manifests directory. The process loads every xml file from there in a alphabetical order. If you still have that local_manifest.xml file in your .repo directory, i suggest you remove that, because at that case that file will be read first and after that all the other from the local_manifests folder
Save the file. And rerun the code:
Code:
repo sync
Download the necessary pre-builts:
Code:
/Volumes/android/cm10.2/vendor/cm/get-prebuilts
That is all. The sources are now ready.
[size=+1]Building CyanogenMOD[/size]
If you build now, you're probably gonna get kernel build errors regarding the missing elf.h header (this error might be device specific). Fortunately, we already have this file downloaded, so we only need to copy it to /usr/local/include:
Code:
cp /Volumes/android/cm10.2/external/elfutils/libelf/elf.h /usr/local/include
FINALLY, we are ready to build:
Code:
cd /Volumes/android/cm10.2 && source build/envsetup.sh && brunch m7ul
The upper command will start the build for the international version for the HTC One (m7ul). Just change the m7ul part to the right codename (check it from f.ex www.get.cm webpage).
Then we just let the Mac do the rest. Remember that it will take a while to do the build, and meantime you Macs fans will scream for mercy while CM punishes your system ☺
After the build is finished successfully you can find your newly created flashable zip by typing:
Code:
cd $out
Look for .zip file with a tag UNOFFICIAL
Happy building!
donk
I just might give this a try. Thanks for the tutorial!
Sent from my One using Tapatalk 4
inffy said:
Hey there!
Only Thing that comes to mind is that you forgot to get the prebuilts. Or you flashed incompatible kernel
Click to expand...
Click to collapse
Not that I'm aware of, but I must've messed something up. I nuked it all and started over.
It works fine now (and more importantly I got myself a new "theme aware" aapt that doesn't think that drawable-xxhdpi is an invalid folder name )
Thanks again for a nice guide.
i can add packages of apk github
help
thanks
packhex said:
i can add packages of apk github
help
thanks
Click to expand...
Click to collapse
What do you mean, sry
Strange error
I get this error when I try to save the manifests xml file.
[ Error writing /Volumes/android/cm10.2/.repo/local_manifests/roomservice.xml: ]
Please help me figure this out...
Okay, I figured I hade the wrong directory..
now when I try to brunch, I get this error:
Don't have a product spec for: 'cm_m7ul'
Do you have the right repo manifest?
Please help!
Hello Everyone, I am working on building my own ROM from the Cyanogen Mod Source code. First I Set up my environment in VMWare Workstation 9. I set up Linux Mint Mate AMD64, then I added the Java repository, and installed all the needed build tools following the guides I found here (Thanks)
once I had my environment I set up repo:
in a terminal as root user#
Code:
mkdir -p ~/bin
curl https://dl-ssl.google.com/dl/googlesource/git-repo/repo> ~/bin/repo
chmod a+x ~/bin/repo
then added ~/bin to my path
Code:
export PATH=${PATH}:~/bin
next I added a directory for the source files
Code:
mkdir -p ~/A500-CM10.2-Source
Now I initialized repo.
Code:
repo init -u git://github.com/PlayOSS-Dev/android.git -b cm-10.2
then downloaded the source.
Code:
repo sync
Once the source tree was finished synchronizing I grabbed the prebuilt apps
Code:
cd vendor/cm
./get-prebuilts
cd ../..
then I tried to set up my device specific code:
Code:
. build/envsetup.sh
Now is where my questions and issues start. I expected something like android_device_acer_a500, or acer_a500/vendorsetup.sh
or something like that, I am not 100% sure, I am sort of a noobie to this, but I do have some know how with linux, and general coding, etc...
any how the reason I used the PlayOSS git source instead of CyanogenMod when I initialized repo was so I would get device specific files for my a500. I entered
Code:
repo init -u git://github.com/PlayOSS-Dev/android.git -b cm-10.2
instead of
Code:
repo init -u git://github.com/CyanogenMod/android.git -b cm-10.2
However, when I ran
Code:
breakfast acer_a500
I get the error device not found in manifest..... I set everything up very carefully and followed the guides very closely, I did end up using LinuxMint 15 for amd64 instead of ubuntu 13.04, and found that to work very well, I tried out the ubuntu and it did not run as well in VMWare, but LinuxMint works great and I havent got any errors, all the build tools installed, and Java, etc...
Any way to get to the point, where am I going wrong? I think I have the right source, what should I do? I would truly appreciate any help you have fore me. I would really like to compile and build my own Unoficial CM10.2 ROM for my A500. If you need any of the information from me please let me know. I have currently suspended my VM so everything is exactly where I left off right when I got the error about not finding any reference to the A500 in the repo manifest.
And again thanks to all who have helped and contributed so much for us on this site. I have learned a lot here and I am really enjoying all the testing and development I am experiencing in android I am also working on trying to get a usb x86 android 4.3 os going, hehehe I have it up and running, but it is slow and buggy so far, I havent ran the root script yet, but I will prb do that later, Right now I need to figure out how to get my source to compile for the A500.
So I will do some more hunting and I look forward to hearing from someone that can help me on this project.
Thank you
- Kaiji
OK I think I see what I forgot, lol....
I just need to figure out the locations for the source repos of my device, and then I believe it goes something like this:
Code:
git clone git://github.com/PlayOSS/android_device_acer_a500.git -b cm10.2 device/acer/a500
git clone git://github.com/PlayOSS/vendor_acer_a500.git -b jellybean4.3 vendor/acer/a500
git clone git://github.com/PlayOSS/kernel_acer_a500.git -b jellybean4.3 kernel/acer/a500
And then I can run
Code:
. build/envsetup.sh
And after that I believe there is a shell script to extract device specific files from my tab, then breakfast, lunch, and brunch
Unoficial-A500_CM10.2-JB4.3 Development ROM to tweak, and of course I still have to work on building a custom tweaked Kernel too
But any how I think its bedtime for me for tonite, I think I am closer and I do think I got the answers I needed for now, and 2morow I will start compiling....
Happy testing, and I still would like to get some input from anyone who has some experience building ROMS, and especially if you have built one for my device
Thanks again, and good nite, see you tomorrow.
- Kaiji
hey guys,
trying to compile PA for jflteatt and running into the following errors: here's a pastebin of my entire terminal output.
if anyone knows what's going on with this ...
PLEASE give me a point in the right direction here..
i've tried replacing all device specific repos with CyanogenMod ones and Ayysir's ones, and i'm still running into build errors..
this build was started after doing a make clobber, sudo rm -rf out, and a repo sync.. i have not touched the manifest.xml or roomservice.xml (except to change the ParanoidAndroid/android_devices_samsung_jflteatt to Ayysir/android_devices_samsung_jflteatt) so it actually gets the device files.
Here's a pastebin of my entire terminal output after ./rom-build.sh jflteatt
http://pastebin.com/QKQtW06b
I am attempting to build CM and have been setting everything up following the basic build guides on the wiki.
I have already synced with the Repo using the following command.
Code:
Repo sync -c
I did this becuase I not only what to save space but plan on only building CM12. Now on the next part of the guide the step reads as so; “Get prebuilt apps (CM11 and below)”
During this step it asks you to change directories which I did. Then it saysy to enter the following command.
Code:
$ ./get-prebuilts
However this yeilds
Code:
bash: ./get-prebuilts: No such file or directory
Why is this happening?
Is it ok because I only synced the repo with the -c flag or should this never happen?
How can I fix it? Searching through the forums shows me nothing other then files may be missing and most of those problems are because they failed to sync with the repo. I did sync and it completed.
How should I proceed?