[GUIDE][Ubuntu] How to build CyanogenMod for the Alcatel Idol 3 5.5 - Onetouch Idol 3 General

Hello everyone!
I am pretty busy with my own life,and will most likely keep being busy until summer.
Until then,I shall provide you with the formula which will enable you to create primarily CM builds from source!
In this case,related to rom builders- THE MORE,THE MERRIER!
Take notice,this guide is pretty compatible with other roms like PAC,Slim,Bliss,etc. with just a few little changes.
Of course,many thanks to Unjustified Dev for teaching me all the things needed to build roms.
Also,a big thanks to the thread located HERE
First of all,let's begin with setting up the build environment.
REQUIREMENTS
- a highly functional brain which features excessive determination and highly logical thinking
- any Ubuntu 15.10 64-bit distro
- minimally 4GB of RAM
- minimally 150 GB for 1 rom directory
1. Install Ubuntu
-it HAS TO BE a Ubuntu distribution(I personally prefer Ubuntu GNOME,but Lubuntu is good for general speed)
-although one can install and use Ubuntu on a Virtual Machine,it's advisable to dual-boot it with Windows
2. Install Java 7 JDK(version 7 is for Lollipop)
Code:
sudo add-apt-repository ppa:openjdk-r/ppa
sudo apt-get update
sudo apt-get install openjdk-7-jdk
3. Install other necessary tools
Code:
sudo apt-get install git-core gnupg ccache lzop flex bison gperf build-essential zip curl zlib1g-dev libc6-dev lib32ncurses5 lib32z1 lib32ncurses5-dev x11proto-core-dev libx11-dev:i386 libreadline6-dev:i386 lib32z-dev libgl1-mesa-glx:i386 libgl1-mesa-dev g++-multilib tofrodos python-markdown libxml2-utils xsltproc readline-common libreadline6-dev libreadline6 libncurses5-dev lib32readline6 libreadline-dev libreadline6-dev:i386 libreadline6:i386 bzip2 libbz2-dev libbz2-1.0 libghc-bzlib-dev libsdl1.2-dev libesd0-dev squashfs-tools pngcrush schedtool python
4. Then THIS
Code:
sudo ln -s /usr/lib/i386-linux-gnu/mesa/libGL.so.1 /usr/lib/i386-linux-gnu/libGL.so
Now we will initialize Repo.
Repo is a repository management tool that we built on top of Git. Repo unifies the many Git repositories when necessary, does the uploads to our revision control system and automates parts of the Android development workflow.
1.
Code:
mkdir ~/bin && curl http://commondatastorage.googleapis.com/git-repo-downloads/repo > ~/bin/repo && chmod a+x ~/bin/repo
2.
Code:
sudo nano ~/.bashrc
This command SHOULD open up a text file(.bashrc) in order for it to be edited
Now,scroll to the bottom,press ENTER,and add these lines
Code:
export PATH=~/bin:$PATH
export USE_CCACHE=1
Now press CTRL+O,press ENTER, and press CTRL+X
3. Refresh .bashrc
Code:
source ~/.bashrc
OKAY,now we should initialize git on your PC!
We will use the credentials of your created git account,so here are the commands:
Code:
git config --global user.email "[email protected]"
git config --global user.name "Your Name"
You are officially done setting your PC up!
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}

Oooookay,now let's get down to business!
PART 1
First of all,we will have to create a directory for rom build folders.
Here is MY EXAMPLE,you can name your folders however you want!
Then,of course,let's get our hands on the CyanogenMod manifest.
A manifest is a part of a rom's github directory network which holds the information which one uses to intialize a certain rom's build directory on his PC.
In our case,we need the manifest from CyanogenMod 12.1,which is HERE
There you will find this:
Of course,after you cd-d into your cm build directory,type this command in:
Code:
repo init -u git://github.com/CyanogenMod/android.git -b cm-12.1
Then navigate to the CM build folder,make hidden folders visible and open the manifest.xml in the text editor.
Find the "darwin" line,and delete the lines containing the darwin directories(the ones in the picture,there are other ones as well-delete them too)
This will reduce the download time by a decent amount. Those lines are meant for the PC to download files for MacOS,which we don't even need.
Now,let's move on to making the PC sync all the files for OUR device.
For that we need to create a file named "local_manifest.xml"
We will input the lines which will pull files for our device files from the repositories Unjustified Dev had made.
The final product is visible in the picture.
You most likely see an extra line on the bottom. That line is a MUST for CM,otherwise it won't build...
Here is it all in code,so you can just paste it. You are very welcome,by the way ;P
Code:
<?xml version="1.0" encoding="UTF-8"?>
<manifest>
<project path="device/alcatel/idol3" name="TeamRegular/android_device_alcatel_idol3" remote="github" revision="cm-12.1" />
<project path="vendor/alcatel/idol3" name="TeamRegular/android_vendor_alcatel_idol3" remote="github" revision="cm-12.1" />
<project path="kernel/alcatel/msm8916" name="TeamRegular/android_kernel_alcatel_msm8916" remote="github" revision="cm-12.1" />
<project path="device/qcom/common" name="CyanogenMod/android_device_qcom_common" remote="github" revision="cm-12.1" />
</manifest>
Okay,now we can perform a REPO SYNC.
Type in
Code:
repo sync -c
Now,depending on your internet download speed,all the files will be downloaded to your PC.
Now we will set up ccache and prebuilt Webview.
Ccache is a type of cache. Without tiring you with the details,I will make it simple.
You do understand that a lot of tools will be working while making your build,right?
Ccache stores the data those build tools need,so after the first time,those tools won't need to load all the data yet again.
This saves a lot of time!
Now,we already did one part of this set up while editing .bashrc,but this is the main attraction.
Make sure you are in your cm build directory when typing this command,or you will get an error saying "no directory"
Code:
prebuilts/misc/linux-x86/ccache/ccache -M 64G
Now,onto prebuilt Webview.
You see,this is only for those who have less than 8GB of RAM.
While being created,the Webview will hog around 7GB of RAM,overloading the PC and making it freeze for more than 8 hours until it force-stops the building or decides to pull it off after extra 6 hours,resulting in 14 hours for one single damn file.
Buuut,because
I will show you how to make the build finish in less than 12 hours at first,and then in less than 4 hours on "dirty"(aka stack builds).
1. Open up your manifest.xml
2. Find the line holding " webview ".
then,replace the line
Code:
<project path="frameworks/webview" name="CyanogenMod/android_frameworks_webview" />
with this line
Code:
<project path="frameworks/webview" name="arter97/android_frameworks_webview" remote="github" revision="cm-12.1" />
3. Go to " frameworks " folder and delete the " webview " folder
4. In the terminal(while in the CM folder,of course) type
Code:
repo sync -c --force-sync
and wait for it to do its magic
5. Open the newly appeared " webview " folder inside the " frameworks" folder, and open its " Readme.mkdn " file with a text editor
6. Follow its procedure,I present to you the pictures of things I changed!
7. Save the changes!
Woohoo,another step closer!
PART 2
Now the real party begins!
Make sure you are in your CM folder.
Type THIS command:
Code:
. build/envsetup.sh
Then THIS one:
Code:
lunch cm_idol3-userdebug
And finally,THIS one
Code:
mka bacon
Which, in the end, should look like THIS
The building procedure has begun. U.U
​

Reserved #2

Reserved #3

The Marionette said:
Reserved #3
Click to expand...
Click to collapse
Thanks for your Hard Work So i don't have time and i'm stopping to developping,when i have free time i will try to make newer builds...

Oookay...
It's complete as far as CM building goes.
When I get the time(not soon due to school and lots and lots of tests),I will maybe create a guide for the ones, who want to have a go at other roms and who want to experiment with the kernel.

The Marionette said:
Oookay...
It's complete as far as CM building goes.
When I get the time(not soon due to school and lots and lots of tests),I will maybe create a guide for the ones, who want to have a go at other roms and who want to experiment with the kernel.
Click to expand...
Click to collapse
After a lot of trying i tried with ubuntu 16,14,12 32 bit and 64 ,manjaro and other...but doesn't worked to set up the pc and i tried with gnome 64 bit today works so i'm going tomorrow to make new build with this guide because today i"m having the lowest speed of internet, at the moment i'm using the "old" pc WHO has 2gb ram 500 gb hdd and 2.2 ghz intel because my new pc was "dead":crying:Thanks for guide Alek Dev

2GB of RAM is not enough,it won't work.
Ubuntu 16.04 or any other 16.04 distro is broken,use 15.10.
Sent from my 6045K using Tapatalk

The Marionette said:
2GB of RAM is not enough,it won't work.
Ubuntu 16.04 or any other 16.04 distro is broken,use 15.10.
Sent from my 6045K using Tapatalk
Click to expand...
Click to collapse
What can problems i wil have if i try to build with 2gb ram
And tomorrow i will install 15.10

Alek Dev said:
What can problems i wil have if i try to build with 2gb ram
And tomorrow i will install 15.10
Click to expand...
Click to collapse
Try thinking logically.
No memory=errors/crashes
Sent from my 6045K using Tapatalk

The Marionette said:
Try thinking logically.
No memory=errors/crashes
Sent from my 6045K using Tapatalk
Click to expand...
Click to collapse
I will try tomorrow

So i'm started download sources...

hi marionette i do everything so i'm going to build but i get problem
[email protected]:~/roms/cm/12.1$ lunch cm_idol3-userdebug
build/target/product/core_minimal.mk:66: *** missing separator. Stop.
Device idol3 not found. Attempting to retrieve device repository from CyanogenMod Github (http://github.com/CyanogenMod).
Repository for idol3 not found in the CyanogenMod Github repository list. If this is in error, you may need to manually add it to your local_manifests/roomservice.xml.
build/target/product/core_minimal.mk:66: *** missing separator. Stop.

Alek Dev said:
hi marionette i do everything so i'm going to build but i get problem
[email protected]:~/roms/cm/12.1$ lunch cm_idol3-userdebug
build/target/product/core_minimal.mk:66: *** missing separator. Stop.
Device idol3 not found. Attempting to retrieve device repository from CyanogenMod Github (http://github.com/CyanogenMod).
Repository for idol3 not found in the CyanogenMod Github repository list. If this is in error, you may need to manually add it to your local_manifests/roomservice.xml.
build/target/product/core_minimal.mk:66: *** missing separator. Stop.
Click to expand...
Click to collapse
You messed up while editing core_minimal.mk .
I even gave out a picture with the edited lines... .-___-.

here's screenshoot

Alek Dev said:
here's screenshoot
Click to expand...
Click to collapse
Take a look at MY picture and YOUR picture
Take a close look,and try to notice something is missing in yours

The Marionette said:
Take a look at MY picture and YOUR picture
Take a close look,and try to notice something is missing in yours
Click to expand...
Click to collapse
solved. deleted the lines and write manually and works so i'm going to build it"

I'm waiting about 3 hours and 30 mins No errors or crashes ☺☺☺☺...when approximately will be finish??

It depends on you PC components.. From couple of hours to 2 days
Killa Beez

Here's my
2.2 ghz Intel
2Gb ram
500 gb HDD
At the moment i'm waiting about 4h and 40 min here's where i am
Target arm c: libavcodec_32 external/ffmpeg/libavcodec/....
---------- Post added at 17:14 ---------- Previous post was at 16:31 ----------
after a lot of waiting 5hrs i get the error
http://hastebin.com/itehawadal.hs

Related

CM10 Building guide + Linux + troubleshooting

Guide to build cm10 for the n7000. It works for sure on linux.
If you want to build for another samsung phone replace all n700's with the new model number
First of all u need to:
Initialize you're build environment.
Follow the steps descibed here: Linux is at the top.
http://source.android.com/source/initializing.html //if you're on ubuntu 12.04 or higher skip the Installing the JDK part
Now do sudo apt-get install libsdl1.2-dev libesd0-dev libwxgtk2.6-dev squashfs-tools pngcrush schedtool
Setting up android tools:
cd ~
mkdir android-SDK
cd android-SDK
wget http://dl.google.com/android/android-sdk_r20.0.3-linux.tgz
tar -xvzf android-sdk_r20.0.3-linux.tgz
cd tools
./android update sdk -u --filter platform-tools,android-16,extra-android-support
export PATH=$PATH:~/android-SDK/android-sdk-linux/platform-tools
export PATH=$PATH:~/android-SDK/android-sdk-linux/tools
Now add the 2 lines above to ~/.bashrc using your favourite text editor
Getting the source:
mkdir -p ~/bin
mkdir -p ~/android/system
curl https://dl-ssl.google.com/dl/googlesource/git-repo/repo > ~/bin/repo
chmod a+x ~/bin/repo
export PATH=$PATH:~/bin
Now add the line above to ~/.bashrc using your favourite text editor
cd ~/android/system/
repo init -u git://github.com/CyanogenMod/android.git -b jellybean
create ~/android/system/.repo/local_manifest.xml using this content: //If you want the latest kernel read the bottum of post 3 or read the comments.
<?xml version="1.0" encoding="UTF-8"?>
<manifest>
<project name="teamhacksung/buildscripts" path="buildscripts" remote="github" revision="jellybean">
<copyfile dest="build.sh" src="samsung/build.sh" />
</project>
<project name="CyanogenMod/android_device_samsung_n7000" path="device/samsung/n7000" remote="github" revision="jellybean" />
<project name="CyanogenMod/android_device_samsung_galaxys2-common" path="device/samsung/galaxys2-common" remote="github" revision="jellybean" />
<project name="CyanogenMod/android_kernel_samsung_smdk4210" path="kernel/samsung/smdk4210" remote="github" revision="jellybean" />
<project name="TheMuppets/proprietary_vendor_samsung" path="vendor/samsung" remote="github" revision="jellybean" />
<project name="CyanogenMod/android_hardware_samsung" path="hardware/samsung" remote="github" revision="jellybean" />
<project name="CyanogenMod/android_packages_apps_SamsungServiceMode" path="packages/apps/SamsungServiceMode" remote="github" revision="jellybean" />
</manifest>
cd ~/android/system/
repo sync -j16
cd ~/android/system/device/samsung/n7000/
Connect your galaxy note to the PC
./proprietary-files.sh
If you want to change the boot animation to the CM10 one or a different one read the last lines of post 3.
Building:
If you want to built android with a costum kernel you can use: export TARGET_PREBUILT_KERNEL=<path to zImage>/zImage
cd ~/android/system
repo sync -j16
./build.sh n7000
updating source:
repo sync -j16
Troubleshooting
Possible problems:
error: project –j16 not found
The – is a non unicode character. You can type the command by hand on you're keyboard instead of copy-pasting to fix this.
If that doesn't work use repo sync
Repo sync general error fix:
rm -r the directory it complains about
cd ~/android/system
repo sync -d -j16
Error nvram_net.txt_AU is missing or just in general and nvram_net.txt_ file:
open the file vendor/samsung/n7000/n7000-vendor-blobs.mk
and remove these lines:
vendor/samsung/n7000/proprietary/system/etc/wifi/nvram_net.txt_AU:system/etc/wifi/nvram_net.txt_AU \
vendor/samsung/n7000/proprietary/system/etc/wifi/nvram_net.txt_IL:system/etc/wifi/nvram_net.txt_IL \
vendor/samsung/n7000/proprietary/system/etc/wifi/nvram_net.txt_SG:system/etc/wifi/nvram_net.txt_SG \
vendor/samsung/n7000/proprietary/system/etc/wifi/nvram_net.txt_TN:system/etc/wifi/nvram_net.txt_TN \
vendor/samsung/n7000/proprietary/system/etc/wifi/nvram_net.txt_murata_AU:system/etc/wifi/nvram_net.txt_murata_AU \
vendor/samsung/n7000/proprietary/system/etc/wifi/nvram_net.txt_murata_IL:system/etc/wifi/nvram_net.txt_murata_IL \
vendor/samsung/n7000/proprietary/system/etc/wifi/nvram_net.txt_murata_SG:system/etc/wifi/nvram_net.txt_murata_SG \
vendor/samsung/n7000/proprietary/system/etc/wifi/nvram_net.txt_murata_TN:system/etc/wifi/nvram_net.txt_murata_TN \
Also open the file
device\samsung\n7000/proprietary-n7000-files.txt
and remove all lines containing:
nvram_net.txt_murata_*
nvram_net.txt_*
Tips & Trics
Removing CM apps:
To remove roms manager terms or torch:
Edit the file: vendor\cm\config\common.mk
And remove
vendor/cm/proprietary/<App Name>.apk:system/app/<App name>.apk \
Removing other apps:
Edit the file : build\target\product\core.mk
Edit the file : build\target\product\full_base.mk
Edit the file : build\target\product\generic_no_telephony.mk
To change the name of the zip and some info:
Edit the file: vendor\cm\config\common.mk
And change the else part in the file:
ifdef CM_RELEASE
CM_VERSION := $(PRODUCT_VERSION_MAJOR).$(PRODUCT_VERSION_MINOR).$(PRODUCT_VERSION_MAINTENANCE)$(PRODUCT_VERSION_DEVICE_SPECIFIC)-$(CM_BUILD)
else
CM_VERSION := <Enter new zip name here>
endif
Editing LCD density:
Edit the file device\samsung\n7000\n7000.mk
And change ro.sf.lcd_density to whatever you like.
a hint 320 is default
213 is nexus 7 mode
160 is tablet mode
Editing Trebuchet Settings:
Edit the file packages\apps\Trebuchet\res\values\config.xml
Edditing normal Settings:
Edit the file packages\apps\Settings\res\values\bools.xml
Finding out what went wrong:
./build.sh n7000 2> error.log
This means all errors and warnings will be logged to error.log
To find the actual error, you could use "grep -ins error error.log"
Moving the source:
Copy all the files to there new location.
This can be done with cp -rf old location new loaction
The force option is to avoid can't find .git errors
Warning the next part requires to be done all together without interuptions!!!
On the new loaction use rm -rf to remove the files. // I know this will delete the files. Force option is to avois sym link errors.
Now curl the repo to the new location using the steps in the first post.
Repo init as described in the first post.
Repo sync -j16 //The tric is it will restore all files that are still usable and redownload all corrput files
Changing to new kernel thanks to utacka:
local_manifest.xml - to use the latest 9100 kernel update // this file can be found in the .repo dir
change from teamhacksung/android_kernel_samsung_smdk4210 to teamhacksung/android_kernel_samsung_smdk4210_new
Also you may temporarily need to remove it from cm.dependencies in device/samsung/n7000, it'll do weird stuff (like syncing two different kernel repos to the same place) if you don't make that change.
Changing bootanimation:
Copy your new bootanimation zip file to: vendor\cm\prebuilt\common\bootanimation\<Your zip file>
Now make this change in vendor/cm/config/common.mk: //this wil be around line 46
PRODUCT_COPY_FILES += \
vendor/cm/prebuilt/common/bootanimation/<Your zip file>:system/media/bootanimation.zip
endif
The Cm10 bootanimation can be found here: http://goo.gl/x2KC8
Building time
My building time just to give you a heads up on what to expect:
System spec:
6 GB ddr3 ram
Core i5-2500 processor
2tb SATA6 samsung HDD
128GB vertex 2 SSD
Motherboard DH67CL intel
Graphic crad Radeon HD 6870 extreme edtion
VM-Ware workstation Ubuntu 12.04 64 bit headless with image on hdd and workstation on SSD with 4.5 GB ram and windows 8 release preview 64 bit as host OS.
Building after clean 53 min
Building after update 6 min.
Native Lubuntu 12.04 64 bit installed on HDD:
Building after clean 58 min
Building after update 12 min.
Just curious if you have any tips on building on OSX?? I have tried several times and cm10 just will not compile..
I commented out the quemu stuff.. but I still end up failing somewhere along the road. No problems at all on ubuntu VM, just takes 150+ minutes :crying:
madbuda said:
Just curious if you have any tips on building on OSX?? I have tried several times and cm10 just will not compile..
I commented out the quemu stuff.. but I still end up failing somewhere along the road. No problems at all on ubuntu VM, just takes 150+ minutes :crying:
Click to expand...
Click to collapse
I can't really help if i don't know the issue. The problem is most likely related to missing packages.
Could you try building with ./build.sh n7000 2> error.log
And then uploading/posting the contents of the error.log file.
The 2 means log all errors and warnings to the error.log file.
Some VM advise for the best speed:
Use a headless ubuntu server. Login trough ssh. \\The ssh part does not increase speed, but it allows copy pasting.
Give it all you're cores and a lot of memory in the VM settings.
Finally don't use the computer while building it slows the building down
Thanks, didn't even think about how many CPUs I gave to my VM.
Clean built in less than an hour now
Sent from my SCH-I535 using xda app-developers app
Thanks for the guide.. It was really helpfull to me, but I faced some problems, so I think it need an update in the following areas:
1 - Your config builds using the old Kernel... To build with the new one (Preview#4), you need to edit local_manifest.xml , and change teamhacksung/android_kernel_samsung_smdk4210 to teamhacksung/android_kernel_samsung_smdk4210_new . You also need to edit cm.dependencies in device/samsung/n7000 , the same way...
2 - Sun Java is no longer in Ubuntu repositories, so the instructions in: http://source.android.com/source/initializing.html will not work properly, and by following them you will end up building with OpenJDK, It will probably work, but is highly experimental and can result in inexpected problems.
mundano said:
Thanks for the guide.. It was really helpfull to me, but I faced some problems, so I think it need an update in the following areas:
1 - Your config builds using the old Kernel... To build with the new one (Preview#4), you need to edit local_manifest.xml , and change teamhacksung/android_kernel_samsung_smdk4210 to teamhacksung/android_kernel_samsung_smdk4210_new . You also need to edit cm.dependencies in device/samsung/n7000 , the same way...
2 - Sun Java is no longer in Ubuntu repositories, so the instructions in: http://source.android.com/source/initializing.html will not work properly, and by following them you will end up building with OpenJDK, It will probably work, but is highly experimental and can result in inexpected problems.
Click to expand...
Click to collapse
Thats the official building manual from google which also states that openJDK is not expermental for ICS and JB (different page).
This is also confirmed in the android-building group ...
Also OpenJDK 6 builds CM10 without any issues.
The sun java 6 can't be installed headless (if not in repository) because you need to click accept at the official download side....
Kernel is at 3th post bottum (Tips and Trics):
It will not be in the official manual because if it gets stable enough it will get merged in the CM10 repo
mnm1992 said:
Kernel is at 3th post bottum (Tips and Trics):
It will not be in the official manual because if it gets stable enough it will get merged in the CM10 repo
Click to expand...
Click to collapse
ooppss... Didn't saw that one..
I will try OpenJDK.
Thank you mnm1992, you really helped me, it is an all-in-one guide :laugh:.
Hi mnm1992, the manifest have changed to new ones since codeworkx have merged it into main streamline, check this: http://forum.xda-developers.com/showthread.php?p=31166205
Skickat från min GT-N7000 via Tapatalk 2

{Guide} [HOW TO]Building CM11 from source for i9082/L

Here are the steps to build your own kernel from source. This guide is showing you how to build your first the stock kernel on your own..... It is kick start for making things on your own way....
This guide applies to i9082/i9082L and general devices also.:laugh:
This guide assumes you have basic knowledge of linux and linux system configuration.
Prerequisites
Quote:
HTML:
1. Ubuntu 13.10 / BBQLINUX (I personally use this)
2. patience...lots and lots of patience.
Here starts the fun:-
1. Installing ubuntu 13.10.
Quote:
This can be done in 3 ways and I am not gonna cover it all.
- along with windows ,i.e dual boot
- in virtualbox within windows
- as a windows application installation with "wubi" installer
For starting user i think second option, i.e installing in virtualbox is best.
here's starting tutorials
http://www.youtube.com/watch?v=tDDRFiwHujg
NOTE - you should have atleast 100 Gb partion for virtualbox.
2. Setting up building environment.
PHP:
THIS ALL BELOW STEPS ARE NOT NEEDED IF YOU HAVE INSTALLED BBQLINUX, BUILDING ENVIRONMENT IS SET IN BBQLINUX BY DEFAULT. IT WORKS OUT-OF-THE-BOX.
Initializing a fresh Android Build Environment in Ubuntu 13.10 sucks, right? The instructions at the AOSP page are outdated and inaccurate. Near as I can tell, they try to have you install 2 JDKs, the first one not even being the correct link for Saucy Salamander, and the second being OpenJDK. Which might work. But I dunno about all that, I’d rather have Oracle’s official stamp when it comes to building for Android.
Currently most of the guides are up to 12.04 LTS, which is fine and dandy, but being on the cutting edge is nice too.
This guide applies to all variations of Ubuntu 13.10 Saucy Salamander 64 bit. Do not use the 32 Bit version. Also, PAY CLOSE ATTENTION when to use “sudo” and when to not. It can make things funky if you do something as root that you shouldn’t.
Much thanks goes out to Google, ProTekk, Canonical, and everyone else that I read a random paragraph here and snippet there.
First, let’s set up the correct JDK.
Many of you probably have some kind of wrong Java installed unless you’re starting with a fresh Ubuntu base, and even then maybe.
Let’s get rid of that. Copy and paste this into a Terminal window:
Code:
PHP:
sudo apt-get purge openjdk-\* icedtea-\* icedtea6-\*
Follow the instructions to remove OpenJDK.
If you must keep it, it’s possible. But I’m not going to tell you how to do it here. I don’t want any chance of confusion or mistake.
Now copy and paste the following into the Terminal:
Code:
PHP:
sudo add-apt-repository ppa:webupd8team/java
This will add the correct PPA to your system for updated builds of Java 6 JDK that are compatible with 13.10.
No more unrecognized Java version errors! And it will update automatically with the rest of your system.
Next, we actually need to install the package. More copy-paste:
Code:
PHP:
sudo apt-get update && sudo apt-get install oracle-java6-installer
Follow the on-screen instructions. You have to Accept the Licensing Agreement to complete the install. Hopefully no human centipede clauses.
Let’s make sure the correct version of Java is activated, run the following Terminal command:
Code:
PHP:
java -version
You should see something like the following:
Code:
PHP:
java version “1.6.0_45″ Java(TM) SE Runtime Environment (build 1.6.0_45-b06) Java HotSpot(TM) 64-Bit Server VM (build 20.12-b01, mixed mode)
Ok, back to a fresh Terminal prompt. Time for installing the guts to build stuff in Ubuntu:
Code:
PHP:
sudo apt-get install git-core gnupg ccache lzop flex bison gperf build-essential zip curl zlib1g-dev zlib1g-dev:i386 libc6-dev lib32ncurses5 lib32z1 lib32bz2-1.0 lib32ncurses5-dev x11proto-core-dev libx11-dev:i386 libreadline6-dev:i386 lib32z-dev libgl1-mesa-glx:i386 libgl1-mesa-dev g++-multilib mingw32 tofrodos python-markdown libxml2-utils xsltproc readline-common libreadline6-dev libreadline6 lib32readline-gplv2-dev libncurses5-dev lib32readline5 lib32readline6 libreadline-dev libreadline6-dev:i386 libreadline6:i386 bzip2 libbz2-dev libbz2-1.0 libghc-bzlib-dev lib32bz2-dev libsdl1.2-dev libesd0-dev squashfs-tools pngcrush schedtool libwxgtk2.8-dev python
When that is done installing, run the following command in your Terminal window:
Code:
PHP:
sudo ln -s /usr/lib/i386-linux-gnu/mesa/libGL.so.1 /usr/lib/i386-linux-gnu/libGL.so
That’s it on the package side of things.
You guessed it, time for more Terminal. This really is the easiest way, seriously. And it’s totally worth it when you’re basking in the glory of a bunch of people on XDA.
The binary for a program called “repo” will let you talk to git servers and download all that precious source code. That second part after the && allows it to be executable:
Code:
PHP:
mkdir ~/bin && curl http://commondatastorage.googleapis.com/git-repo-downloads/repo > ~/bin/repo && chmod a+x ~/bin/repo
Use your favorite text editor to open ~/.bashrc
I like nano:
Code:
PHP:
sudo nano ~/.bashrc
At the very bottom, add the following line:
Code:
PHP:
export PATH=~/bin:$PATH
Save it. In nano that would be Ctrl-O and then Enter. Then Ctrl-X to exit back to a prompt. Restart bash:
Code:
PHP:
source ~/.bashrc
That should be everything. Now you’re ready to build Android the right way. Luck!
3. Downloading source
Open terminal
To initialize your local repository using the CyanogenMod trees, use a command like this:
HTML:
mkdir cm11
cd cm11
repo init -u git://github.com/CyanogenMod/android.git -b cm-11.0
Create local_manifest.xml in .repo folder.
PHP:
cd .repo
nano local_manifest.xml
Paste following into the terminal
PHP:
<?xml version="1.0" encoding="UTF-8"?>
<manifest>
<project path="device/samsung/i9082" name="pawitp/android_device_samsung_i9082" remote="github" revision="cm-11.0" />
<project path="vendor/samsung/i9082" name="k2wl/android_vendor_samsung_i9082" remote="github" revision="master" />
<project path="kernel/samsung/i9082" name="pawitp/android_kernel_samsung_i9082" remote="github" revision="cm-11.0" />
</manifest>
Save it. In nano that would be Ctrl-O and then Enter. Then Ctrl-X to exit back to a prompt. Restart bash.
Then to sync up:
HTML:
repo sync -j#
# is number of jobs you want to give for your downloading source. I use 2.
Download gonna be huge. Approx 12-15 GB.
So its gonna take while depending upon your internet connection.
You may get errors while downloading, like
HTML:
Sync exited due to fetch errors
Just restart download by
HTML:
repo sync
4. Starting Building process
PHP:
. build/envsetup.sh && time brunch i9082 -j#
Again # is meant for No. of CPU cores you have.
Building gonna take time, depending upon your computer configuration.
Any errors, post here.
I will try my best to solve problems .
Start building your own CM11...
Any suggestion welcome.
reserved for future use.
one more
Just last in case
THANKS K2wl for this amazing guide.
k2wl said:
Here starts the fun
Click to expand...
Click to collapse
Wow that's a really good guide.
You make building from a ROM/Kernel from source much simpler than it should be.
I just replaced my 12.04 LTS with 13.10 last night, was wondering if I shouldn't have, but if it's working good for your development, think I'll keep it for a while. And yes, building a fresh android build environment sucks
I'm new to android development, but so far the linux, java and php code seems mostly regular. Gonna start with kernel first, then maybe try my hand on building a ROM. Thank you for the guide! :good:
iceyhotguy said:
Wow that's a really good guide.
You make building from a ROM/Kernel from source much simpler than it should be.
I just replaced my 12.04 LTS with 13.10 last night, was wondering if I shouldn't have, but if it's working good for your development, think I'll keep it for a while. And yes, building a fresh android build environment sucks
I'm new to android development, but so far the linux, java and php code seems mostly regular. Gonna start with kernel first, then maybe try my hand on building a ROM. Thank you for the guide! :good:
Click to expand...
Click to collapse
Good. Thats the spirit.
keep 13.10. its good.
i switched to BBQLINUX just few days, until earlier i was using 13.10.
kernel develpment is not much hussle.
just be sure...dont add features which make kernel unstable.
i statred with kernel development only...:good::laugh:
and then come to ROM development.
best luck..
if any queries regarding kernel or ROM development, just ask me...i am here to help.
this can be used to build other roms too right .... by just changing the github repo to the rom u wanna build
One more question, how to apply patches?
But, k2wl.
This method builds an Odin flashable file.
How to make flashable zips, which can be flashed through custom recoveries.????
Sent from my iPhone using Tapatalk
rutvikrvr said:
this can be used to build other roms too right .... by just changing the github repo to the rom u wanna build
Click to expand...
Click to collapse
yes its gonna be useful to build other AOSP based roms. like PA,AOKP,OMNI,AICP etc... just need few modifications according to respective roms.
black87 said:
One more question, how to apply patches?
Click to expand...
Click to collapse
copy the patch file to respective directory and apply patch with following command.
HTML:
patch -p1 < patch.diff
eg. if you want to apply bluetooth patch and ur patch name is fixbluetooth.diff
then
HTML:
cd hardware/broadcom/libbt/
git checkout .
patch -p1 < fixbluetooth.diff
if any problems plz tell me..
Ateekujjawal said:
But, k2wl.
This method builds an Odin flashable file.
How to make flashable zips, which can be flashed through custom recoveries.????
Sent from my iPhone using Tapatalk
Click to expand...
Click to collapse
It builds flashable zips only ......with CWM or any other....
@k2wl im getting this error http://pastebin.com/uLy1MGew
rutvikrvr said:
@k2wl im getting this error http://pastebin.com/uLy1MGew
Click to expand...
Click to collapse
check slimrom's github source. instructions are given there.
also @k2wl said that you have to make some other modifications.
Did you try the breakfast command???
rutvikrvr said:
@k2wl im getting this error http://pastebin.com/uLy1MGew
[email protected]:~/slimrom$ . build/envsetup.sh && time brunch i9082 -j4
including device/generic/armv7-a-neon/vendorsetup.sh
including device/generic/x86/vendorsetup.sh
including device/generic/mips/vendorsetup.sh
including vendor/slim/vendorsetup.sh
including sdk/bash_completion/adb.bash
including vendor/slim/vendorsetup.sh
ls: cannot access device/*/i9082/slim.mk: No such file or directory
build/core/product_config.mk:231: *** Can not locate config makefile for product "slim_i9082". Stop.
Device i9082 not found. Attempting to retrieve device repository from SlimRoms Github (http://github.com/SlimRoms).
Repository for i9082 not found in the SlimRoms Github repository list. If this is in error, you may need to manually add it to .repo/local_manifests/slim_manifest.xml
ls: cannot access device/*/i9082/slim.mk: No such file or directory
build/core/product_config.mk:231: *** Can not locate config makefile for product "slim_i9082". Stop.
** Don't have a product spec for: 'slim_i9082'
** Do you have the right repo manifest?
No such item in brunch menu. Try 'breakfast'
real 0m22.876s
user 0m0.219s
sys 0m0.087s
Click to expand...
Click to collapse
your device folder points to device named cm_i9082, not slim_i9082. thats why.
jst open cm.mk file in device/samsung/i9082 cm.mk and edit its content to slim.
means
if it says in the line cm_i9082 change it to slim_i9082.
save it.
rename the file to slim.mk
and change one more file which will point to slim.mk
i.e androidproducts.mk
change the
HTML:
PRODUCT_MAKEFILES := \ $(LOCAL_DIR)/device_i9082.mk
to
HTML:
PRODUCT_MAKEFILES := \ $(LOCAL_DIR)/slim.mk
after that one more file to be created.
slim.dependencies.
just rename cm.dependencies to slim.dependencies.
and then try that command again.
i am attaching files for you.
jst replace them. or edit as you like.
---------------------------------------------------------------------------------------------------------------------
good to know some one started something.
you downloaded source. thats great....keep up... i will help you as much as i can....
rutvikrvr said:
@k2wl im getting this error http://pastebin.com/uLy1MGew
Click to expand...
Click to collapse
Or simply use i9082 device tree for SlimROMs from my Github. I have made all the necessary changes.
xenon92 said:
Or simply use i9082 device tree for SlimROMs from my Github. I have made all the necessary changes.
Click to expand...
Click to collapse
yep....that will do....
but i think untill and unless he do it himself, he wont understand....
@xenon92 as k2wl is saying.. Il try on my own first otherwise I'll use ur device tree if I'm not able to do it at all... Thanx fr the reply.
Sent from my GT-I9082 using XDA Premium 4 mobile app
EDIT: ITS STARTED BUILDING ..THANX FR THE SUPPORT
rutvikrvr said:
@xenon92 as k2wl is saying.. Il try on my own first otherwise I'll use ur device tree if I'm not able to do it at all... Thanx fr the reply.
Sent from my GT-I9082 using XDA Premium 4 mobile app
EDIT: ITS STARTED BUILDING ..THANX FR THE SUPPORT
Click to expand...
Click to collapse
thats the spirit of learning...keep up...
one more error http://pastebin.com/wcuPHsi0 ..pl help
device/samsung/i9082/overlay/frameworks/base/core/res/res/values/config.xml
just edit this file and delete line number 34,199,205. and save it.
just restart building again.

[GUIDE CM11] How to build your own CyanogenMod 11.0 ROM from sources for the Moto G

Make your 'own' KitKat-ROM today!
V1.1 - 20140219 Repos changed
V1.0 - 20140218 Initial release
Thank you note: Many thanks to dhacker29 for dedicating his time developing for this fine piece if hardware.
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
Overview
I. Preparation
II. Installation of the required packages
III. Installing Java
IV. The sources
V. Building the ROM
VI. Rebuilding with newest sources
I. Preparation
Things you need for building:
A computer
An internet connection
An open mind
Time
Patience
First of all, you need a running up-to-date Ubuntu/Linux system. I am using Ubuntu 13.10 64-bit.
Use the terminal to make the steps. A terminal window can be opened by pressing Ctrl+Alt+T. Every single command for the terminal is marked with a $ sign. Just paste every command (without the $ sign) to your terminal window and there shouldn't be any problem.
IMPORTANT: INSTALL EVERYTHING AS A USER WITH NORMAL RIGHTS. DON'T INSTALL AS ROOT!
II. Installation of the required packages (Ubuntu 13.10 64-bit)
Install packages:
Code:
$ sudo apt-get install bison build-essential curl flex \
g++-multilib gcc-multilib git-core gnupg gperf \
lib32ncurses5-dev lib32readline-gplv2-dev lib32z1-dev \
libesd0-dev libncurses5-dev libsdl1.2-dev \
libwxgtk2.8-dev libxml2 libxml2-utils lzop \
openjdk-6-jdk openjdk-6-jre pngcrush schedtool \
squashfs-tools xsltproc zip zlib1g-dev
III. Installing Java
You need a version 6 Java Development Kit for building CM11.0. Usually, the SUN JDK 6 is recommended. But there is another way: you can use the OpenJDK 6. When you installed the required packages as described above, you will just need to configure your Java installation.
Check your Java version:
Code:
$ java -version
Verify the symlinks. Javac, Java, Javaws, Javadoc, Javah, Javap and Jar should all point to the right Java location and version:
Code:
$ ls -la /etc/alternatives/java* && ls -la /etc/alternatives/jar
If they are pointing to the wrong versions you have to change that to OpenJDK6.
Select the default Java version for your system:
Code:
$ sudo update-alternatives --config javac
$ sudo update-alternatives --config java
$ sudo update-alternatives --config javaws
$ sudo update-alternatives --config javadoc
$ sudo update-alternatives --config javah
$ sudo update-alternatives --config javap
$ sudo update-alternatives --config jar
That's it.
IV. The sources
Install repo:
Repo is a tool that makes it quite easy to download and maintain the sources of Cyanogenmod.
Code:
$ mkdir ~/bin
$ PATH=~/bin:$PATH
$ cd ~/bin
$ curl http://commondatastorage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
$ chmod a+x ~/bin/repo
Create the working directory:
Code:
$ mkdir ~/cm11
$ cd ~/cm11
Initialize Repo:
Code:
$ repo init -u git://github.com/CyanogenMod/android.git -b cm-11.0
and enter your credentials.
Download the sources:
Code:
$ repo sync
Wait until it's finished - takes some time to download the hefty 12 GB of source code!
Have a break, have a KitKat!
If the process stops responding, use Ctrl+C to break out of it and resume the download with another
Code:
$ repo sync
If you are running into a lot of syncing errors the reason might be that the 'repo sync' command is establishing four threads automatically. This might be too much. So try to change the command to run with one thread only by using
Code:
$ repo sync -j1
Initialize the environment
Code:
$ . build/envsetup.sh
Obtain the files:
Add repositories for the MOTO G by creating two files in the local_manifests directory. To see this directory, you have to press Ctrl-H in your file manager. If the directory isn't already there, create it with
Code:
$ mkdir ~/cm11/.repo/local_manifests
Use this code to create the file falcon.xml
Code:
$ gedit ~/cm11/.repo/local_manifests/falcon.xml
Paste the following lines to the editor (20140219: repos changed to CyanogenMod)
Code:
<manifest>
<project name="CyanogenMod/android_device_qcom_common" path="device/qcom/common" remote="github" revision="cm-11.0"/>
<project name="CyanogenMod/android_device_motorola_qcom-common" path="device/motorola/qcom-common" remote="github" revision="cm-11.0"/>
<project name="[COLOR="DarkRed"]CyanogenMod[/COLOR]/android_device_motorola_falcon" path="device/motorola/falcon" remote="github" revision="cm-11.0"/>
<project name="[COLOR="DarkRed"]CyanogenMod[/COLOR]/android_kernel_motorola_msm8226" path="kernel/motorola/msm8226" remote="github" revision="cm-11.0"/>
<project name="[COLOR="DarkRed"]CyanogenMod[/COLOR]/android_device_motorola_msm8226-common" path="device/motorola/msm8226-common" remote="github" revision="cm-11.0"/>
<project name="CyanogenMod/android_hardware_qcom_display-caf-new" path="hardware/qcom/display-caf-new" remote="github" revision="cm-11.0"/>
<project name="CyanogenMod/android_hardware_qcom_media-caf-new" path="hardware/qcom/media-caf-new" remote="github" revision="cm-11.0"/>
<project name="CyanogenMod/android_hardware_qcom_fm" path="hardware/qcom/fm" remote="github" revision="cm-11.0"/>
</manifest>
Save the file.
Use this code to create the file vendor.xml (in case you already have a vendor.xml file because you are buiilding for multiple devices, just add the project line to your vendor.xml file)
Code:
$ gedit ~/cm11/.repo/local_manifests/vendor.xml
Paste the following lines to the editor
Code:
<?xml version="1.0" encoding="UTF-8"?>
<manifest>
<project path="vendor/motorola" name="TheMuppets/proprietary_vendor_motorola" remote="github" revision="cm-11.0"/>
</manifest>
Save the file.
Run
Code:
$ repo sync
again to get the files needed.
Download the necessary prebuilts from cyanogenmod by running
Code:
$ cd ~/cm11
$ vendor/cm/get-prebuilts
And you're done syncing!
V. Building the ROM
Now build it:
Code:
$ brunch falcon
And the building process starts. Have patience now. Building takes around half an hour on fast systems and a lot more on older and slower machines.
When everything worked as it should you will find your new ROM-image in ~/cm11/out/target/product/falcon
It is called cm-11-DATE-UNOFFICIAL-falcon-zip. You can flash it via CWM/TWRP as usual.
VI. Rebuilding with newest sources
Whenever you like to update your sources and build a new version you have to run these four simple commands:
Code:
$ cd ~/cm11
$ repo sync
$ . build/envsetup.sh
$ brunch falcon
Compiling again takes less time than compiling took the first time because it's only building new parts while reusing old parts that haven't changed.
Happy building!
Reserved
Reserved
Good
Thanks for taking the effort to write this down.
Docker template for building CyanogenMod
Have you seen this?
http://forum.xda-developers.com/showthread.php?t=2650345
Guide changed
New V1.1 - 20140219 Repos changed
First post has been changed accordingly.
VI. Rebuilding with newest sources
Whenever you like to update your sources and build a new version you have to run these four simple commands:
Code:
$ cd ~/cm11
$ repo sync
$ . build/envsetup.sh
$ brunch falcon
Compiling again takes less time than compiling took the first time because it's only building new parts while reusing old parts that haven't changed.
Click to expand...
Click to collapse
Is it not necessary to also run this again?
Code:
cd vendor/cm
./get-prebuilts
cd ../..
PS: At the end of part IV youve got "get-prebuilts" instead of "./get-prebuilts".
if you could add option to build with Linaro-Toolchain
tazlooney89 said:
if you could add option to build with Linaro-Toolchain
Click to expand...
Click to collapse
+1
michalurban said:
Is it not necessary to also run this again?
Code:
cd vendor/cm
./get-prebuilts
cd ../..
Click to expand...
Click to collapse
It is the pre-built terminal program. You just need it the first time you build. Otherwise you would get an error message while compiling the ROM. It is unnecessary to get the program over and over again. Since it's pre-built, it gets its updates from the market/play store.
michalurban said:
PS: At the end of part IV youve got "get-prebuilts" instead of "./get-prebuilts".
Click to expand...
Click to collapse
Something got mixed up there. Changed my lines. But your solution works too, of course. Thanks for pointing me to it.
tazlooney89 said:
if you could add option to build with Linaro-Toolchain
Click to expand...
Click to collapse
Really depends on the time I will have on my hands and the interest the thread draws. Maybe I'll add some tweaks and tricks including a basic set of compiling against Linaro TC 4.8.x next week. We will see...
Is there an automatic way to have the build.prop file (the system/build.prop option ro.build.date) altered?
I have a script renaming the compiled rom - to make the filaname end with "-michalurban-$NOW" where $NOW is a variable containing date and time of creation. And I would like to remove the ro.build.date value and replace it with michalurban-$NOW so I would easily know if Im using Official NIGHTLY or my build ...
My Linux (Bash, whatever) skill is knee deep in manure Im afraid ... is this possible?
michalurban said:
Is there an automatic way to have the build.prop file (the system/build.prop option ro.build.date) altered?
I have a script renaming the compiled rom - to make the filaname end with "-michalurban-$NOW" where $NOW is a variable containing date and time of creation. And I would like to remove the ro.build.date value and replace it with michalurban-$NOW so I would easily know if Im using Official NIGHTLY or my build ...
My Linux (Bash, whatever) skill is knee deep in manure Im afraid ... is this possible?
Click to expand...
Click to collapse
I usually change the build.prop indirectly before the building process.
I delete a few files before rebuilding. E.g. the old build.prop with
Code:
rm -f out/target/product/falcon/system/build.prop
Whenever I am setting up a new build environment I edit the file common.mk in /vendor/cm/config
In line 317 or 323 you could try to change the value of CM_DISPLAY_VERSION or ro.cm.display.version to suit your needs.
Or you can do what I am doing - I usually add a time value to my ROMs (Rom-name and CyanogenMod-version under 'About phone'):
line 288 reads:
Code:
CM_VERSION := $(PRODUCT_VERSION_MAJOR)-$(shell date -u +%Y%m%d)-$(CM_BUILDTYPE)$(CM_EXTRAVERSION)-$(CM_BUILD)
and I changed it to
Code:
CM_VERSION := $(PRODUCT_VERSION_MAJOR)-$(shell TZ=":Europe/Berlin" date +%Y%m%d\-%H%M%S)[email protected]$(CM_BUILDTYPE)$(CM_EXTRAVERSION)-$(CM_BUILD)
I also added [email protected] You can change practically everything here.
Then save the file and rebuild.
The CyanogenMod Version in 'about phone' should look like this when you flash the ROM:
Happy building!
Is it possible to do this on a NTFS-formatted drive? Im running low on space on my linux /home directory but Ive got plenty of space on my Win7 NTFS drive ... Im just afraid of file permission troubles ...
you can make an image file on the NTFS partition loopmount it, then format it to ext4.
Sent from my XT1032
Rhyn said:
you can make an image file on the NTFS partition loopmount it, then format it to ext4.
Sent from my XT1032
Click to expand...
Click to collapse
You mean to create a file on the NTFS partition, format it as EXT4, mount it somewhere and then use it for compilation via Ubuntu but "on" the NTFS drive? Wouldnt it mean a hard hit to the performance? I suppose it wont but as my PC is not high-end everything matters ...
BTW I found some guide on the Net and Ive modified it for my needs (probably lol). Is it ok?
Code:
# Create file to store EXT4 partition on NTFS partition (100GB)
dd if=/dev/urandom of=/media/D/linux.img bs=2048 count=50000000
# Create and format loop device (of the EXT4 file)
losetup /dev/loop0 /media/D/linux.img
mkfs.ext4 -b 1024 /dev/loop0
# Mount the new EXT4 file
mount -o loop /media/D/linux.img /home/michal/NTFSdrive
EDIT: Script tested and running fine (I got so excited I wrote this edit in czech not english the first time lol).
yeah I meant exactly that. This guide seems ok. The performance won't be as good as with a native partition, but won't be terribly bad either
Sent from my XT1032
Another weird question of mine:
I deleted all files, set the CCACHE to be 100GB using command "prebuilts/misc/linux-x86/ccache/ccache -M 100G" which was confirmed and started the whole process. But after successfully finishing compilation the directory is again "only" 50GB ... why? I expected it to be twice as large ...
michalurban said:
Another weird question of mine:
I deleted all files, set the CCACHE to be 100GB using command "prebuilts/misc/linux-x86/ccache/ccache -M 100G" which was confirmed and started the whole process. But after successfully finishing compilation the directory is again "only" 50GB ... why? I expected it to be twice as large ...
Click to expand...
Click to collapse
You have to inform the compiler that the cache will be used first, then config a directory and last, set the cache size to xx GB which creates the hidden dir. (to see it, use Ctrl+H)
Code:
$ export USE_CCACHE=1
$ export CCACHE_DIR=/your_path_here/.ccache
$ prebuilts/misc/linux-x86/ccache/ccache -M 100G
Btw: it's a good idea to use a 'make clean' first...
To see what's going on while caching, open another terminal, go to your cm11 root dir and execute
Code:
watch -n1 -d prebuilts/misc/linux-x86/ccache/ccache -s
Now, Ive got a script building the ROM for me. It usually works fine for first sync and compilation as well as for any secondary syncs. But sometimes it returns a message that something isnt present in some file (it differs) and the compilation ends with "Error 1" which I found to be "Out of memory". Now, the guide at CM web says that I should
Code:
edit: system/build/tools/releasetools/common.py
change: java -Xmx2048m to java -Xmx1024m or java -Xmx512m
BTW the right file path is
Code:
build/tools/releasetools/common.py
But Im curious if this change could be done in an automated way by the script (and Im not really familiar with sed, awk and all this regular expressions) ... If not, I guess Ill put some READ command before the compilation itself, giving me time to change it - or just add "nano system/build/tools/releasetools/common.py". But still, automatic way would be better.
EDIT: Solution (with JAVAMEM being set in the beginning of the script):
Code:
sed -i 's/Xmx2048m/Xmx'$JAVAMEM'm/' build/tools/releasetools/common.py
ADD:
Weird, when I try to set the directory and size for CCACHE, nothing happens - it stays at /home/michal/.ccache and 100GB ...
About two days ago a new problem emerged. I followed the guide exactly but in the end, after "brunch falcon"
Code:
make: *** [/home/michal/Build/MotoG-CM11/out/target/product/falcon/obj/SHARED_LIBRARIES/hwcomposer.msm8226_intermediates/hwc_utils.o] Error 1
It happened before so I erased all content of the directory and did all the commands from scratch. But its the same ... even after changing Java memory something (Xmx2048m) to 1024, which was recommended in the CM guide.

[Guide] How to compile and install Unofficial Stable CM11 for vibrant SGH-T959

This guide is an adaptation/update of the following guides:
http://forum.xda-developers.com/sho...mctr=(not provided)&__utmv=-&__utmk=231246620
http://forum.xda-developers.com/nexus-4/general/guide-cm11-how-to-build-cyanogenmod-11-t2515305
Disclaimer
My linux skills are not very good but following a few of guides I could compile a very stable and functional ROM. Everything written here is tested by me several times and works, but I am not responsible for any damage.
Requirements:
Linux - Ubuntu 14.04 - 64bit (AFAIK, a 64 bit host is needed to compile KK)
An SGH-T959 with cm11 compile with this guide or cm-10.1-2014xxxx-NIGHTLY-vibrantmtd already installed - Get the latest nightly here: http://get.cm/?device=vibrantmtd
About 14GB of storage for the repository plus about 15GB for building
1 - Install Ubuntu Packages
Terminal
Code:
sudo apt-get install bison build-essential curl flex \
g++-multilib gcc-multilib git-core gnupg gperf \
lib32ncurses5-dev lib32readline-gplv2-dev lib32z1-dev \
libesd0-dev libncurses5-dev libsdl1.2-dev \
libwxgtk2.8-dev libxml2 libxml2-utils lzop \
pngcrush schedtool \
squashfs-tools xsltproc zip zlib1g-dev
2 - Install JAVA
2.1 Download Java JDK for Linux 64-bit from: http://ghaffarian.net/downloads/Java/JDK/jdk-6u45-linux-x64.bin
2.2 Move jdk-6u45-linux-x64.bin to your home directory
2.3 Remove any other java packages from system:
Code:
sudo apt-get purge openjdk-\* icedtea-\* icedtea6-\*
2.4 Install Java JDK:
Code:
sudo mkdir -p /opt/java/64/
sudo cp jdk-6u45-linux-x64.bin /opt/java/64
sudo su -
cd /opt/java/64
chmod +x jdk-6u45-linux-x64.bin
./jdk-6u45-linux-x64.bin
exit
2.5 Add JDK PATH to .bashrc:
Code:
gedit ~/.bashrc
Add these lines to .bashrc:
Code:
# Java PATHs
export JAVA_HOME=/opt/java/64/jdk1.6.0_45
export PATH=$PATH:$JAVA_HOME/bin
3 - Install Android SDK
3.1 Setup directories:
Code:
cd ~
mkdir android
cd android
mkdir sdk
3.2 Download Android SDK from http://developer.android.com/sdk/index.html
3.3 Extract SDK contents to ~/android/sdk
3.4 Add Android SDK Path:
Code:
gedit ~/.bashrc
Add these lines to .bashrc:
Code:
#Android PATH
export PATH=$PATH:~/android/sdk
export PATH=$PATH:~/android/sdk/platform-tools
export PATH=$PATH:~/android/sdk/tools
4 - Install Repository
4.1 Download Repo:
Code:
mkdir -p ~/bin
mkdir -p ~/android/system
curl http://commondatastorage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
chmod a+x ~/bin/repo
4.2 Add Repo Path:
Code:
gedit ~/.bashrc
Add these lines to .bashrc:
Code:
export PATH=$PATH:~/bin
4.3 Close and open new terminal.
4.4 Initialize Repository:
Code:
cd ~/android/system/
repo init -u git://github.com/CyanogenMod/android.git -b stable/cm-11.0
5 - Download the specific code for Vibrant SGH-T959
Code:
mkdir ~/android/system/.repo/local_manifests && touch ~/android/system/.repo/local_manifests/vibrantmtd.xml && gedit ~/android/system/.repo/local_manifests/vibrantmtd.xml
Copy the following path and save the file:
Code:
<?xml version="1.0" encoding="UTF-8"?>
<manifest>
<project path="device/samsung/vibrantmtd" name="CyanogenMod/android_device_samsung_vibrantmtd" remote="github" revision="cm-10.2" />
<project path="device/samsung/aries-common" name="CyanogenMod/android_device_samsung_aries-common" remote="github" revision="cm-11.0" />
<project path="packages/apps/SamsungServiceMode" name="CyanogenMod/android_packages_apps_SamsungServiceMode" remote="github" revision="cm-11.0" />
<project path="kernel/samsung/aries" name="CyanogenMod/android_kernel_samsung_aries" remote="github" revision="cm-11.0" />
<project path="hardware/samsung" name="CyanogenMod/android_hardware_samsung" remote="github" revision="cm-11.0" />
</manifest>
Note: For specific code for vibrant, aries and samsung does not use the stable branch to have the latest fixes available
6 - Sync. the Repository
Code:
cd ~/android/system/
repo sync
NOTE: When finished, run the repo sync command again to be sure there are no errors.
7 - Edit a one file from vibrant.
When you finished the download the Repository you need edit a vibrant file or it will not compile.
Code:
gedit ~/android/system/device/samsung/vibrantmtd/recovery/recovery_keys.c
Delete all code and replace it and save the file.
Replace with this code:
Code:
#include <linux/input.h>
#include "recovery_ui.h"
#include "common.h"
#include "extendedcommands.h"
int device_handle_key(int key_code, int visible) {
if (visible) {
switch (key_code) {
case KEY_VOLUMEDOWN:
case 217: // SEARCH
return HIGHLIGHT_DOWN;
case KEY_VOLUMEUP:
case 139: // MENU
return HIGHLIGHT_UP;
case KEY_POWER:
case 158: // HOME
return SELECT_ITEM;
case 102: // BACK
return GO_BACK;
default:
return NO_ACTION;
}
}
return NO_ACTION;
}
8 - Extract files from phone:
NOTE: You need to have cm10.1 (or cm11 compile with this guide) installed on the phone and the phone has to be in usb debugging.
Connect phone to pc and in terminal type:
Code:
adb root
cd ~/android/system/device/samsung/vibrantmtd/
./extract-files.sh
9 - Download Extra Files
Code:
~/android/system/vendor/cm/get-prebuilts
10 - Building Android
Code:
cd ~/android/system
. build/envsetup.sh && brunch vibrantmtd
11 - Install on Phone
11.1 Copy your .zip file from ~/android/system/out/target/product/vibrantmtd/cm-11-XXXXXXXXX-UNOFFICIAL-vibrantmtd.zip to the root of the SD card.
11.2 Optional: Download Google Apps for KitKat from http://goo.im/gapps and place it on the root of the SD card.
11.3 Flash both of these .zip files from recovery.
Note: I put this guide in general because I do not have the necessary permission to put in the development area. If any Administrator can put in the dev. area would be helpful.
Huge thanks. This will come in handy. :good:
@stinga11 - One question. I've read compiling with Linaro yields better results for performance. Are there any special steps in order to compile CM for Vibrant with that?
nirogu325 said:
@stinga11 - One question. I've read compiling with Linaro yields better results for performance. Are there any special steps in order to compile CM for Vibrant with that?
Click to expand...
Click to collapse
Yes with Linaro you have a better performance, but I read that is a bit unstable. Honestly, I do not know how to compile this rom with Linaro if you know how to do and want to contribute, I will gladly I edit the main post and add the steps on how to do.
stinga11 said:
Yes with Linaro you have a better performance, but I read that is a bit unstable. Honestly, I do not know how to compile this rom with Linaro if you know how to do and want to contribute, I will gladly I edit the main post and add the steps on how to do.
Click to expand...
Click to collapse
So far I think @sada23 is the only one left in our community with that knowledge. It would help tremendously in case @sada23 wants to lend someone the torch eventually.
I'd like to take on that challenge of compiling CM11 with Linaro. As a matter of fact, I was looking for a way to compile CM for the vibrant so I could test compiling with Linaro 4.9.2 and maybe add some optimizations, so thank you for this!
Does anyone know any downsides to using the cm-10.2 vibrant device branch? And I'd like to get a consensus for this, I already have an S4 ROM based on the CM stable branch, compiled with SaberMod and a couple of cherry-picks to add on to CM11. How many people would want this?
Synergy510 said:
Does anyone know any downsides to using the cm-10.2 vibrant device branch?
Click to expand...
Click to collapse
The official CM11 releases for galaxy s, galaxy s B, and captivate(They share most of the code with the vibrant.) do not have received any changes from 10.2 branch. In other words, for these device also used the 10.2 branch.:angel:
stinga11 said:
The official CM11 releases for galaxy s, galaxy s B, and captivate(They share most of the code with the vibrant.) do not have received any changes from 10.2 branch. In other words, for these device also used the 10.2 branch.:angel:
Click to expand...
Click to collapse
Cool, thanks for the info. I'm downloading the source right now and I'll try to have a build up as soon as I can. It'll be compiled with some combination of Linaro toolchains. Does anyone know if sada's cm11 is built with this guide (just wanna know because I'm too lazy to install cm-10.1)
Synergy510 said:
Cool, thanks for the info. I'm downloading the source right now and I'll try to have a build up as soon as I can. It'll be compiled with some combination of Linaro toolchains. Does anyone know if sada's cm11 is built with this guide (just wanna know because I'm too lazy to install cm-10.1)
Click to expand...
Click to collapse
No, I do not think sada23 has used this guide to create his ROM, since it was created long before I made this guide. If you can compile with Linaro maybe you want to share the guide on how to do/
stinga11 said:
No, I do not think sada23 has used this guide to create his ROM, since it was created long before I made this guide. If you can compile with Linaro maybe you want to share the guide on how to do/
Click to expand...
Click to collapse
I'll see if I can. I know a fairly simple, a little on the hack-ish side, way to declare which toolchain you want to use.
How come the vibrant has to be running cm-10.1? Which part of the build process dictates that we have to do that? Because we are using the 10.2 branch? If nothing has change with the other Galaxy S variants in their device githubs, then I don't think it should matter which CM the vibrant currently runs since there is no dependency on cm10.1 in extract-files.sh
Synergy510 said:
I'll see if I can. I know a fairly simple, a little on the hack-ish side, way to declare which toolchain you want to use.
How come the vibrant has to be running cm-10.1? Which part of the build process dictates that we have to do that? Because we are using the 10.2 branch? If nothing has change with the other Galaxy S variants in their device githubs, then I don't think it should matter which CM the vibrant currently runs since there is no dependency on cm10.1 in extract-files.sh
Click to expand...
Click to collapse
For the vibrant never was released an official CM-10.2. The coder created the branch but any reason never was released. Is necessary that you have installed an official CM for extract the vibrant drivers. I use CM-10.1 because is the last official release for the vibrant.
stinga11 said:
For the vibrant never was released an official CM-10.2. The coder created the branch but any reason never was released. Is necessary that you have installed an official CM for extract the vibrant drivers. I use CM-10.1 because is the last official release for the vibrant.
Click to expand...
Click to collapse
Gotcha, that makes sense. I've downloaded the source and I'll make some changes to certain things. Maybe after I get a build going I'll make another post on how to build with another toolchain
How to use another toolchain
Okay, I'm going to explain how to compile with different toolchains, namely SaberMod or Linaro. This may not be *the exact way*, but this is what works for me
1) First locate the toolchain you want to use and find it's github. Here are two examples:
Linaro provided by JustArchi: https://github.com/archidroid/toolchain
SaberMod provided by kykdev (optimized for arm cortex architecture): https://github.com/kykdev?tab=repositories
Two notes about toolchains:arm-eabi == kernel toolchain
arm-linux-androideabi == ROM toolchain​
2) Once you've located it, add it to your roomservice.xml (or in the case of this thread vibrantmtd.xml)
When you add something to your roomservice/vibrant.xml, repo sync will gather these files from github for you and place there where you specify
A generic example of adding the toolchain:
from: https://github.com/SOME_USER/THEIR_REPO
Code:
<project name="SOME_USER/THEIR_REPO" path="prebuilts/gcc/linux-x86/arm/arm-eabi-SOME_SPECIAL_NAME" remote="github" revision= "BRANCH" />
By SOME_SPECIAL_NAME, I mean name it what it is. Linaro-4.9.2 or SaberMod-4.8.4 etc etc
By BRANCH, the user's THEIR_REPO might contain both the arm-eabi and arm-linux-androideabi
Example 1:
Looking at kykdev's github, each repo is it's own toolchain, so there is no BRANCH you have to declare. So do this:
Code:
<project name="kykdev/sabermod-arm-cortex_a15-eabi-4.9" path="prebuilts/gcc/linux-x86/arm/arm-eabi-SM-Combo" remote="github" revision="master" />
<project name="kykdev/sabermod-arm-cortex_a15-linux-androideabi-4.8" path="prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-SM-Combo" remote="github" revision="master" />
Notice how I grab what I needed, see the "project name" and see where they go:
path="prebuilts/gcc/linux-x86/arm/arm-eabi-SM-Combo"
path="prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-SM-Combo"​The underlined part must stay as it is, but the bold part is the SOME_SPECIAL_NAME. This is going to come handy later when you tell the ROM which toolchain to use. This is why I use "4.8" in both the ROM and kernel toolchains although the kernel toolchain is labeled as 4.9. Since there are no branches here, you declare BRANCH as "master" or whatever the default branch name is on the github repo
Example 2:
Lookin at JustArchi's repo, everything is listed under his "Toolchain" repo.
Code:
<project name="ArchiDroid/Toolchain" path="prebuilts/gcc/linux-x86/arm/arm-eabi-Linaro-4.9.2" remote="github" revision="linaro-4.9-arm-eabi" />
<project name="ArchiDroid/Toolchain" path="prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-Linaro-4.9.2" remote="github" revision="linaro-4.9-arm-linux-androideabi" />
Nothing the "project name" is the same, so this means we need to specify a BRANCH to get the proper toolchain
revision="linaro-4.9-arm-eabi"
revision="linaro-4.9-arm-linux-androideabi"​
Notice! The "path" stays the same with same SOME_SPECIAL_NAME
path="prebuilts/gcc/linux-x86/arm/arm-eabi-Linaro-4.9.2"
path="prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-Linaro-4.9.2"​
Now when you repo sync, your toolchains will be in your build environment
3) How to tell the build which toolchain to use
Locate the file: ~/android/system/core/combo/TARGET_linux-arm.mk
In this find the line that says:
Code:
TARGET_GCC_VERSION :=
After the " := " You're going to remove what was already there, probably "4.7" and change it to your SOME_SPECIAL_NAME, so:
Code:
TARGET_GCC_VERSION := SOME_SPECIAL_NAME
example:
TARGET_GCC_VERSION := Linaro-4.9.2
4) If you already made a build with the default toolchain
You should not build immediately after following these steps because you have pre-compiled packages in your build directory and you MUST clean it out whenever you switch toolchains so everything is compiled with the same toolchain. So you must use these commands after changing the toolchain and before making the build:
Code:
cd ~/android/system/
rm -rf ~/.ccache
make clean
make clobber
That's it! You can now brunch vibrantmtd and watch it compile!
Notes
You can mix and match toolchains, but your mileage may vary
Not every toolchain is guaranteed to work. You MAY run into some errors
Try to keep your ROM and kernel toolchains to the same type of toolchain (Linaro, SaberMod, Google)
I think I touched on everything I do with this post, if I missed something or if it doesn't work for you, let me know!
Synergy510 said:
Okay, I'm going to explain how to compile with different toolchains, namely SaberMod or Linaro.
Click to expand...
Click to collapse
Amazing man, thanks a lot for this guide when I have time I will try.
nirogu325 said:
@stinga11 - One question. I've read compiling with Linaro yields better results for performance. Are there any special steps in order to compile CM for Vibrant with that?
Click to expand...
Click to collapse
Now finally there is a guide on how to compile with the Linaro toolchain by Synergy510
http://forum.xda-developers.com/showpost.php?p=55416425&postcount=13
Amazing info, thanks!
hey i followed your guide and zip is ready but when i flashed it through cwm i got this error while flashing
Code:
set_metadata_recursive
here is my device tree https://github.com/Grace5921/device_samsung_kyleve

[GUIDE] build lineageOS for titan in ubuntu 16.04 (or Debian 8) environment

LineageOS is in an official state, so that's for the ones with no patience, like me. I want my nightlies!! So DIY!!
This is not about flashing. Only how to build a ROM in an Ubuntu (meanwhile Debian 8) environment! So I have nothing to do with what you do with the finished Zip-file.
I am not responsible for your phone or your computer! Everything you read here resulting in taking action is at your own risk!
All credits go to all devs and supporters here on XDA, CyanogenMod / LineageOS for all their work they provide for free on github. We just take thankful the benefit!! Mainly LuK1337 provided the best hints and informations!
## These sites will help you:
http://wiki.lineageos.org/titan_build.html
http://web.archive.org/web/20160722172103/http://wiki.cyanogenmod.org/w/Envsetup_help
http://web.archive.org/web/20160421170720/http://wiki.cyanogenmod.org/w/Build_for_titan
http://gojira.tokyo/?building_cyanogenmod_14_from_source
http://source.android.com/source/initializing.html
## GIT and repos
https://forum.xda-developers.com/showthread.php?t=2329228
## SET UP THE ENVIRONMENT
## Install (in VMware Player or Virtualbox?) 64-bit-Ubuntu 16.04.1 LTS / 8GB RAM / 100GB HDD
## All following is done in a terminal
## These are the packets you need (if you use debian some will fail (e.g. JAVA) -take them out of the list manually):
Code:
sudo apt-get install android-tools-adb automake bc bison build-essential bzip2 ccache curl dpkg-dev flex git gnupg gperf libbz2-1.0 libesd0-dev libghc-bzlib-dev liblz4-tool libncurses5-dev libsdl1.2-dev libwxgtk2.8-dev libxml2 libxml2-utils lzop make maven openjdk-8-jdk pngcrush python-networkx schedtool squashfs-tools xsltproc zip zlib1g-dev g++-multilib gcc-multilib lib32ncurses5-dev lib32z1-dev lib32readline6 lib32readline6-dev
## To install JAVA 8 in Debian:
Code:
echo "deb http://ppa.launchpad.net/webupd8team/java/ubuntu xenial main" | tee /etc/apt/sources.list.d/webupd8team-java.list
echo "deb-src http://ppa.launchpad.net/webupd8team/java/ubuntu xenial main" | tee -a /etc/apt/sources.list.d/webupd8team-java.list
apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys EEA14886
apt-get update
apt-get install oracle-java8-installer
## Add all needed paths and the ccache command (following two lines) to the end of ~/.bashrc
## copy the whole box to your terminal and the lines will be added...
Code:
echo "export PATH=~/bin:~/android/lineageos/toolchain:~/android/lineageos/external/v8/build/toolchain:~/android/lineageos/prebuilts/sdk/tools:$PATH
export USE_CCACHE=1" >> ~/.bashrc
## Maybe here is a good point to restart the Ubuntu machine once...
## I'm not sure if necessary you need an account at https://github.com but it complains when not...
Code:
git config --global user.email "your-GIT-REG-email"
git config --global user.name "your-GIT-REG-username"
Code:
mkdir -p ~/bin
mkdir -p ~/android/lineageos/
mkdir -p ~/android/lineageos/.repo/local_manifests
## get the repo command
Code:
curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
chmod a+x ~/bin/repo
## The right git-repos to sync are in: ~/android/lineageos/.repo/local_manifests/roomservice.xml
## copy the whole box into the terminal and the roomservice.xml will be written:
Code:
echo "<?xml version="1.0" encoding="UTF-8"?>
<manifest>
<remote fetch="ssh://[email protected]" name="bitbucket" />
<remote fetch="ssh://[email protected]" name="gitlab" />
<remote fetch="git://codeaurora.org/" name="caf" review="codeaurora.org" sync-c="true" />
<project name="LineageOS/android_device_motorola_titan" path="device/motorola/titan" remote="github" />
<project name="LineageOS/android_device_motorola_thea" path="device/motorola/thea" remote="github" />
<project name="LineageOS/android_device_motorola_msm8226-common" path="device/motorola/msm8226-common" remote="github" />
<project name="LineageOS/android_device_qcom_common" path="device/qcom/common" remote="github" />
<project name="LineageOS/android_kernel_motorola_msm8226" path="kernel/motorola/msm8226" remote="github" />
<project name="LineageOS/android_packages_resources_devicesettings" path="packages/resources/devicesettings" remote="github" />
<project name="TheMuppets/proprietary_vendor_motorola" path="vendor/motorola" remote="github" />
<project name="TheMuppets/proprietary_vendor_qcom_binaries" path="vendor/qcom/binaries" remote="github" />
<project name="TheMuppets/proprietary_vendor_asus" path="vendor/asus" remote="github" />
</manifest>" > ~/android/lineageos/.repo/local_manifests/roomservice.xml
## Get the github to the machine
Code:
repo init -u git://github.com/lineageos/android.git -b cm-14.1
## additional folders to put the repos and binaries for building
## O.K. lets start the first try
Code:
cd ~/android/lineageos/
source build/envsetup.sh
Code:
repo sync
## Wait VERY LONG (really hours) and IF STUCKS, press "ctrl+C" and once more "repo sync" again.
## Then Extract proprietary blobs from the phone
## the device must be connected via USB cable (adb has to be functional) and go to the TITAN directory:
Code:
cd ~/android/lineageos/device/motorola/titan
## and
Code:
./extract-files.sh
## and maybe (only once before the first time of building) configure the CCACHE, which makes compiling much faster:
Code:
prebuilts/misc/linux-x86/ccache/ccache -M 50G
##WHEN ALL IS DONE
## we now can forget all steps before! ...Until we run in trouble - then look at the bottom or restart from scratch.
## In my experience now it shows, that the compiling processes recompiles and replaces "new synced packets" in the out-directory and leave the untouched untouched. So we can (nearly) always restart a broken build process... maybe the devs will VETO this. Some delete the whole out-directory every time - I think you can easily start over
## However, what we should do everytime before we start building is:
Code:
cd ~/android/lineageos/
source build/envsetup.sh
repo sync
## OKAY, lets build.... Nooooooo! Not yet!
## The most Important question now:
## "Do you want to have a ROOTED phone?" If yes, then you have to
Code:
export WITH_SU=true
## If you don't want root then just start with:
Code:
brunch titan
## Now you can wait again for hours and hopefully got finished
## ~/android/lineageos/out/target/product/titan/lineage-14.1-2017****-UNOFFICIAL-titan.zip
------------------------------------------------------------------------
------------------------------------------------------------------------
## TROUBLE with compilation stops / stucks with error:
## JACK-SERVER error:
## reinstall the Jack Server
Code:
cd ~/android/lineageos/prebuilts/sdk/tools
jack-admin kill-server
jack-admin uninstall-server
jack-admin install-server jack-launcher.jar jack-server-4.8.ALPHA.jar
## sometimes a permission problem:
Code:
chmod 700 ~/.jack-server
find ~/.jack-server -type f -print0 | xargs -0 chmod 600
chmod 664 ~/.jack-settings
##Also helpful if Java stops compiling is to limit the usage of RAM:
Code:
export ANDROID_JACK_VM_ARGS="-Dfile.encoding=UTF-8 -XX:+TieredCompilation -Xmx4G"
##NINJA error:
## increase RAM of VM, or you cant put
Code:
export USE_NINJA=false
command to the .bashrc
## APPS/org.cyanogenmod.platform-res_intermediates error:
Code:
javac: file not found: ~android/lineageos/out/target/common/obj/APPS/org.cyanogenmod.platform-res_intermediates/src/cyanogenmod/platform/Manifest.java
Usage: javac <options> <source files>
use -help for a list of possible options
ninja: build stopped: subcommand failed.
build/core/ninja.mk:151: recipe for target 'ninja_wrapper' failed
make: *** [ninja_wrapper] Error 1
make: Leaving directory '~/android/lineageos'
#### make failed to build some targets (25:19 (mm:ss)) ####
When this happens, give a:
Code:
mka org.cyanogenmod.platform-res
This also works for most other Errors, which stop the process... Find the line with "****_intermediate" and give the "mka ****" WITHOUT the "_intermediate".
After compiling of the single package is finished - once more:
Code:
brunch titan
## New one: *** This repo is now deprecated. Move your blobs to your device's vendor repo..
Code:
find: "~/android/lineageos/out/target/common/obj/SHARED_LIBRARIES/libwifi-hal-mock_intermediates": Datei oder Verzeichnis nicht gefunden
build/core/package_internal.mk:143: Empty argument supplied to find-subdir-assets
./vendor/qcom/binaries/Android.mk:1: *** This repo is now deprecated. Move your blobs to your device's vendor repo..
The solution is given here by mirkosrc:
Code:
~/android/lineageos$ mv vendor/qcom/binaries/Android.mk vendor/qcom/binaries/Android.mk.bak
Now we have the proper solution given by kessaras in post #37 (thanks a lot!!):
the solution is not to rename the .mk or even remove that repo since we ignore it by renaming the .mk.
The proper solution is to edit the .mk and remove the 1st line that redirects to an error on purpose because its depricated (old).
This way, IF the .mk is needed during the build, it will get called.
If its not needed , then the compiler will just not use it.
At least thats my point of view here. We dont just remove things by renaming. We add them properly in case they r needed. If they are not needed then they wont be used.
Click to expand...
Click to collapse
## LAST OPTION:
When nothing works at all anymore you can delete the whole content of the out-folder:
Code:
rm -rf ~/android/lineageos/out/*
But then the first compiling last very long again...
## If the DISK runs full,
look into android/lineageos/out/target/product/titan/obj/PACKAGING/target_files_intermediates and delete the files...
## repo sync crashes with error:
Code:
repo sync -j1 -f --force-sync
------------------------------------------------------------------------
Thank you for this guide. I'll try to build CM14.1 here
Danilo-Sanchez said:
Thank you for this guide. I'll try to build CM14.1 here
Click to expand...
Click to collapse
Ah, great keep me informed, so I can make it better. Try myself from the scratch and have found some issues in the chronological order... is getting better. So look out for changes
mankokoma said:
Ah, great keep me informed, so I can make it better. Try myself from the scratch and have found some issues in the chronological order... is getting better. So look out for changes
Click to expand...
Click to collapse
Ok. As soon as I try I'll let you know
For the Ninja error:
export USE_NINJA=false
Has been asked for RAM usage. Battery life is as CM always have been - not the best, could be worse, so what?
mankokoma said:
Has been asked for RAM usage. Battery life is as CM always have been - not the best, could be worse, so what?
Click to expand...
Click to collapse
Thank you
It's almost the same RAM usage as CM13.
i will also try to build the rom from ur guide........really thanks.......so much for the guide
:laugh:Thank you for share!!!:good:
@mankokoma Can I extract proprietary files even if I'm not using CM14.1?
Danilo-Sanchez said:
@mankokoma Can I extract proprietary files even if I'm not using CM14.1?
Click to expand...
Click to collapse
Why not? As far as I can follow the scripts, the files will be extracted (in our case) to ~/android/lineageos/vendor/motorola/titan/proprietary/... (and maybe also to /android/lineageos/vendor/motorola/msm8226-common/proprietary...) I'm not sure if they are always the same for the different Android Versions, but I assume: Yes.
I put some more order in the guide and cleaned the chaos in case there is still interest in building LineageOS yourself. In fact preparing of the environment and the first setup and building of the ZIP lasts really (annoying) long but the following building processes are done within ONE and a HALF hours. So I enjoy immediately the last build when there has something good changed in the Repos: https://www.cmxlog.com/14.1/titan/
Have a lot of fun!
mankokoma said:
I put some more order in the guide and cleaned the chaos in case there is still interest in building LineageOS yourself. In fact preparing of the environment and the first setup and building of the ZIP lasts really (annoying) long but the following building processes are done within ONE and a HALF hours. So I enjoy immediately the last build when there has something good changed in the Repos: https://www.cmxlog.com/14.1/titan/
Have a lot of fun!
Click to expand...
Click to collapse
Did you managed to build Lineage OS 13.0?
I've tried to build Lineage OS 13.0 but unfortunately it didn't work.
Danilo-Sanchez said:
Did you managed to build Lineage OS 13.0?
I've tried to build Lineage OS 13.0 but unfortunately it didn't work.
Click to expand...
Click to collapse
No, I didn't. "Shoot from the hip": Downgrade Java to 1.7 first. Maybe it's easier to building up Ubuntu 14.x environment as I don't know about gcc or other libs-things for CM13
mankokoma said:
No, I didn't. "Shoot from the hip": Downgrade Java to 1.7 first. Maybe it's easier to building up Ubuntu 14.x environment as I don't know about gcc or other libs-things for CM13
Click to expand...
Click to collapse
Did you managed to include OMS support in Lineage 14.1?
Danilo-Sanchez said:
Did you managed to include OMS support in Lineage 14.1?
Click to expand...
Click to collapse
No, didn't have any efforts, though a dark notification panel would be nice.
I just take, what comes from the "normal" repositories.
@mankokoma any idea?
Makefile:795: *** multiple target patterns. Stop.
hashroot said:
@mankokoma any idea?
Makefile:795: *** multiple target patterns. Stop.
Click to expand...
Click to collapse
I'm sorry, have only very little time these days... can you provide some more lines before this error occurs?
Are you using Ubuntu or Debian?
I have read something about cleaning the "obj" folder could help
Hi, I am building klte version of CrdroidAndroid ( a LineageOS based ROM) on a ubuntu 16.04 LTS VM.
I am getting the following error. I am not sure what to do here. I have been cleaning the build folder and ccache and trying to build. I keep ending at this error. Any help to solve this issue is greatly appreciated.
----------------------------------
/usr/bin/x86_64-linux-gnu-ld: /home/sadanand/crdroid/android/system/out/host/linux-x86/obj/SHARED_LIBRARIES/libart_intermediates/base/allocator.o: relocation R_X86_64_PC32 against protected symbol `_ZN3art18g_malloc_allocatorE' can not be used when making a shared object
/usr/bin/x86_64-linux-gnu-ld: final link failed: Bad value
clang++: error: linker command failed with exit code 1 (use -v to see invocation)
-----------------------------------------------------------
Thanks
Did you try just "mka libart" to compile only the package with the error?
Usually then it's finishing without errors and you can brunch again.

Categories

Resources