Hi All,
I and @akhilnarang decided to post this guide to help anyone wanting to learn building of Roms and kernels. We will be using Ubuntu 14.04 Trusty Tahr here.
You can find instructions to install it elsewhere, just remember rom building needs 64bit OS, minimum 4GB RAM, and 100GB space on HDD. Kernel can be built on less hardware, but will take long
Make sure you have fast net, as you have to download at least 16GB of ROM sources, or more kernel, only 1GB of sources max.
Be prepared to spend a lot of time downloading, learning, and fixing bugs
More RAM, or faster CPU, or SSD will speed up the process.
From our personal experiences we have found that this is the best, stable, up-to-date version of Ubuntu yet. This has come from my trial and errors, searching all over the web, and bits I picked up from here and there.
We will move Rom building part when we completed this step properly. Step by step we will learn compiling kernel, using Github, Gerrit, Cherry-picking.
At the end of the post I have linked a script by @akhilnarang which if run will automatically install all these programs for lazy people like us haha [emoji14]
If you not interested to do all procedure from below just use the script. Simply it will automatically configure the build environment.
NOTE-------- some of these packages may already be on your machine. Obviously, if you complete a step and you have one of these installed, the machine simply will not do anything. So...it will not hurt anything. Some of the packages are different from Ubuntu 12.04 and 13.04 (use these packages for Ubuntu 14.04 as many of the old ones have obsoleted - these are new replacements).
So if you set up your pc with Ubuntu we are good to go.
All code will be in code boxes like this:
Code:
$
means you have to run that command in the terminal (don't type the $).
All commands with sudo, gksudo, or gksu means it requires root permission.
It will ask for password.
Once you type, then in that terminal session it will not ask you for a few minutes again.
Any time you make changes to .bashrc or .profile file, make sure to run
Code:
$ source ~/.bashrc
$ source ~/.profile
Or exit and open new terminal else the changes will not take place
Setting up build environment:
Installing Java JDK
Note: You need JDK 7 when you willing to compile Lollipop. If you wanna compile KitKat or lower you need JDK 6.
Open terminal (CTRL + ALT + T)
Then execute the following commands in terminal one by one:
Download & install java
Code:
$ sudo apt-get update && sudo apt-get install openjdk-7-jdk openjdk-7-jre
CHECK if java properly installed or not
Code:
$ java -version
If you get output like
Code:
java version "1.7.0_79"
on the first line then all is good
Now JDK is configured!
Note: Only for Ubuntu 14.04 or higher
Installing Required Packages
Open Terminal
Now execute this command:
Note: This will take some time, has to download about 500MB or so of packages
Code:
$ sudo apt-get update && sudo apt-get install git-core python gnupg flex bison gperf libsdl1.2-dev libesd0-dev libwxgtk2.8-dev squashfs-tools build-essential zip curl libncurses5-dev zlib1g-dev openjdk-7-jdk pngcrush schedtool \
libxml2 libxml2-utils xsltproc lzop libc6-dev schedtool g++-multilib lib32z1-dev lib32ncurses5-dev lib32readline-gplv2-dev gcc-multilib liblz4-* android-tools-adb android-tools-fastboot ccache
Configuring USB Access
Now we need to set permissions so that our USB ports can detect our android devices [emoji14]
Type in the following commands, it will download a file with the permissions, give it permission to execute, and restart the service.
Code:
$ sudo curl --create-dirs -L -o /etc/udev/rules.d/51-android.rules -O -L https://raw.githubusercontent.com/snowdream/51-android/master/51-android.rules
$ sudo chmod 644 /etc/udev/rules.d/51-android.rules
$ sudo chown root. /etc/udev/rules.d/51-android.rules
$ sudo service udev restart
$ sudo killall adb
ADB & Fastboot are configured
Installing Repo Package
Open terminal and type:
Code:
$ mkdir ~/bin
$ PATH=~/bin:$PATH
$ curl http://commondatastorage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
$ chmod a+x ~/bin/repo
Configure Git
Open terminal and type:
Code:
$ git config --global user.email ""
$ git config --global user.name ""
Git is configured.
Configure ccache
Open terminal and type:
Code:
$ gksu gedit ~/.bashrc
Enter these lines
Code:
export USE_CCACHE=1
export CCACHE_DIR=~/.ccache
Save & close
Open terminal & execute:
Code:
$ source .bashrc
$ ccache -M 50G
I usually use 50 gigs. You can use more if you have more space, or build for many devices
Make a GitHub account using the same email address you used for configuring git
Then follow these
So if you not interested in doing above all steps then simply use this script by my friend @akhilnarang
Open terminal and type:
Code:
$ sudo apt-get install git-core
then do
Code:
$ git clone https://github.com/akhilnarang/scripts.git
$ cd scripts
$ . build-environment-setup.sh
This script will install all required packages
Congrats
YOUR BUILD ENVIROMENT IS NOW SETUP
Now move onto #2nd post for Git and repo tutorial
To be continued
How To Use Git!
Now, to explain about git
Its a version control system, for code, like mercurial or subversion
Most android source code is either at AOSP
Most custom ROMs like CyanogenMod,Radium, host their code over at GitHub
So to start off, make a GitHub Account!
Here, you will find all the various repositories, full of code
All files are stored in repositories
When browsing a repository, you will see a button called fork
This will make a copy of it in your account, so you can edit it, and even submit changes for approval to the parent account
Now, to download the source of a repository onto your computer, we use git clone command
Code:
$ git clone https://github.com/akhilnarang/scripts
So we download the scripts from my github onto your PC, so we can run them
Now, if you added your ssh key as shown in bottom of post #1, then when cloning a repo from your account, while copying the link from bottom right corner, choose ssh link.
If you, when pushing(uploading)local changes, you will not be prompted for username and password, your ssh key will identify you .
After cloning, cd to the directory
Run
Code:
git remote -v
This will show a list of remotes
Default is origin, i.e. the link you have cloned from
Now once we make our changes locally
Code:
$ git add -A
This stages all modified/added/deleted files to be committed
Code:
$ git commit
This opens a text editor for you to write a commit message for your commit
Just give me brief description of your changes or something :v.
Then
Code:
$ git push <remote-name> HEAD:<branch>
If you have cloned, then remote will be origin
Branch can be checked by
Code:
git branch
, and also online from where you cloned
If you used https:// URL then you will be prompted for username and password to authenticate yourself
If git:// URL you can't push, you will need to use a https:// or ssh link
Another way to push can be
Code:
$ git push <link> HEAD:<branch>
Now say you want to make your own git repository of your files
Click on the new repository button on GitHub, give a name
You can do initial commit online, or locally
Follow the instructions it gives you
i.e. if you have all files ready (in a folder)
Code:
$ git init
$ git add -A
$ git commit
$ git push <link> HEAD:<branch>
A VERY important thing to be noted while using version control systems like git, is to preserve authorship of a commit
If someone else has made some changes to a file, and we want them, we should not copy the changes and commit, but should give them authorship either by cherry-picking(will be explained)
Or using this syntax
Code:
$ git commit --author="Author Name <[email protected]>"
Through this git will know the correct authors
Not giving proper authorship is known as kanging, not appreciated here on XDA,(or anywhere else for that matter), and can cause you to be banned :3
Anyway, on to cherry-picking
Go to your repository
Code:
$ git remote add blahblah link-to-url-you-want-commit-from
$ git fetch blahblah branch-commit-is-on
$ git cherry-pick Commit-sha1-hash
If you see a commit on GitHub, or GitLab, or BitBucket, there is a unique(to that repo) SHA for every commit to identify it
Fetch the correct repo as shown above, and paste the commit id
That will fetch the changes
However, if your local source is quite different from the source you cherry-picked from, it will conflict
If so your terminal will display it
then run
Code:
$ git status
Files shown in red color have conflicts
Open them with a text editor like Atom(my favorite), nano, gedit, vim, etc
Look for <<<<<<<
From there, the content till ======
is the original content
=======
till >>>>>>> *insert commit message here* is the new stuff
So check the commit, figure out what's wrong, fix it, save.
Then
Code:
$ git add -A
$ git commit
If no conflicts it will commit on its own and you just need to
Code:
$ git push
as explained earlier :v
Running
Code:
$ git log
will show you a list of commits , authors, and SHA
If for some reason you wanna remove some commit, use
Code:
$ git revert commit-SHA
Just like cherry-picks, it may have conflicts
Anyway, this is just a small guide to get started off
You can easily found out more by searching, and experimenting
I will add more stuff here soon
Enjoy with this much till then
Building CyanogenMod for those device which officially supportedIf our build environment setted up successfully and after we learnt some Git and repo thing now we will concentrete on rom building
Now we have to Initialize Repo. We will try to build CyanogenMod.
Initialize the repo:
Code:
Code:
$ mkdir cm
$ cd cm
$ repo init -u git://github.com/CyanogenMod/android.git -b cm-13.0
$ repo sync -f --no-clone-bundle
For people who have already done a repo init:
Code:
$ cd cm
$ repo sync -f --no-clone-bundle
When prompted, enter your real name and email address.
Continue onto adding a device
~How To Add A Device To The List~
Find the github for your device you wish to add. (We will give Android One Devices(sprout4&sprout8) as an example
Navigate back to your home directory for building:
Code:
$ cd ~/cm
$ source build/envsetup.sh
Or
$ . build/envsetup.sh
That sets up your environment for building
Get your list of devices:
Code:
$ brunch
Choose your device from the list, till will fetch tree and dependencies if needed, sometimes vendor tree will need to be added manually (In case of CyanogenMod, rest all ROMs keep in dependencies)
Build will start,enjoy!
For users who like understanding>
Code:
. build/envsetup.sh
runs a shell script, which adds various environment variables,etc, and some commands.
Calling "brunch" actually runs the command
Code:
breakfast [email protected] && mka bacon
(for CM)
[email protected] in shell script means all the parameters that have been passed, so if you passed brunch sprout, it would pass sprout
breakfast calls lunch, which selects the device, prepares the environment for building for it, fetches dependencies with the help of roomservice python script
"mka bacon"
This calls GNU make, and passes bacon as a parameters, to be "made"
mka is used instead of make, as it automatically uses all available threads of your CPU
If you have a quad core Intel, or octa core AMD, you could run make -j8 bacon
This is just the gist of it, reading through the envsetup.sh would make it clearer
If successful, you will get a zip in out/target/product/device
If not, check post #6
Most likely, you will find a solution there.
If not, please ask us in the thread, we would be happy to assist you
To be continued
Kernel Compilation
As many of you'll already know, kernel of an operating system
Android devices use a modified version of the linux kernel
Firstly, most important thing to note, in that the Linux Kernel is licensed under the GNU GPL (General Public License), which can be found here
Basically, you must always keep your work on the kernel open-source, and display the link to it when publishing your work on XDA Threads, etc
In order to do this, make sure you fork, or push the kernel source you're working on to your GitHub account so that you can push the changes you're making
Make sure you give proper authorship, as explained in post #2
If unable to, give credits to author in commit message, but don't kang please [emoji14]
Please try to have at least a basic knowledge of C, so that you can fix errors
Else, use Google before asking in thread, there's a huge chance someone has already gotten and solved it :v
So now, getting to work
I will give an example using Android One Device (sprout4&&sprout8)
The kernel source be found here(branch android-mediatek-lollipop-mr1 for 5.1,or something, not sure, check), and also here, branch cm-12.1 for 5.1 ROMs
So fork it to your GitHub account, or clone from AOSP and push to your git
I'd recommend the one from CM git, as it usually has small bugs fixed compared to stock
In my device's case, a whole lotta broken stuff is fixed, so I would take from cm
So start off, by installing all dependencies as shown in 1st post
Code:
$ git clone https://github.com/akhilnarang/android_kernel_mediatek_sprout -b cm-12.1 sprout-kernel
Replace the link with your own, ssh if you wish, as explained in #2
You must specify -b cm-12.1,as the default is cm-11.0, and you will end up will KitKat source!
The last parameter is optional, it saves it in that directory, in this case sprout-kernel
Now, all kernel source's have a file called a defconfig, or default configuration, that is device-specific
You will find it in arch/*your devices architecture*/configs
Your device may be arm, arm64, x86
Make sure you remember the name of the defconfig, you can rename it too [emoji14]
If you would like to give your kernel a name, simplest way would be to look for the CONFIG_LOCALVERSION in the defconfig
Make it something like
Code:
CONFIG_LOCALVERSION="-Your-Kernel-Name"
Anyway, so now you need a toolchain
For starting off, we will use GCC 4.8 from Google
For ARM devices
Code:
$ git clone https://android.googlesource.com/platform/prebuilts/gcc/linux-x86/arm/arm-eabi-4.8/
For aarch64/arm64
Code:
$ git clone https://android.googlesource.com/platform/prebuilts/gcc/linux-x86/aarch64/aarch64-linux-android-4.8/
For x86 I'm not sure, go have a look here
Now remember where you saved it
Now open the file called "Makefile" in the root of kernel source
Look for a line that has ARCH?=
that dosen't start with a # (lines starting with # are comments)
And make it
Code:
ARCH ?= arm
or
Code:
ARCH ?= arm64
And look for CROSS_COMPILE ?=
make it
Code:
CROSS_COMPILE ?= path/to/downloaded/toolchain/bin/arm-eabi-
for arm devices
Code:
CROSS_COMPILE ?= path/to/downloaded/toolchain/bin/aarch64-android-linux-
for arm64 devices
This may differ on Custom toolchains, etc, you can find out about that by viewing the commits of different kernels, and going through various threads
I'm only gonna explain how to compile the kernel, not how to add stuff (at least for now)
If you wish now, you can refer to #2, and commit and push these changes [emoji14]
Now run
Code:
$ make cyanogenmod_sprout_defconfig
That's what my defconfig is called, yours maybe called something else [emoji14]
And now finally to start the build
First, check how many cores/threads your CPU has
A quad core Intel, an octa core AMD, will have 8
So if you have one, run
Code:
$ make -j8
This will compile the code on all 8 threads parallely
However this makes debugging errors harder
If you have an error, just run
Code:
$ make
to reduce output and identify error
Anyway, the process generate a zImage in arch/arm/boot/zImage
or arch/arm64/boot/zImage
This is a binary file
If you check the zip of your favorite custom kernel, you will find one too
In most cases, you can simply replace it with this, update the updater-script, and flash
Most of these zips use anykernel format, meaning it utilizes ramdisk from existing kernel, so if you find such a zip for your device, you're good to go
Else unpack your boot.img and add this add the file boot.img-zImage, repack, flash
If you don't understand any of these terms [emoji14], please google about them first, and then if you are unable to find out ask here please
Enjoy
More stuff will be added soon
Uses of Local_manifests
Now we will learn what is Manifest. Its used for syncing source from Github,Bitbucket. Its driven via XML. Basically XML is a markup language. We can modify Rom's default.xml but it can cause of conflicts next time. So never think of editing default.xml
Now you can say how we sync our desired repo without modifying default manifest? There is a option called local manifests. By local manifests we can sync our desired repository. You can add,remove any project from default manifest without modifying default.xml
So now we will learn using local manifests-----
Open terminal and type
Code:
cd your source directory name/.repo
e.g: cd cm/.repo
Now create a new directory called local_manifests
Then type
Code:
cd local_manifests
Now type
Code:
nano localmanifest.xml
Now add whatever you want and save it via "ctrl+X"
Adding or Removing repo
Open localmanifest.xml then
Code:
<?xml version="1.0" encoding="UTF-8"?>
<manifest>
<remove-project name="CyanogenMod/android_frameworks_base" />
<project path="frameworks/base" name="Anik1199/android_frameworks_base" remote="github" revision="cm-13.0"/>
This will remove project from CyanogenMod and sync from Anik1199's git.
When adding a new project that replaces an existing project, you should always remove that project before defining the replacement.
You can simply add a new project to the source code, such as when you want to add your own app to the build.
Note that when adding new projects, there are at least three parts defined:
• remote -- the name of the remote. this can be one that was defined in either the default manifest or local_manifest.xml.
• name -- the name of the git project-- for github it has the format account_name/project_name.
• path -- where the git repository should go in your local copy of the source code.
• revision -- (optional) which branch or tag to use in the repository. If this attribute is omitted, repo sync will use the revision specified by the <default ... /> tag in the default manifest.
After creating .repo/local_manifests.xml, you should be able to repo sync and the source code will be updated accordingly
In many Manifest.xml you ll find many stuff not needed by our device. Also there are files needed and that is not present in the default.xml.
Adding Projects to local_manifest.xml
So, to add projects to your local_manifest.xml for your device refer the following format that explains the same.
Code:
<?xml version="1.0" encoding="UTF-8"?>
<manifest>
<project path=" directory in work tree" name="name of the repository in remote" remote="name of remote defined earlier" revision="branch of the repository" />
</manifest>
If you have any doubt? See my localmanifest.xml
Device Example Used Here : Android One (Sprout)
Code:
<manifest>
<?xml version="1.0" encoding="UTF-8"?>
<manifest>
<!--Devices-->
<project path="device/google/sprout4" name="CyanogenMod/android_device_google_sprout4" remote="github" revision="cm-13.0" />
<!--Devices commons-->
<project path="device/google/sprout-common" name="CyanogenMod/android_device_google_sprout-common" remote="github" revision="cm-13.0" />
<!--Kernels-->
<project path="kernel/mediatek/sprout" name="CyanogenMod/android_kernel_mediatek_sprout" remote="github" revision="cm-13.0" />
<!--Vendors-->
<project path="vendor/google" name="TheMuppets/proprietary_vendor_google" remote="github" revision="cm-13.0" />
</manifest>
This will download your device Identity needed for Rom Building
Making CM Device Tree Compatible With Your Rom For Compiling
We learnt how to initialize build environment,learnt some git,how to use local_manifest and learnt how to build CyanogenMod. Now we will learn how to compatiable CyanogenMod device tree for other Rom. We used Android One aka sprout as a reference. Now we will try to build another CyanogenMod based Rom for sprout.
I am using Team-Radium Rom as reference. So we can start......
There are 3 files in CM Tree Which Should Be Modified.
They are,
1) cm.mk
2) cm.dependencies
3) vendorsetup.sh
We have to edit this 3 files for building Team-Radium
1) Rename cm.mk to radium.mk
As You can see That WE HAVE JUST REPLACED CM WITH Radium
Now you all must be thinking why did we rename cm.mk to radium.mk
A Simple Answer is we go to the vendor folder and check the name and replace it.
So now you must be wondering about the product name ...as in the above image only the "cm" changes to "Radium" with the same logic of the vendor name
In this case we see that Radium is the vendor ...so we rename the cm.mk to radium.mk
this same rule applies to the content inside the radium.mk too ... we first make sure that the files are available in that location .
2) Now we have to move second file "cm.dependencies"
This file will be simply renamed by Vendor Name ...
In This Case "Radium" ....so we rename it to "radium.dependencies"
3) The Last And The Final Change Required Is In The "vendorsetup.sh"
Open vendorsetup.sh and rename cm as radium and save.
Thats it!! So simple i think
Happy building
Good luck!!! :good:
Last one in case
Will soon add some common bugs and their fixes
If repo sync gives error like cannot overwrite work tree
then
Code:
$ repo sync --force-sync
For those with slow net
You can download highly compressed sources by @regalstreak and some others from here!
Unless its a one time build, i'd recommend getting the one with .repo folder, else you won't be able to easily update the source to the latest version!
Thanks guys like @OwnDroid @westcripp @##W4TCH0UT## @varun.chitre15 @CaptivateKing and many others who have inspired me about Android
Reserved
Anik_khan and akhilnarang ( My Encyclopedia of Development), love u guys. Keep doing awesome work
This is a nice guide... I think most of the people in India do not have high speed internet or continuous electricity for repo sync
This puts limitations on using own PCs for ROM building. I have seen lots of people who are using rented servers for this purpose. These servers are located somewhere in Europe or USA and one can access them (or VMs on them) remotely. These servers have internet speeds in GBs so the repo sync does not take more than 30 minutes...
I've recently started learning about ROM building and I've started with Google Cloud. Google have 2 months free service (so interested guys can start the ROM building right away without thinking about the time required for downloading 15-20 GBs )
@Anik_khan may be you can think of adding this as a tip in the OP...
@akhilnarang thanks for helping me and be ready... I'll be coming with lots of questions
Great work guys.
This will help a lot of newbies.
Add use of build scripts maybe.
P.S : Sometime I forget actual commands because of too much use of build scripts
corphish said:
Add use of build scripts maybe.
P.S : Sometime I forget actual commands because of too much use of build scripts
Click to expand...
Click to collapse
I was planning too, the guide is gonna be improved over the next few days
Sent from my A0001 using Tapatalk
a small correction in installing java procedure, you need jdk 7 to build lollipop, you mentioned as jdk7 and higher but you can't build with jdk8. awesome guide so far, regards from me.
Sent from my XT1033 using Tapatalk
Great Post , Thanks my two most favorite Brother .
I am searching for this awesome post , and you give the way with a easy way .
Awesome written . Really easily to understand.
Thanks man thanks
Thanks guys..finally got a 'noob friendly guide'..
Sent from my HM 1SW using XDA Free mobile app
OMG!! It's awesome and damn noob friendly!! It's the best guide I have ever seen!!
Thanks to you @Anik_khan & @akhilnarang
Keep your awesome work guys!!
Anik_khan said:
There are 3 files in CM Tree Which Should Be Modified.
They are,
1) cm.mk
2) cm.dependencies
3) vendorsetup.sh
Click to expand...
Click to collapse
Just add this point as a note :-
Some ROMs extensively need device dependencies in their vendor source, be sure that u add it before building (if necessary)
Sent from my A0001 using Tapatalk
Its really a nice guide, but i need your help as am stuck on how to add a device to aosp/CM source, whenever i tried to add a device, I follows all instructions but it always give me an error
Which would you like? [aosp_arm-eng] 7
build/core/product_config.mk:222: *** Can not locate config makefile for product "ha_i9500". Stop.
** Don't have a product spec for: 'ha_i9500'
** Do you have the right repo manifest?
Frostyagent said:
Its really a nice guide, but i need your help as am stuck on how to add a device to aosp/CM source, whenever i tried to add a device, I follows all instructions but it always give me an error
Which would you like? [aosp_arm-eng] 7
build/core/product_config.mk:222: *** Can not locate config makefile for product "ha_i9500". Stop.
** Don't have a product spec for: 'ha_i9500'
** Do you have the right repo manifest?
Click to expand...
Click to collapse
Rename cm.mk to ha_i9500.mk
Sent from my A0001 using Tapatalk
ujwal.p said:
Rename cm.mk to ha_i9500.mk
I have done it but still no luck and error continues to display, I want to know what am i doing wrong, I was trying all the night but bad luck
Click to expand...
Click to collapse
Related
This is still unofficial. This thread is intended for devs & advanced users only.
Guide how I build CM10.1 for my smultron.
For the first time you try to build CM10.1
Follow this guide up to "Initialize the CyanogenMod source repository" step (don't execute this step).
http://wiki.cyanogenmod.org/w/Build_for_smultron
Download & install lzop compression tool
Code:
sudo apt-get install lzop
Initialize the CyanogenMod source repository
Enter the following to initialize the repository:
Code:
cd ~/android/system/
repo init -u git://github.com/CyanogenMod/android.git -b cm-10.1
Get the required local manifest
Code:
mkdir -p ~/android/system/.repo/local_manifests
curl https://raw.github.com/LegacyXperia/local_manifests/cm-10.1/semc.xml > ~/android/system/.repo/local_manifests/semc.xml
Download the source code
Code:
repo sync
Download some commits from CyanogenMod gerrit which are not accepted yet
Code:
curl https://raw.github.com/LegacyXperia/local_manifests/cm-10.1/updates.sh > ~/android/system/updates.sh
chmod a+x updates.sh
./updates.sh
Get the prebuilts
Code:
cd ~/android/system/vendor/cm
./get-prebuilts
Setup the environment & prepare the device-specific code.
Code:
cd ~/android/system
. build/envsetup.sh
breakfast smultron
Build the ROM (takes long time)
Code:
brunch smultron
If the build finishes successfully, you will find the build here (change DATE into the date):
~/android/system/out/target/product/smultron/cm-10.1-DATE-UNOFFICIAL-smultron.zip
The next times you want to build, you only need to do the following:
Sync the repositories & make sure you are using the latest local_manifest.
Code:
cd ~/android/system/
curl https://raw.github.com/LegacyXperia/local_manifests/cm-10.1/semc.xml > ~/android/system/.repo/local_manifests/semc.xml
repo sync
Download some commits from CyanogenMod gerrit which are not accepted yet
Code:
curl https://raw.github.com/LegacyXperia/local_manifests/cm-10.1/updates.sh > ~/android/system/updates.sh
chmod a+x updates.sh
./updates.sh
Setup the environment
Code:
. build/envsetup.sh
Build the ROM
Code:
brunch smultron
If the build finishes successfully, you will find the build here (change DATE into the date):
~/android/system/out/target/product/smultron/cm-10.1-DATE-UNOFFICIAL-smultron.zip
Steps to build only the kernel:
Sync the repositories.
Code:
cd ~/android/system/
repo sync
Setup the environment
Code:
. build/envsetup.sh
Build the kernel
Code:
breakfast smultron
make -j4 bootimage
If the build finishes successfully, you will find the boot image here:
~/android/system/out/target/product/smultron/boot.img
Credits: Thanks to hnl_dk for the initial CM9 & CM10 guides.
Build is successful using this guide now. You can build for all xperia 2011 phones by replacing "smultron" with your device's name in the guide.
More info can be found here: https://github.com/LegacyXperia/local_manifests/wiki
Re: [GUIDE][WIP] How I build my own CM10.1 test builds
Wew good guide! :thumbup: hope can get the stable version of the CM10.1with this guide here
Sent from my SK17i using xda premium
After 'repo init' there should be a
Code:
mkdir -p ~/android/system/.repo/local_manifests
Script to apply not yet merged changes:
Code:
#!/bin/sh
android=~/android/system
#http://review.cyanogenmod.org/#/c/32906/
cd ${android}/frameworks/av/
git fetch http://review.cyanogenmod.org/CyanogenMod/android_frameworks_av refs/changes/06/32906/2 && git format-patch -1 --stdout FETCH_HEAD | patch -p1
#http://review.cyanogenmod.org/#/c/28336/
cd ${android}/packages/apps/LegacyCamera/
git fetch http://review.cyanogenmod.org/CyanogenMod/android_packages_apps_LegacyCamera refs/changes/36/28336/1 && git format-patch -1 --stdout FETCH_HEAD | patch -p1
#http://review.cyanogenmod.org/#/c/34989/
cd ${android}/hardware/qcom/audio-caf
git fetch http://review.cyanogenmod.org/CyanogenMod/android_hardware_qcom_audio-caf refs/changes/89/34989/5 && git format-patch -1 --stdout FETCH_HEAD | patch -p1
From http://forum.xda-developers.com/showthread.php?t=1358547
Code:
repo sync -f
May fix error: Exited sync due to fetch errors
hi,
I want to build CM 10.1 for my mango, guide is perfectly explain, just one question :
does i need to add the script part explain by M66B two post above or it's outdated and i just need to follow the first post ?
Thanks
Edit : sorry for the noob question, i have read the reviews and have my answer
kosmo666 said:
hi,
I want to build CM 10.1 for my mango, guide is perfectly explain, just one question :
does i need to add the script part explain by M66B two post above or it's outdated and i just need to follow the first post ?
Thanks
Edit : sorry for the noob question, i have read the reviews and have my answer
Click to expand...
Click to collapse
The scrip parts from above are outdated, we maintain this script now.
How to merge in this nAa 3.4.45 kernel sources? Is it connected with kernel sources?
mastero9017 said:
How to merge in this nAa 3.4.45 kernel sources? Is it connected with kernel sources?
Click to expand...
Click to collapse
If you look at Mike's github (https://github.com/LegacyXperia)
you'll see that he maintains his own branch of the nAa kernel (https://github.com/LegacyXperia/msm7x30-3.4.x-nAa).
They are not the same, but similar (Mike currently has more changes, since nAa hasn't updated anything for two weeks).
-> If you build Mike's sources, you'll also get a 3.4.45 kernel.
What am I doing wrong? Did everything, checked all libs 10 times..
EDIT: It's a KDE error,aghhr. Delete/clean /root/.config directory fixes it
Code:
[email protected]:~/android/system# brunch haida
including vendor/cm/vendorsetup.sh
Trying dependencies-only mode on a non-existing device tree?
============================================
PLATFORM_VERSION_CODENAME=REL
PLATFORM_VERSION=4.2.2
CM_VERSION=10.1-20130603-UNOFFICIAL-haida
TARGET_PRODUCT=cm_haida
TARGET_BUILD_VARIANT=userdebug
TARGET_BUILD_TYPE=release
TARGET_BUILD_APPS=
TARGET_ARCH=arm
TARGET_ARCH_VARIANT=armv7-a-neon
HOST_ARCH=x86
HOST_OS=linux
HOST_OS_EXTRA=Linux-3.2.0-41-generic-x86_64-with-Ubuntu-12.04-precise
HOST_BUILD_TYPE=release
BUILD_ID=JDQ39E
OUT_DIR=/root/android/system/out
============================================
============================================
PLATFORM_VERSION_CODENAME=REL
PLATFORM_VERSION=4.2.2
CM_VERSION=10.1-20130603-UNOFFICIAL-haida
TARGET_PRODUCT=cm_haida
TARGET_BUILD_VARIANT=userdebug
TARGET_BUILD_TYPE=release
TARGET_BUILD_APPS=
TARGET_ARCH=arm
TARGET_ARCH_VARIANT=armv7-a-neon
HOST_ARCH=x86
HOST_OS=linux
HOST_OS_EXTRA=Linux-3.2.0-41-generic-x86_64-with-Ubuntu-12.04-precise
HOST_BUILD_TYPE=release
BUILD_ID=JDQ39E
OUT_DIR=/root/android/system/out
============================================
make: *** /.config: is a directory. Stop.
Guys,
For your info Windows Host NTFS file system is case insensitive and will break android compilation!!!
Workaround: Create a new virtual hdd with ext3 format and mount it to your ubuntu guest! Sad that ntfs cannot be used.
So, below is for your info if u came across this post. It is useful for sharing folders between Linux guest and Windows host.
IF you are using Virtualbox on a Win7/8 host system,
To use Shared Folder feature and add automount (note, VirtualBox needs to be run as Administrator so that os.symlink works!!!!
In Windows:
1. Go to your VirtualMachine Folder and look for MyVM.vbox,
2. Open with notepad++
3. Look for <ExtraData>
4. Add this inside the <ExtraData></ExtraData>
Code:
<ExtraDataItem name="VBoxInternal2/SharedFoldersEnableSymlinksCreate/android" value="1"/>
where "android" is my shared folder!!! =)
In terminal:
Code:
sudo nano /etc/fstab
Add this line:
Code:
/android /home/myName/android vboxsf rw,uid=1000,gid=1000 0 0
where android is the folder I give when sharing in SharedFolder of the VirtualBox and /home/myName/android is the folder I created in Ubuntu.
Ctrl+O and hit Enter to save. Ctrl+X to quit. and Reboot and you are done.
Also, if you encounter error or Virtualbox/ubuntu hung on repo sync, add -j2 or -j3 to prevent race condition!!!
Code:
repo sync -j3
Syncing work tree error!!!
If you encounter syn error
Code:
Fetching projects: 100% (204/224), done.
Syncing work tree: 90% (204/224) error: manifest required for this command -- please run init
1. Go to "android\system\.repo\"
2. Open "project.list" with notepad or notepad++
3. Go to the line of error. In this case, line 204 as above.
4. E.g. Ling 204 shows: external/wpa_supplicant_6, So, go to the folder "android\system\external\wpa_supplicant_6" and delete ".git" folder
5. Go back to Terminal and "repo sync"
=)
You need the lz4 compression tool from now on to be able to build the kernel. First post is updated with instructions on how to get it.
Code:
sudo apt-get install subversion
cd ~/Downloads
svn checkout -r 91 http://lz4.googlecode.com/svn/trunk/ lz4
cd lz4 && make && cp lz4demo ~/bin/lz4demo
Can any body please tell me,what's the exact size of full cm10.1. Source repo
I had set my laptop to download repo from last 32 hours
And till now more than 8gb data was downloaded ....
And how to know how much data left for download...?
Can anybody give me the exact size of the gits which are to be download so that I can compare that sizes with the files which I had downloaded....?
Sent from my Xperia Mini Pro
Hey @mikeioannina,
Do you have any guide on repo branch? In windows, git gui is easy to do. But I'm not familiar with ubuntu.
How do you branch out the project without error?
I tried in ~/android/system:
Code:
repo start kernel-patch .
it says . project not found. What the hell. Needa branch and test some codes!!! =)
Also, is there a private directory for us to put binary to system/apps or scripts which will not be affected by "repo sync" during compilation?
---------- Post added at 06:42 PM ---------- Previous post was at 06:40 PM ----------
hijagdeep said:
Can any body please tell me,what's the exact size of full cm10.1. Source repo
I had set my laptop to download repo from last 32 hours
And till now more than 8gb data was downloaded ....
And how to know how much data left for download...?
Can anybody give me the exact size of the gits which are to be download so that I can compare that sizes with the files which I had downloaded....?
Sent from my Xperia Mini Pro
Click to expand...
Click to collapse
It's around ~25GB. Maybe less due to compression. ^_^
shenlong85 said:
It's around ~25GB. Maybe less due to compression. ^_^
Click to expand...
Click to collapse
Someone told me that its around 8 gb
Sent from my Xperia Mini Pro
hijagdeep said:
Someone told me that its around 8 gb
Sent from my Xperia Mini Pro
Click to expand...
Click to collapse
If you initiated with the CM10.1 branch, it will be 14Gig, if you initiated with no branch, 25Gig
Langes said:
If you initiated with the CM10.1 branch, it will be 14Gig, if you initiated with no branch, 25Gig
Click to expand...
Click to collapse
I have initiated with this repo command
repo init -u git://github.com/CyanogenMod/android.git -b cm-10.1
and also used this local manifests
mkdir -p ~/android/system/.repo/local_manifests
curl https://raw.github.com/LegacyXperia/local_manifests/master/semc.xml > ~/android/system/.repo/local_manifests/semc.xml
and now 25 hours are passed and it downloaded 9.5gb data ..
hijagdeep said:
I have initiated with this repo command
repo init -u git://github.com/CyanogenMod/android.git -b cm-10.1
and also used this local manifests
mkdir -p ~/android/system/.repo/local_manifests
curl https://raw.github.com/LegacyXperia/local_manifests/master/semc.xml > ~/android/system/.repo/local_manifests/semc.xml
and now 25 hours are passed and it downloaded 9.5gb data ..
Click to expand...
Click to collapse
repo init -u git://github.com/CyanogenMod/android.git -b cm-10.1 is for the whole cm10.1 sources. Be patient. Are you using full blown linux host or just a virtual machine? IF you are using virtual machine, it may be slow and have race condition during repo which results in errors. Try using
Code:
repo sync -j3
For 3 simultaneous thread or j2 depending on the number of core in your processor and whether there is hyperthreading. It'll make it more stable.
I put this tutorial together in an attempt to create the most complete and easy to follow guide for building a ROM from source. Including steps for adding apps to your build, changing toolchains and more... The entire guide uses a single Linux terminal window from start to finish in an attempt to keep everything as user friendly as possible. Please feel free to PM me suggestions on where changes need be made.
If you find this guide helpful please press the Thanks button on my posts and rate the thread a 5.
Prerequisites1. This guide is for 64-bit, 32-bit machines will not work for building newer android versions, Ubuntu 12+ based machine, I run Linux Mint 15. Follow links at end of OP for alternate directions
Windows Users: Setup Ubuntu in Virtualbox Instructions
2. You need to know the location for your device, vendor, and kernel repos. This can be found fairly easily in the forum for your phone. Also take note of your phones codename.
For example the Optimus G is the e970 and its device repo can be found here https://github.com/CyanogenMod/android_device_lge_e970
Note*All terminal commands will be in Code boxes*
Part 1 - Setting Up The Build Environment
Install Java JDK
Code:
sudo add-apt-repository ppa:webupd8team/java
Code:
sudo apt-get update
Lollipop Roms:
Code:
sudo apt-get install oracle-java7-installer
Kit-Kat Roms:
Code:
sudo apt-get install oracle-java6-installer
Installing required packages
Ubuntu 14 based:
Code:
sudo apt-get install bison g++-multilib git gperf libxml2-utils
Ubuntu 12 based:
Code:
sudo apt-get install git gnupg flex bison gperf build-essential \
zip curl libc6-dev libncurses5-dev:i386 x11proto-core-dev \
libx11-dev:i386 libreadline6-dev:i386 libgl1-mesa-glx:i386 \
libgl1-mesa-dev g++-multilib mingw32 tofrodos \
python-markdown libxml2-utils xsltproc zlib1g-dev:i386
Code:
sudo ln -s /usr/lib/i386-linux-gnu/mesa/libGL.so.1 /usr/lib/i386-linux-gnu/libGL.so
Set-up ccache This Is Optional
Code:
nano ~/.bashrc
Add these two lines
export USE_CCACHE=1
export CCACHE_DIR=<path-to-your-cache-directory>
Click to expand...
Click to collapse
Save and exit by pressing ctrl+x, selecting Y then enter.
Install ADB & Fastboot This is optional, as you may already have them working. If not, they're a good thing to have.
Code:
sudo add-apt-repository ppa:nilarimogard/webupd8
Code:
sudo apt-get update
Code:
sudo apt-get install android-tools-adb android-tools-fastboot
Setup Repo
Code:
mkdir ~/bin
Code:
PATH=~/bin:$PATH
Code:
curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
Code:
chmod a+x ~/bin/repo
Create working directory
Code:
mkdir [I][B]working-dir[/B][/I]
(Replace working-dir with whatever you'd like to call it, ie. aokp)
Code:
cd working-dir
Part 2 - Get SourceROM Source
Choose which custom rom you are going to build and initialize the repo for it
Code:
repo init -u [I][B]chosen-manifest[/B][/I]
(Replace chosen-manifest appropriately from the list below)
AOKP: https://github.com/AOKP/platform_manifest.git -b Branch
Cyanogenmod: https://github.com/CyanogenMod/android.git -b Branch
CarbonDev: https://github.com/CarbonDev/android.git -b Branch
Liquid Smooth: https://github.com/LiquidSmooth/android.git -b Branch
Replace Branch with appropriate branch from github repo ie cm-10.2 or jb3
If unsure which branch click the link above to locate appropriate branch
Click to expand...
Click to collapse
Device Source
Go HERE and follow instructions on obtaining your device specific repos.
Sync the repo
Code:
repo sync
This will take a while as it downloads all the required source
Part 3 - Preparing SourceBefore you're ready to build your source needs to be configured to include your device. This preparation varies slightly for different custom Roms.
Go HERE and follow instructions for your ROM choice
Part 4 - Edit SourceThis Is OptionalThis is where you can make edits to the source before building to suit your needs.
Go HERE and follow the instructions to tweak source
Part 5 - Building ROM
Code:
. build/envsetup.sh
Code:
lunch
Locate your device on the list and enter appropriate number
Code:
make -j[B][I]# [/I][/B]otapackage
Replace # with the number of cores in your system (Is the number of jobs that will be done at once, more cores means more jobs)
Build Errors
This can be hard, especially if you're new to programming languages and building. Meet Google your new best friend.
Here is a basic overview to get you started, and if no more at least googling in the right direction.
FinishedWhen it's done you're rom will be in working-dir/out/target/product/codename/
Enjoy.
I used these sites while making this guide
http://source.android.com/source/initializing.html
http://www.webupd8.org/2012/11/oracle-sun-java-6-installer-available.html
http://www.webupd8.org/2012/08/install-adb-and-fastboot-android-tools.html
Device Source As stated in the prerequisites you will need a device specific Device repo, Vendor repo, and Kernel repo. You can find links to them in the threads for your devices. Also take note of your device codename ie Nexus 4 is mako, Optimus G is gee.
There are two options for adding in device specific source, local manifest and git clone.
Local manifest syncs the device repos each time a repo sync is run. This is probably the better choice if you don't make edits and rely on the repo's maintainer for changes.
Git clone is a one time download of a specific repo to the directory indicated and is not affected by repo sync. This is probably the better choice if you make edits to the device source as they won't be over written or cause conflicts when syncing.
The local path for your phone's repos be device/manufacturer/codename, vendor/manufacturer/codename, kernel/manufacturer/codename regardless of method chosen.
Git Clone
Code:
git clone [B][COLOR="DarkOrange"]repo[/COLOR][/B] -b [B][COLOR="Magenta"]branch[/COLOR][/B] [B][COLOR=Lime]destination-path[/COLOR][/B]
here is and example for the vendor repo for the E973 from TeamPlaceHolder
git clone https://github.com/TeamPlaceholder/proprietary_vendor_lge_gee -b cm-10.2 vendor/lge/gee
Click to expand...
Click to collapse
Local Manifest
Code:
mkdir .repo/local_manifests
Code:
touch .repo/local_manifests/local_manifest.xml
Code:
nano .repo/local_manifests/local_manifest.xml
Add these lines replacing path, name and revision according to the repo's you are using.
This example is for E973 using TeamPlaceHolder repos, adding all device/vendor/kernel repos.
<?xml version="1.0" encoding="UTF-8"?>
<manifest>
<remote name="gh"
fetch="git://github.com/" />
<project path="kernel/lge/gee" name="TeamPlaceholder/android_kernel_lge_gee" remote="gh" revision="cm-10.2-merge" />
<project path="device/lge/geeb" name="TeamPlaceholder/android_device_lge_geeb" remote="gh" revision="cm-10.2" />
<project path="device/lge/gee-common" name="TeamPlaceholder/android_device_lge_gee-common" remote="gh" revision="cm-10.2" />
<project path="vendor/lge/gee" name="TeamPlaceholder/proprietary_vendor_lge_gee" remote="gh" revision="cm-10.2" />
</manifest>
Click to expand...
Click to collapse
Preparing SourceROM specific setup instructions prior to building. All source should be downloaded already.
Manufacturer and codename MUST be updated to reflect your device.
Cyanogenmod
Add this line to vendor/cm/vendorsetup.sh
cm_device-userdebug
Click to expand...
Click to collapse
device - The codename for your device. ie. mako for the Nexus 4
Code:
touch [COLOR="Purple"]path-to-device-tree[/COLOR]/cm.mk
path-to-device-tree - Example device/lge/mako for the Nexus 4
Code:
nano [COLOR="Purple"]path-to-device-tree[/COLOR]/cm.mk
Add these lines **This example is for the Nexus 4 Mako, change mako references to reflect your device**
## Specify phone tech before including full_phone
$(call inherit-product, vendor/cm/config/gsm.mk)
# Inherit some common CM stuff.
$(call inherit-product, vendor/cm/config/common_full_phone.mk)
# Enhanced NFC
$(call inherit-product, vendor/cm/config/nfc_enhanced.mk)
# Inherit device configuration
$(call inherit-product, device/lge/mako/full_mako.mk)
## Device identifier. This must come after all inclusions
PRODUCT_DEVICE := mako
PRODUCT_NAME := cm_mako
PRODUCT_BRAND := google
PRODUCT_MODEL := Nexus 4
PRODUCT_MANUFACTURER := LGE
# Enable Torch
PRODUCT_PACKAGES += Torch
Click to expand...
Click to collapse
Save and exit by pressing ctrl+x, selecting Y then enter.
Now you're ready to build! Go back to the OP and complete the guide from where you left off.
AOSP
AOSP requires a prebuilt kernel for your device. HERE is a guide for building a kernel if you do not have a prebuilt kernel for your device
The rest coming soon...
Liquid Smooth
Coming soon...
AOKP
Code:
nano vendor/aokp/vendorsetup.sh
Add this line
add_lunch_combo aokp_geeb-userdebug
Click to expand...
Click to collapse
Save and exit by pressing ctrl+x, selecting Y then enter.
Code:
touch vendor/aokp/products/geeb.mk
Code:
nano vendor/aokp/products/geeb.mk
Add these lines
If building for CDMA network change gsm.mk to cdma.mk
# Inherit AOSP device configuration for geeb
$(call inherit-product, device/lge/geeb/full_geeb.mk)
# Inherit AOKP common bits
$(call inherit-product, vendor/aokp/configs/common.mk)
# Inherit GSM common stuff
$(call inherit-product, vendor/aokp/configs/gsm.mk)
# Setup device specific product configuration
PRODUCT_NAME := aokp_geeb
PRODUCT_BRAND := google
PRODUCT_DEVICE := geeb
PRODUCT_MODEL := Optimus G
PRODUCT_MANUFACTURER := LGE
Click to expand...
Click to collapse
Save and exit by pressing ctrl+x, selecting Y then enter.
Code:
nano vendor/aokp/products/AndroidProducts.mk
Add this line
$(LOCAL_DIR)/geeb.mk \
Click to expand...
Click to collapse
Save and exit by pressing ctrl+x, selecting Y then enter.
Now you're ready to build! Go back to the OP and complete the guide from where you left off.
CarbonDev
Coming soon...
Now you're ready to build! Go back to the OP and complete the guide from where you left off.
Edit Source
If you plan to edit the device/kernel repos for your phone you should either have used git clone to obtain your repos, or created forks of the repos to your own Github account to use in your local manifest. This way you can still do a repo sync to update the source without overwriting your changes or creating conflicts.
That being said these are the items disscused so far:
Adding Prebuilt APK's to Build
Adding Apps Via Source Code
Changing Toolchain
Cherry Picking Commits
Fixing Conflicts From Cherry Picks
Syncing Repo with Upstream Repo
Syncing Your Local Changes to Your Github Repo
Click to expand...
Click to collapse
Adding Prebuilt APK's to Build
Open the device folder for your phone. ie device/lge/geeb
Add these lines to android.mk
include $(CLEAR_VARS)
LOCAL_MODULE := Name
LOCAL_SRC_FILES := $(LOCAL_MODULE).apk
LOCAL_MODULE_TAGS := optional
LOCAL_MODULE_SUFFIX := .apk
LOCAL_MODULE_CLASS := APPS
LOCAL_CERTIFICATE := PRESIGNED
include $(BUILD_PREBUILT)
Click to expand...
Click to collapse
Name - Any name you want to asign to this apk to call for it in the build process
**NOTE** LOCAL_SRC_FILES is the location of the apk file. Above assumes it is in the root of your device folder**
Then edit your device.mk to call for your newly assigned apk
PRODUCT_PACKAGES += \
name
Click to expand...
Click to collapse
If the apk you want to add requires additional files to be added along with it, also add this
PRODUCT_COPY_FILES += \
Path-to-additional-file:Destination-path-in-finished-build
Click to expand...
Click to collapse
Path-to-additional-file - Where the file is located in your device tree that you need to add to your build
Destination-path-in-finished-build - Where in the final rom structure this file needs to be
Here is an example for adding required libs for Terminal Emulator to the geeb device tree:
PRODUCT_COPY_FILES += \
device/lge/geeb/libjackpal-androidterm3.so:system/lib/libjackpal-androidterm3.so \
device/lge/geeb/libjackpal-androidterm4.so:system/lib/libjackpal-androidterm4.so
Click to expand...
Click to collapse
Adding Apps Via Source Code
Adding apps to your build using source code is easier then adding prebuilt apks.
Example given is using Gallery2(I realize this is included with builds by default, just using it as an example)
Copy or clone your app's source code to working-dir/packages/apps in its own folder. ie. aokp/packages/Gallery2
Go into the source code folder for your app and open Android.mk
Look for this line LOCAL_PACKAGE_NAME , This will tell you what the call name for your app is
LOCAL_AAPT_FLAGS := --auto-add-overlay
LOCAL_PACKAGE_NAME := Gallery2
LOCAL_OVERRIDES_PACKAGES := Gallery Gallery3D GalleryNew3D
Click to expand...
Click to collapse
Then open device.mk from your phones device tree and add the call name for the app.
Add these lines:
PRODUCT_PACKAGES += \
Gallery2
Click to expand...
Click to collapse
Changing Toolchain
Download a new prebuilt toolchain that you wish to use
Example: Linaro 4.7 toolchain
Copy unziped prebuilt toolchain folder to working-folder/prebuilt/gcc/linux-x86/arm
Open build/envsetup.sh
Find this block of code:
# The gcc toolchain does not exists for windows/cygwin. In this case, do not reference it.
export ANDROID_EABI_TOOLCHAIN=
local ARCH=$(get_build_var TARGET_ARCH)
case $ARCH in
x86) toolchaindir=x86/i686-linux-android-$targetgccversion/bin
;;
arm) toolchaindir=arm/android-toolchain-eabi/bin
;;
mips) toolchaindir=mips/mipsel-linux-android-$targetgccversion/bin
;;
*)
echo "Can't find toolchain for unknown architecture: $ARCH"
toolchaindir=xxxxxxxxx
;;
esac
if [ -d "$gccprebuiltdir/$toolchaindir" ]; then
export ANDROID_EABI_TOOLCHAIN=$gccprebuiltdir/$toolchaindir
fi
unset ARM_EABI_TOOLCHAIN ARM_EABI_TOOLCHAIN_PATH
case $ARCH in
arm)
toolchaindir=arm/android-toolchain-eabi/bin
if [ -d "$gccprebuiltdir/$toolchaindir" ]; then
export ARM_EABI_TOOLCHAIN="$gccprebuiltdir/$toolchaindir"
ARM_EABI_TOOLCHAIN_PATH=":$gccprebuiltdir/$toolchaindir"
fi
Click to expand...
Click to collapse
Replace bold text with your toolchain folder name
The following group of instructions are for making edits to your own repo. Before using any of the info below PLEASE create your own GitHub account and Fork the repo you'd like to edit. Then clone YOUR forked repo from YOUR github account and make edits to it.
If that didn't make sence then you may want to refrain from using this for the time being.
Cherry Picking Commits
Move to the directory for the git repo you wish to add the commit to. ie kernel/lge/geeb
Code:
cd path-to-git-repo
Add the remote repo that holds the commit - This only needs to be done the first time
Code:
git remote add [COLOR="Red"]name[/COLOR] [COLOR="SeaGreen"]url[/COLOR]
name - a name you choose to identify that remote repo
url - the location of the repo ie. https://github.com/TeamPlaceholder/android_kernel_lge_gee.git
Fetch the repo
Code:
git fetch [COLOR="Red"]name[/COLOR]
Cherry pick commit
Code:
git cherry-pick [COLOR="DarkOrange"]commit-id[/COLOR]
commit-id - An unique id given to every commit. It's a long alphanumeric id shown on the commit page of your repo. ie. cc3581ff8692b517ddda8baad73a5d110568f0da
Fixing Conflicts From Cherry Picks
Somtimes when you cherry pick a commit to your repo you'll have a conflict. This is just saying that it did not see what it expected to see when adding the commit to a certain file. To fix a conflict and commit the cherry pick do as follows:
Determine which file(s) contain conflicts.
Code:
git status
This will show you edits waiting to be commited from the cherry-pick. The files shown in green accepted the changes without conflict, the files listed in red contain conflicts that need to be addressed.
Open the file in red
Code:
gedit [COLOR="DarkOrange"]Path-To-File-In-Red[/COLOR]
Press crtl+f to bring up a find window and search for head. Conflicts will be shown in the file using the following structure
<<<<<Head
<Original Code>
=======
<Code from Cherry-pick>
>>>>>Name Of Cherry Pick Commit
Click to expand...
Click to collapse
Compare the original code to the code from the cherry pick and see if anything needs to be saved. If so, merge what needs to be saved into the code from the cherry pick. Then delete the original code and the <<<< ===== >>>>> lines(everything shown in red above). In the end you should be left only with the code from the cherry pick, plus anything you may have merged to it.
Search again for 'head' to see if there are any further conflicts within that file. If there is use the same method to resolve them, if there is not save and exit the file.
Add the newly edited file to the pending commit
Code:
git add [COLOR="DarkOrange"]Path-To-File-In-Red[/COLOR]
Check for any more files that need to be addressed
Code:
git status
If you still have files in red, repeat the process above for those files.
Once all files from git status are shown in green you are ready to commit the cherry pick.
Code:
git commit
Save and exit the commit log by pressing ctrl+x
Done. That cherry pick is now commited to your repo, you can move on to the next cherry pick you wish to add.
Sync Forked Repo with Upstream(Parent) Repo
If you would like to commit to your forked repo all the commits made upstream since you forked(or previously sync'd)
Add the upstream repo - This only needs to be done the first time
Code:
git remote add [COLOR="Red"]name[/COLOR] [COLOR="SeaGreen"]url[/COLOR]
name - a name you choose to identify that remote repo
url - the location of the repo ie. https://github.com/TeamPlaceholder/android_kernel_lge_gee.git
Fetch the upstream repo
Code:
git fetch [COLOR="Red"]name[/COLOR]
Merge upstream commits
Code:
git merge [COLOR="Red"]name[/COLOR]/[COLOR="DarkOrange"]branch[/COLOR]
branch - The branch from the upstream repo you are syncing up
Syncing Your Local Changes to Your Github Repo
Check to ensure you have everything in order to push your changes
Code:
git status
If there are no conflicts/changes that need to be commited you are ready to push. If everything is good it will simply state your are x number of commits ahead
Push your commits to your GitHub account
Code:
git push
Enter your github user name then password. All your local commits will then be applied to your github repo.
More to Come...
Build Errors
Build Errors
This is way to broad a subject to cover in a post, but here are some steps to take to help get you building again.
When your build output stops without clearly saying it's finished or directing you to the created zip file, it Failed.
Sometimes it will stop with the error right at the end of the output, but not very often. Most of the time you must look up through the build output in order to locate the actual error. Sometimes they can be buried very far up, depending on the number of jobs being built.
Here is an example of what you are looking for:
hardware/qcom/display-caf/libgralloc/framebuffer.cpp:116:39: error: 'MSMFB_DISPLAY_COMMIT' was not declared in this scope
Click to expand...
Click to collapse
File having the error
Line in the file where the error occurs
Error that has occured
The quickest way to locate the errors in the build output is the search 'ctrl+shfit+F' for ': error:'
Once you have located your error(s), you can begin troubleshooting to get past them. Start by opening the File having the error and going to the Line in the file where the error occurs. Though without programing knowledge you may not make much sense of it, it's always good to start familiarizing yourself with the code. If you're not able to correct the issue this is where google will come in very handy.
Quite often if you search simply for the Error that has occured exactly as it appears, you'll find its an error that has been encountered many times over and solutions are availible within the first couple of results in a google search.
Should all else fail Post a question and see what suggestions come up.
Here are a few common build errors that I have come across and some solutions for them, again this is by no means a one stop for build erros. Google...Google...Then try to post your error and see who can help if your still stuck. The more you fix by yourself the more it feels like YOUR build.
make: *** No rule to make target `Example_File'. Stop.
Click to expand...
Click to collapse
It can't find the file in question. This can be a incorrect path in a makefile, a missing file or a typo.
last one
Finally usefull guide! not only theory. Thank you very much!
Nice job. Just one thing: when using our sources, the cm-10.2-merge is the best kernel branch. Msm-3.10 is our bleeding edge and hopefully will be fully working soon (just got it to build today, so we'll see). The update branch is broken though. Let me know if you want to contribute to our Git so I can add you to the team, or if you have any suggestions on how to make our rom and kernel better.
Sent from my LG-LS970 using xda app-developers app
xboxfanj said:
Nice job. Just one thing: when using our sources, the cm-10.2-merge is the best kernel branch. Msm-3.10 is our bleeding edge and hopefully will be fully working soon (just got it to build today, so we'll see). The update branch is broken though. Let me know if you want to contribute to our Git so I can add you to the team, or if you have any suggestions on how to make our rom and kernel better.
Sent from my LG-LS970 using xda app-developers app
Click to expand...
Click to collapse
Thanks for the info, updated quide to reflect.
i have a cherry mobile burst phone its running ics,i a generic phone a clone i dont know where it came from i mean the build i cant find a source or a build repo , i really want to build a rom for my phone cause it seems ics is not compatible for the phone..it only has 512 ram and 1ghz dualcore processor..it could run smoothly i think with gingerbread but i cant find a tutorial to donwgrade it to gingerbread it seems impossible because of lack of support for the device and it came up with ics..i just dont know what to do any more my computer is linux mint 13 2gb ram 1ghz amd anthlon 2 ,70gb hd..i cant build a rom to this computer..
Changing Toolchain
Download a new prebuilt toolchain that you wish to use
Example: Linaro 4.7 toolchain
Copy unziped prebuilt toolchain folder to working-folder/prebuilt/gcc/linux-x86/arm
Open build/envsetup.sh
Find this block of code:
Quote:
# The gcc toolchain does not exists for windows/cygwin. In this case, do not reference it.
export ANDROID_EABI_TOOLCHAIN=
local ARCH=$(get_build_var TARGET_ARCH)
case $ARCH in
x86) toolchaindir=x86/i686-linux-android-$targetgccversion/bin
;;
arm) toolchaindir=arm/android-toolchain-eabi/bin
;;
mips) toolchaindir=mips/mipsel-linux-android-$targetgccversion/bin
;;
*)
echo "Can't find toolchain for unknown architecture: $ARCH"
toolchaindir=xxxxxxxxx
;;
esac
if [ -d "$gccprebuiltdir/$toolchaindir" ]; then
export ANDROID_EABI_TOOLCHAIN=$gccprebuiltdir/$toolchaindir
fi
unset ARM_EABI_TOOLCHAIN ARM_EABI_TOOLCHAIN_PATH
case $ARCH in
arm)
toolchaindir=arm/android-toolchain-eabi/bin
if [ -d "$gccprebuiltdir/$toolchaindir" ]; then
export ARM_EABI_TOOLCHAIN="$gccprebuiltdir/$toolchaindir"
ARM_EABI_TOOLCHAIN_PATH=":$gccprebuiltdir/$toolchaindir"
fi
Replace bold text with your toolchain folder name
Click to expand...
Click to collapse
Click to expand...
Click to collapse
I did what you said and i keep getting this error
"/arm-eabi-gcc: No such file or directory
make[4]: *** [scripts/mod/empty.o] Error 1
make[3]: *** [scripts/mod] Error 2
make[2]: *** [scripts] Error 2
make[2]: *** Waiting for unfinished jobs...."
Here's what my envsetup.sh looks like
# The gcc toolchain does not exists for windows/cygwin. In this case, do not reference it.
export ANDROID_EABI_TOOLCHAIN=
local ARCH=$(get_build_var TARGET_ARCH)
case $ARCH in
x86) toolchaindir=x86/i686-linux-android-$targetgccversion/bin
;;
arm) toolchaindir=arm/arm-eabi-linaro-4.6.2/bin
;;
mips) toolchaindir=mips/mipsel-linux-android-$targetgccversion/bin
;;
*)
echo "Can't find toolchain for unknown architecture: $ARCH"
toolchaindir=xxxxxxxxx
;;
esac
if [ -d "$gccprebuiltdir/$toolchaindir" ]; then
export ANDROID_EABI_TOOLCHAIN=$gccprebuiltdir/$toolchaindir
fi
unset ARM_EABI_TOOLCHAIN ARM_EABI_TOOLCHAIN_PATH
case $ARCH in
arm)
toolchaindir=arm/arm-eabi-linaro-4.6.2/bin
if [ -d "$gccprebuiltdir/$toolchaindir" ]; then
export ARM_EABI_TOOLCHAIN="$gccprebuiltdir/$toolchaindir"
ARM_EABI_TOOLCHAIN_PATH=":$gccprebuiltdir/$toolchaindir"
fi
Click to expand...
Click to collapse
my linaro folder is called "arm-eabi-linaro-4.6.2" and it is placed under "/prebuilts/gcc/linux-x86/arm/arm-eabi-linaro-4.6.2"
what am i doing wrong?
thanks!
ryukiri said:
I did what you said and i keep getting this error
"/arm-eabi-gcc: No such file or directory
make[4]: *** [scripts/mod/empty.o] Error 1
make[3]: *** [scripts/mod] Error 2
make[2]: *** [scripts] Error 2
make[2]: *** Waiting for unfinished jobs...."
Click to expand...
Click to collapse
Where did you get your linaro toolchain from?
go into your linaro directory/bin do you see arm-eabi**** files?
Sounds like it's only the arm-linux-androideabi*** files in there.
Get the prebuilt toolchains right from Linaro It will take a little looking around to find the 4.6. The prebuilt toolchains for each release are in Components>Android>Toolchain Most of them are 4.7 and 4.8 so like I said, it may take some looking around.
I believe(though not 100%) the arm-eabi are used for the kernel, the arm-linux-androideabi for the rom.
The top line you change in envsetup.sh is for the rom toolchain, second place you change is for the kernel toolchain. You can use two different toolchains here. I use sabermod 4.9 for my rom and linaro 4.7 for the kernel
Haze028 said:
Where did you get your linaro toolchain from?
go into your linaro directory/bin do you see arm-eabi**** files?
Sounds like it's only the arm-linux-androideabi*** files in there.
Get the prebuilt toolchains right from Linaro It will take a little looking around to find the 4.6. The prebuilt toolchains for each release are in Components>Android>Toolchain Most of them are 4.7 and 4.8 so like I said, it may take some looking around.
I believe(though not 100%) the arm-eabi are used for the kernel, the arm-linux-androideabi for the rom.
The top line you change in envsetup.sh is for the rom toolchain, second place you change is for the kernel toolchain. You can use two different toolchains here. I use sabermod 4.9 for my rom and linaro 4.7 for the kernel
Click to expand...
Click to collapse
hmm, i forgot where i got it from, i might have gotten it by following this http://forum.xda-developers.com/showthread.php?t=1988315
Can I use 4.7 or 4.8 though?
Ok so inside my linaro directory/bin, i see many arm-eabi**** files (attached screenshot)
Do you think you can link to me the exact toolchains you used so I can start with something that works and then start trying different ones later?
ryukiri said:
Can I use 4.7 or 4.8 though?
Do you think you can link to me the exact toolchains you used so I can start with something that works and then start trying different ones later?
Click to expand...
Click to collapse
I would stick with 4.7 toolchain. 4.6 is quite old, and 4.8 doesn't seem to play very nice. (i'm probably too noob to get it working)
This is the linaro 4.7 toolchain I use.
Hopefully that'll help ya get going.
Haze028 said:
I would stick with 4.7 toolchain. 4.6 is quite old, and 4.8 doesn't seem to play very nice. (i'm probably too noob to get it working)
This is the linaro 4.7 toolchain I use.
Hopefully that'll help ya get going.
Click to expand...
Click to collapse
alright thanks. Ill test it out and report back later
I got the same error.. D:
"/arm-eabi-gcc: No such file or directory
make[4]: *** [scripts/mod/empty.o] Error 1
make[3]: *** [scripts/mod] Error 2
make[2]: *** [scripts] Error 2
make[2]: *** Waiting for unfinished jobs...."
# The gcc toolchain does not exists for windows/cygwin. In this case, do not reference it.
export ANDROID_EABI_TOOLCHAIN=
local ARCH=$(get_build_var TARGET_ARCH)
case $ARCH in
x86) toolchaindir=x86/i686-linux-android-$targetgccversion/bin
;;
arm) toolchaindir=arm/android-toolchain-eabi/bin
;;
mips) toolchaindir=mips/mipsel-linux-android-$targetgccversion/bin
;;
*)
echo "Can't find toolchain for unknown architecture: $ARCH"
toolchaindir=xxxxxxxxx
;;
esac
if [ -d "$gccprebuiltdir/$toolchaindir" ]; then
export ANDROID_EABI_TOOLCHAIN=$gccprebuiltdir/$toolchaindir
fi
unset ARM_EABI_TOOLCHAIN ARM_EABI_TOOLCHAIN_PATH
case $ARCH in
arm)
toolchaindir=arm/android-toolchain-eabi/bin
if [ -d "$gccprebuiltdir/$toolchaindir" ]; then
export ARM_EABI_TOOLCHAIN="$gccprebuiltdir/$toolchaindir"
ARM_EABI_TOOLCHAIN_PATH=":$gccprebuiltdir/$toolchaindir"
fi
Click to expand...
Click to collapse
EDIT: after some research, i found out that all the files in my bin folder are 32 bit executable files. So i believe i need a 64 bit toolchain. Do you know where I could find one?
EDIT2: I found that for linux they need to install "ia32-libs" to run 32bit executables source. But the thing is, I'm using a mac...
EDIT3: nevermind, i got it to work. thanks anyway
aokp build error
Can you point me in the right direction to fix this error http://pastebin.com/GZmteWUu.
Recon Freak said:
Can you point me in the right direction to fix this error http://pastebin.com/GZmteWUu.
Click to expand...
Click to collapse
http://forum.xda-developers.com/showpost.php?p=47947423&postcount=175
Try this....
CarbonDev
Coming soon...
.
Click to expand...
Click to collapse
Thanks for the guide so far. Is there an eta for Carbon roms as I'm struggling to get my to build. Or AOSP?
Haze, to change tool chains, you can also set TARGET_TOOLS_PREFIX ?= prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.8-linaro/bin/arm-linux-androideabi- in boardconfig (sub in the right path obviously).
Sent from my Optimus G using xda app-developers app
Hi, my name's Stefano I'm from Italy, and sorry for my poor english. This is the guide to build your own the KitKat (or whatever branch you want) for your International HOX+. We'll start, obviously, setting up your client (PC), and here we'll use ubuntu x64. Is possible to use almost any linux distribution (also MacOSX) but I prefer to stay on what is much supported and known (for me!). This guide is taken from internet and reading forums/blogs. I didn't invent anything, you can found a lot of guides like this. Just this is updated with last changes. For the setup part I read and paste a lot from here (thanks to sylentprofet).
Regard the hardware side you'll need at least of:
a Dual Core processor
4 Gb of RAM
80 Gb of hard disk for each repository (Better if SSD but don't required)
The Graphics Card don't care, we don't use to compile
A good internet connection, you have to download up to 40 Gb of stuff
A lot of patience, if you aren't go to download a ready ROM, it's better!
Time, time, time, time and again time!
How to Configure Ubuntu for Properly Compiling Android ROMs
This guide applies to Ubuntu 13.04 Raring Ringtail 64 bit (but also down to 12.04 LTS which is the version that I prefer). 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. During normal build you don't have absolutely need to use "sudo", just during the PC setup.
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. Sad cupcake.Let’s get rid of that. Copy and paste this into a Terminal window:
Code:
sudo apt-get purge openjdk-\* icedtea-\* icedtea6-\*
Back to the Terminal. Copypasta the following:
Code:
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.04 (or less). No more unrecognized Java version errors! Yay! And it’s self updating, so you don’t have to redownload binaries everytime they release a new version.
Next, we actually need to install the package. More copypasta:
Code:
sudo apt-get update && sudo apt-get install oracle-java6-installer
Follow the onscreen instructions. You have to Accept the Licensing Agreement or whatever. Hopefully no human centipede clauses. Once that is completed successfully, you will have to restart any open browsers with Java content for it to display correctly.
To make sure the correct version of Java is activated, run the following at the Terminal prompt:
Code:
java -version
You should see something like the following:
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.45-b01, mixed mode)
Ok, back to a fresh Terminal prompt. Time for installing the guts to build stuff in Ubuntu. Because (K)Ubuntu no longer carries ia32-libs-multiarch and ia32-libs (from Saucy onwards), it is necessary to install from precise repos:
Code:
sudo add-apt-repository "deb http://archive.ubuntu.com/ubuntu/ precise main restricted universe multiverse"
sudo apt-get update
sudo apt-get install ia32-libs-multiarch
once is installed, you can remove repository:
Code:
sudo add-apt-repository --remove "deb http://archive.ubuntu.com/ubuntu/ precise main restricted universe multiverse"
sudo apt-get update
Before start, install:
Code:
sudo apt-get install dpkg-dev
Code:
sudo apt-get install git-core gnupg flex bison gperf build-essential zip curl zlib1g-dev zlib1g-dev:i386 libc6-dev 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
And we wait. Don’t worry, this isn’t the crazy downloading part just yet.
When that is done, do this:
Code:
sudo ln -s /usr/lib/i386-linux-gnu/mesa/libGL.so.1 /usr/lib/i386-linux-gnu/libGL.so
Now it's time to download and setup SDK Tools. First of all download Android SDK Tools for Linux x64. Extract the folder “sdk”, inside package, into your "Downloads" folder and rename it to "AndroidSDK" e.g..
Then come to your terminal and type:
Code:
cd ~/Downloads/AndroidSDK/tools
and after:
Code:
./android sdk
You can now see the GUI that propose all installable packages. Install Platform tools and Tools for most recent Android (4.4), with the most higher API (19+) version. Flag "accept" and install.
Once is complete, you have you need the binary for repo that will let you talk to git servers and download all that precious source code:
Code:
mkdir ~/bin
curl https://dl-ssl.google.com/dl/googlesource/git-repo/repo > ~/bin/repo
curl http://commondatastorage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
chmod a+x ~/bin/repo
Open "~/.bashrc" to add a line:
Code:
sudo nano ~/.bashrc
At the very bottom, add the following line:
Code:
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. Type to restart bash:
Code:
source ~/.bashrc
Now you have all need to work (or play) with your ubuntu and it's time to give the sources (repositories) from your preferred Team (who share the source code for their rom). The most known host service for sources and projects is GitHub. E.g. https://github.com/CyanogenMod/
The point of start of any repo is its "manifest" (default.xml) where the team list all it's projects (here an example), only the necessary to the building process.
Until last year was necessary to compile (before begin and looking to platform manifest) an own local manifest where we exclude from download all the devices/kernel/vendor parts unnecessary for our device. This saves up to some Gigabytes of download.
Fortunately now the repositories will download itself the necessary devices/kernel/vendor parts when we'll choose ("lunch") the device to build ("make"). With the exception of AOKP who wanna know, before initialize your local repo, for which device/s you'd like build.
Unfortunately, for the HOX+, if not Cyanogenmod or any platform who support directly your enrc2b, is necessary to create a local manifest, to import the device/kernel/vendor parts need to build a rom for your enrc2b. This part will insert to the end and befor your "lunch".
A device merged into a ROM source and its frameworks has always:
A device part specifical for its own (typically located into /device/"vendor"/"devicename")
A possible device part specifical for its processor (typically located into /device/"vendor"/"processor class/name")
A kernel part specifical for its device (typically located into /kernel/"vendor"/"device name")
A vendor blobs part generical with inside all or part of vendor devices (typically located into /vendor/"vendor"/"device name")
The (1) if specifical for the rom (Carbon is slightly different from CM, from AOKP or Slim).
The (2) maybe the same for alls.
The (3) maybe the same for alls.
The (4) maybe the same for alls.
I saw "maybe the same" for (2), (3) and (4), because often the teams make choice on every part to optimize the use and functionality of its rom.
In the specific (for the HOX+) we give this four parts from CM (that fortunately supports enrc2b) to insert them into another platform. Because our device isn't supported.
The (1) part will be modified in a number of make files, the (2), (3) and (4) instead will be the same.
Now I'll write a section for each Team/ROM you want to initialize, that's for me has sense. How take a sense to put each "platform/project" in a different folder (e.g. CarbonDev in a folder and Cyanogenmod in another, both sons of your Home folder).
In the waiting to read next part, better familiarize a little with terms like "breakfast, brunch, lunch, make" into Android contest.
Building Cyanogenmod
In the terminal, now we'll make a folder where to store the Android source code. Typically will make it in your home folder, within a folder called like your projected ROM, to identify from other stuff, open your terminal and type:
Code:
mkdir –p ~/Cyanogenmod
cd ~/Cyanogenmod
Now we are going to initialize your local repository, with the "branch" cm-11.0 (KitKat), in your terminal:
Code:
repo init -u git://github.com/CyanogenMod/android.git -b cm-11.0
And now, the most long part of the story: you’re going to get the source. We have to download around 10-15 Gbytes. First of begin the process, you must to know that you can accelerate the process related to your processor and, obviously, to your internet band. You can choose the number of simultaneous processes to start. They depends from the "#" in the "-j" parameter. E.g. the option -j6 is related to a “normal” processor. If you have a performant processor and/or internet connection, try to increment putting –j10 or more. On terminal:
Code:
repo sync -j6
From time to time, check the situation on output, maybe occurs a pair of hours or a whole night. But when all will be done, you’re ready to build Android!
Once you finish your repo sync, you’ll ready to build. In your terminal, into your working folder type (pay attention at the initial “dot”):
Code:
. build/envsetup.sh
The commands are loaded, now you can build (tune your -j# parameter as you want):
Code:
breakfast enrc2b && make -j6 bacon
At the end of all, your fresh ROM to flash will be in Cyanogenmod/out/target/product/enrc2b. Happy flash!
Thanks @Lloir for supervision.
IMPORTANT: to flash a KK rom on enrc2b you'll need the Lloir's CWM recovery, available here.
Building AOKP
Reserved 2
Building Carbon
In the terminal, now we'll make a folder where to store the Android source code. Typically will make it in your home folder, within a folder called like your projected ROM, to identify from other stuff, open your terminal and type:
Code:
mkdir –p ~/CarbonDev
cd ~/CarbonDev
Now we are going to initialize your local repository, with the "branch" kk (KitKat), in your terminal:
Code:
repo init -u https://github.com/CarbonDev/android.git -b kk
After, using your file browser, go to your Home, CarbonDev (enable "show hidden files") folder and enter into ".repo" folder too. Create a new folder named "local_manifests" and create a new file named e.g. "MyRoomService.xml", edit it with GEdit (disable, into preference, "always make a backup copy...") and paste the follow content into:
<?xml version="1.0" encoding="UTF-8"?>
<manifest>
<remote name="github"
fetch="https://github.com/"
sync-j="4" />
<project name="STELIX/android_device_htc_enrc2b_CarbonDev" revision="kitkat" path="device/htc/enrc2b" remote="github" />
<project name="STELIX/android_device_htc_tegra3-common" revision="cm-11.0" path="device/htc/tegra3-common" remote="github" />
<project name="STELIX/android_kernel_htc_enrc2b_CM" revision="cm-11.0" path="kernel/htc/enrc2b" remote="github" />
<project name="TheMuppets/proprietary_vendor_htc" revision="cm-11.0" path="vendor/htc" remote="github" />
</manifest>
You have just create a local manifest, to add certain projects that this platform haven't yet. It git clone my sources, which are simply CM sources modified for the CarbonDev frameworks needs.
And now, the most long part of the story: you’re going to get the source. We have to download around 10-15 Gbytes. First of begin the process, you must to know that you can accelerate the process related to your processor and, obviously, to your internet band. You can choose the number of simultaneous processes to start. They depends from the "#" in the "-j" parameter. E.g. the option -j6 is related to a “normal” processor. If you have a performant processor and/or internet connection, try to increment putting –j10 or more. On terminal:
Code:
repo sync -j6
From time to time, check the situation on output, maybe occurs a pair of hours or a whole night. But when all will be done, you’re ready to build Android!
Once you finish your repo sync, you’ll ready to build. In your terminal, into your working folder type (pay attention at the initial “dot”):
Code:
. build/envsetup.sh
The commands are loaded, now you can lunch:
Code:
lunch
Choose the number corresponding to your "carbon_enrc2b-userdebug" (and press ENTER on your keyboard!)
When the prompt come back you're ready to "make carbon":
Code:
make carbon -j6
Tuning your -j# parameter as you want...
At the end of all, your fresh ROM to flash will be in CarbonDev/out/target/product/enrc2b. And Happy flash!
Thanks @Lloir for supervision.
IMPORTANT: to flash a KK rom on enrc2b you'll need the Lloir's CWM recovery, available here.
Reserved 4
Reserved 5
Reserved 6
I'm using mint 16. What should I do different?
Sent from my hammerhead
Cuzz1369 said:
I'm using mint 16. What should I do different?
Sent from my hammerhead
Click to expand...
Click to collapse
Usually is recommended Ubuntu or Mint... I think there is no difference. Make attention if during packages installation it report any error.
PippoX3 said:
Usually is recommended Ubuntu or Mint... I think there is no difference. Make attention if during packages installation it report any error.
Click to expand...
Click to collapse
Awesome. Maybe you could add a guide on how to cherry pick commits next?
It tells me I have java version 1.5.0
java version "1.5.0"
gij (GNU libgcj) version 4.8.1
Copyright (C) 2007 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Installed 1.6 and get this error
You are attempting to build with an unsupported JDK.
You use OpenJDK but only Sun/Oracle JDK is supported.
Please follow the machine setup instructions at
https://source.android.com/source/download.html
need some help here.
Edit: Figured it out, building now. Thanks
Cuzz1369 said:
It tells me I have java version 1.5.0
java version "1.5.0"
gij (GNU libgcj) version 4.8.1
Copyright (C) 2007 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Installed 1.6 and get this error
You are attempting to build with an unsupported JDK.
You use OpenJDK but only Sun/Oracle JDK is supported.
Please follow the machine setup instructions at
https://source.android.com/source/download.html
need some help here.
Edit: Figured it out, building now. Thanks
Click to expand...
Click to collapse
Good. Hope you remove your open java. The first terminal remove any not supported java. Follow the guide step after step.
The cherry-pick is so simple to apply. Will see after. Thanks.
you can use OJDK with ALL the sources.
it will just come up with that "warning" and then will carry on building perfectly fine
thanks for the guide
can i use knoppix/debian instead of ubuntu ??
MasalaMan said:
thanks for the guide
can i use knoppix/debian instead of ubuntu ??
Click to expand...
Click to collapse
Yes, I use Arch. The instructions for Debian are essentially the same as Ubuntu
Sent from my Nexus 5 using Tapatalk
Lloir said:
Yes, I use Arch. The instructions for Debian are essentially the same as Ubuntu
Sent from my Nexus 5 using Tapatalk
Click to expand...
Click to collapse
Thanks mate. I haven't all this experience on different distributions. If I have a little of time, today I will add another slice to the pie...
Thank you so much for this guide @PippoX3 I am about to have the most fun of my life now. Thanks again my friend
Sent from my Nexus 5 using XDA Premium 4 mobile app
skulldreamz said:
Thank you so much for this guide @PippoX3 I am about to have the most fun of my life now. Thanks again my friend
Sent from my Nexus 5 using XDA Premium 4 mobile app
Click to expand...
Click to collapse
You're welcome mate. To share should serve to make more people happy!
In this thread it say you need proprietary files from the device. I don't see that step on your guide. So which is the right way?
http://forum.xda-developers.com/showthread.php?t=2060017
COMPILE From Source For Any Phone On Linux Distros [BUILD ENVIRONMENT TO COMPILE]
Sent from my hammerhead
Github.com/themuppets/htc all the prop files are uploaded there
Sent from my Nexus 5 using Tapatalk
Hello Everyone....
Today I will present you all the ultimate guide for ROM development starting from Source to End.
This guide will be applicable to all devices.
So lets Start
What is Android?
Android is an open-source operating system developed by Google for smartphones, tablets, and other devices. It provides a user-friendly interface and supports a vast ecosystem of applications through the Google Play Store. With its Linux-based foundation, Android enables multitasking and offers extensive customization options for both manufacturers and users. Its integration with Google services enhances functionality and connectivity, making Android a popular choice for mobile devices worldwide.
Full Freedom for people using it
What is Android Source Code?
Android is an open-source software stack developed for a diverse range of devices with varying form factors. The primary objective of Android is to provide an open software platform that is accessible to carriers, original equipment manufacturers (OEMs), and developers, enabling them to bring their innovative ideas to life. The goal is to create a successful, real-world product that enhances the mobile experience for users. One of the notable features of Android is that it offers a complete, production-quality consumer product with source code that is openly available for customization and porting.
Android allows for extensive customization and enables developers to create new functionalities and experiences without significant restrictions. This openness fosters creativity and empowers developers to tailor Android to suit their specific needs. It also encourages collaboration within the Android community, where developers can share their enhancements, contribute to the platform's evolution, and address any issues or bugs.
So basically Android Allows to customize the things you like and make new things without any Restrictions. Cool isn’t it?
What is Android ROM ? An Android ROM refers to a customized version of the Android operating system that is installed on a device. ROM stands for "Read-Only Memory," which originally referred to firmware stored in a device's memory. However, in the context of Android, a ROM typically refers to the software package that includes the operating system, user interface, and other components specific to a particular device or a modified version of Android.
While it is true that an Android ROM includes the user interface (UI) and the file system for maintaining contacts and other data, it is not limited to those aspects. The Android ROM is built upon a Linux kernel, which serves as the foundation for the operating system. Additionally, the ROM includes various system-level components, libraries, and apps that provide specific functionalities and features.
ROMs can be developed by device manufacturers (such as HTC, Samsung, or LG) to provide a customized user experience on their devices. They often come with a unique user interface overlay, such as HTC's Sense UI or Samsung's One UI, which can offer additional features and visual enhancements.
Moreover, ROMs can also be developed by third-party developers or communities, known as custom ROMs. Custom ROMs are modified versions of Android created by independent developers or enthusiast communities. These ROMs are typically designed to offer additional features, customization options, improved performance, or compatibility with older devices that may no longer receive official updates.
What does a Android Rom Contain ? Basically a Android Rom Contains following main things:
Kernel: The kernel is the core of the operating system that manages system resources and facilitates communication between hardware and software.
Bootloader: The bootloader is responsible for initializing the device's hardware and loading the operating system into memory during the boot process.
Recovery: The recovery is a separate bootable partition on the device that allows for system maintenance, installation of updates, and performing backups or restores.
Radio: The radio refers to the software responsible for managing the device's wireless communication, including cellular connectivity.
Framework: The framework consists of a set of libraries and APIs that provide the foundation for application development and interaction with the device's hardware and services.
Apps: Android ROMs typically include pre-installed applications, such as system apps (e.g., dialer, messaging) and other core apps (e.g., calendar, browser), which may vary depending on the ROM.
Core: The core components of the Android operating system, including system services, libraries, and essential system processes.
Android Runtime: The Android Runtime (ART) is the runtime environment responsible for executing Android applications. It converts apps from bytecode into machine code for efficient execution.
Some Basics About Above Terms
Kernel
The Android kernel is a key component of the Android operating system, serving as the core of the software.
It is based on the Linux kernel but includes modifications and additions specific to the Android platform.
The kernel provides essential functionalities, such as hardware abstraction, process management, and memory management.
It controls the device's hardware resources, including the CPU, memory, storage, and input/output devices.
The kernel manages drivers that enable communication between the operating system and hardware components.
It facilitates power management, optimizing resource usage to maximize battery life.
The kernel handles security mechanisms, such as process isolation and permissions, to protect against unauthorized access.
It enables multitasking by scheduling and prioritizing tasks, allowing multiple applications to run simultaneously.
The kernel supports various file systems, networking protocols, and device drivers to ensure compatibility with different hardware configurations.
Kernel updates are released periodically to improve performance, fix bugs, and address security vulnerabilities.
Bootloader
The Android bootloader is a critical component that starts the boot process on an Android device.
It verifies the integrity and authenticity of the software before loading it.
The bootloader is responsible for loading the operating system kernel.
It initializes essential hardware components, such as the CPU, memory, and display.
The bootloader acts as a security checkpoint, preventing unauthorized modifications to the device's software.
It ensures the device boots into a trusted and secure state, protecting against malware and unauthorized access.
The bootloader provides a means to unlock the device for advanced customization and firmware modifications.
Bootloader unlocking allows for installing custom ROMs, kernels, and recovery images.
Some devices have locked bootloaders by default to maintain system integrity and prevent unauthorized modifications.
Recovery
Android Recovery is a built-in feature that provides a separate environment for system maintenance and troubleshooting.
It is accessed by booting into recovery mode, usually through a combination of hardware buttons during device startup.
The recovery mode allows users to perform various tasks, such as applying software updates and factory resetting the device.
It provides a limited but essential set of functions to recover or repair a malfunctioning Android system.
In recovery mode, users can clear cache partitions to resolve performance issues caused by cached data.
It enables users to flash custom ROMs, official firmware updates, and other system modifications.
Recovery mode allows for making and restoring system backups, protecting user data and settings.
It provides a command-line interface (ADB) for advanced troubleshooting and system-level operations.
Recovery mode is separate from the main Android system, ensuring stability even if the main OS encounters problems.
These are main parts of Android Operating System.
Now that we know what Android is and what it contains, let's move on to the next major step, which is Android ROM development from source. However, before starting this process, we need to set up some initial setup and development environment.
Android Rom Development
Setting Up Linux Enviroment
Pre – Requirements for Android Rom Development
1) Linux Operating System (I will use Ubuntu 13.10 as an example and recommend it to all)
2) Java Development Kit (JDK)
3) Various Tools
Once you have downloaded Ubuntu 13.10, you can install it in two ways:
1) Installing it as the primary operating system
2) Installing it inside Windows using a virtual machine (VM) or virtualization software like VirtualBox (free) or VM Workstation/Player (paid)
3) Dual-booting Linux alongside Windows by creating separate partitions
In this guide, I will explain how to install Linux inside Windows using VirtualBox as an example.
How to Install Ubuntu in VirtualBox
1. Download and install Oracle VM VirtualBox on your computer.
2. Download the Ubuntu ISO file from the official Ubuntu website or the specific version you want to install.
3. Open VirtualBox and click on New to create a new virtual machine.
{
"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"
}
4. Enter a name for your virtual machine, select Linux as the type, and choose the version that matches your Ubuntu ISO.
5. Set the desired amount of RAM for the virtual machine. It's recommended to allocate at least 2GB or more.
6. Create a virtual hard drive by selecting Create a virtual hard disk now. Choose the VDI (VirtualBox Disk Image) option and click Next.
- Select Dynamically allocated and leave the Split into files option unchecked.
- Specify the amount of HDD space you want to allocate and choose the location for the virtual hard drive (VMDK).
7. Go to Settings -> System -> Processor and set the desired number of cores for the Guest OS. In this example, we allocate 2 cores.
8. Now, go to Settings -> System -> Acceleration and make sure both options are selected.
9. Next, go to Settings -> Storage -> Controller: IDE and click on the small CD with the plus icon.
- Navigate to the location where you saved the Ubuntu ISO file and select it.
- Click OK to save the changes.
10. You can now start the virtual machine by clicking Start.
11. The Ubuntu installation process will begin, and you can follow the on-screen instructions to complete the installation.
12. Once the installation is finished, you'll have Ubuntu running in VirtualBox.
That's it! You have successfully installed Ubuntu in VirtualBox.
Hurrrray your Linux System is Ready!
Setting Up Build Enviroment For Compiling ROM's
Installation of Necessary Tools and packages for ROM Development
1)Installing Java Development Kit (JDK)
For Kitkat
Installation of Java V6
Open The Terminal and Paste following Command
a) This will Remove the wrong Java JDK from Ubuntu 13.10
Code:
[COLOR=#000000]sudo apt-get purge openjdk-\* icedtea-\* icedtea6[COLOR=#007700][COLOR=black]-\*[/COLOR] [/COLOR][/COLOR]
b) Enter the Following Command and This will Install JDK
Code:
wget https://launchpad.net/~webupd8team/+archive/ubuntu/java/+files/oracle-java6-installer_6u45-0%7Ewebupd8%7E8_all.deb sudo dpkg -i oracle-java6-installer_6u45-0~webupd8~8_all.deb wget https://launchpad.net/~webupd8team/+archive/ubuntu/java/+files/oracle-java6-set-default_6u45-0%7Ewebupd8%7E8_all.deb sudo dpkg -i oracle-java6-set-default_6u45-0~webupd8~8_all.deb
c) Check The Java Version Installed
Code:
[COLOR=#000000]java -[COLOR=#0000BB][COLOR=black]version [/COLOR] [/COLOR][/COLOR]
For Lollipop Required Java Version is 7
To Install Java V7
Code:
sudo apt-get update && sudo apt-get install openjdk-7-jdk
Java Installation Completes
2)Installation Of Required Tools
Enter The Following Command
Code:
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
Note : If you get error like broken dependencies then use the following command and then use above command.
Code:
sudo apt-get update
Code:
sudo apt-get upgrade
After Installation Completes Enter The Following Command
Code:
sudo ln -s /usr/lib/i386-linux-gnu/mesa/libGL.so.1 /usr/lib/i386-linux-gnu/libGL.so
So The Above Are The Packages
Now comes the binary called Repo.
What Is 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.
Enter The Following Command
Code:
mkdir ~/bin && curl http://commondatastorage.googleapis.com/git-repo-downloads/repo > ~/bin/repo && chmod a+x ~/bin/repo
Using Text Editor Open ~/.bashrc for that use following command
Code:
sudo nano ~/.bashrc
At The Very Bottom Line Add following Line
Code:
export PATH=~/bin:$PATH
Save it. Here To save Press Ctrl+O and Enter and Ctrl+X to exit
Now Enter Following Command
Code:
source ~/.bashrc
Now Your System Is Ready For ROM Building
Downloading Sources
To build a Rom from Source first we need to download the sources from git.
Note : Sources will be very huge approx 13GB to 14GB hence lot of patience is required since it will take some time depending on your Internet connection speed.
So lets start..
Here i will take the example of cm11.
The steps goes has follows
1) Create a directory were your sources will be downloaded. Enter the following command to terminal to create a directory
Code:
mkdir cm11
Now in your Home directory you will see folder called cm11.
2) The next step is you have to Initiate the repo. meaning of the repo is given above. It will communicate with the git and download the source were it is stored.
Enter The Following Command to Terminal
Code:
cd cm11
This will take you to the directory you created in Step 1.
Now Enter The Following Command Which Will Initiate The Repo :laugh:
Code:
[FONT=Arial][SIZE=4]repo init -u git://github.com/CyanogenMod/android.git -b cm-11.0[/SIZE][/FONT]
Since i m taking example of cm11 above repo initiate command is used you can find this here for CM11
Note : All the details for Repo Initiate and Building will be given in respective Source Github. Various Github source links will be given in discription and the end.
This will initialize your local repository using the CyanogenMod trees.
now got to cm11 folder and press Ctrl+H this will show the hidden folder .repo were sources will be downloaded.
Now it might give a small error at the end stating for Email id.
So just create a github account here
Then Run following in Terminal
Code:
[FONT=Arial][SIZE=4]git config --global user.email "[email protected]"
git config --global user.name "Your Name"[/SIZE][/FONT]
replace "[email protected]" with your github email Id
replace "Your Name" with github Username
3) Now To control the files that should be downloaded while sync and for adding device tree we use local_manifest.xml. Reagrding this @Kishan14 will explain in detail with Tips and Tricks.
4) Now it is the time to download the sources. for that run the following Command
Code:
repo sync -j#
# is number of jobs you want to give for your downloading source. I use 2 to 4.
Now it will download the Sources needed to build the Rom..Download will be huge 13GB to 14GB so be patient since it depends on your Internet Speed.
The Above was for CM11 same procedure for other provided you have to replace cm11 with one you want to sync/build like AOSP,AOKP,AICP etc and Repo Initialize command varies with the source you want to download.
Some Git Links :
CM11 : https://github.com/CyanogenMod/android
AOKP : https://github.com/AOKP/platform_manifest
Carbon Rom : https://github.com/CarbonDev/android
SlimRom : https://github.com/SlimRoms/platform_manifest
Building Rom For A Particular Device
Building Rom For A Particular Device
Now has we have downloaded the sources we need for our Rom Build Lets Move to the Next Step which is Actually Major Step the Building The ROM
So Lets Start The Game...:laugh:
Note : I will be taking Samsung Galaxy Grand Duos - GT -I9082 has Example here.
Example Rom : CM11
Now before starting with Building guide you have to Download your Device Identity That is has follows
1) Device Tree
2) Vendor
3) Kernel
The Above files are very Vital Parameters of building they specify your device and its Characteristics.
Now you might think from where you have to download those files?
Don't be confused its simple Search in our device forum for CM Tree and Kernel and Vendor. The Dev of CM for your Device forum will specify it in his ROM thread.
Once you obtain the github for your Device Tree, Vendor and Kernel. Enter following command
Code:
cd cm11/.repo
Here in .repo folder you have to create file called local_manifests.xml
1) Enter The Following Command in Terminal
Code:
nano local_manifest.xml
Structure of Local_manifest.xml is Has follows.
Code:
[COLOR=#000000][COLOR=#0000BB]<?xml version[/COLOR][COLOR=#007700]=[/COLOR][COLOR=#DD0000]"1.0" [/COLOR][COLOR=#0000BB]encoding[/COLOR][COLOR=#007700]=[/COLOR][COLOR=#DD0000]"UTF-8"[/COLOR][COLOR=#0000BB]?>
[/COLOR]<manifest>
[/COLOR]<project path=" directory in work tree" name="name of the repository in remote" remote="name of remote defined earlier" revision="branch of the repository" />
[COLOR=#000000]</manifest>[/COLOR]
2) Add your Device , Kernel , Vendor Source
Taking my Ex here of GT-I9082
After Adding device tree , Vendor , kernel my Local_manifest.xml will look like has follows
Code:
[COLOR=#000000][COLOR=#0000BB]<?xml version[/COLOR][COLOR=#007700]=[/COLOR][COLOR=#DD0000]"1.0" [/COLOR][COLOR=#0000BB]encoding[/COLOR][COLOR=#007700]=[/COLOR][COLOR=#DD0000]"UTF-8"[/COLOR][COLOR=#0000BB]?>
[/COLOR]<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>[/COLOR]
3) Press ctrl+O and Enter
4) Press Ctrl+X to exit.
After Adding Device Tree,Vendor,Kernel sources just repo sync again so that the files are downloaded. you can also add which files you want to download or you dont want to download. More about manifest and local_manifest will be explained by @Kishan14 in his guide
Once that is done now you have your device Identity with you:laugh::laugh::highfive:
Now follow the Instruction Given by @rutvikrvr in POST 9 to make the your CM Device Tree Compatible with your ROM Source.
Once your CM Device tree is successfully made compatible with your ROM its Time for Building
Now Building Command Various with Rom which you want to compile its different for different ROM you have to see the Manifest of The Rom for it has instruction for building will be given there. Since i m Taking example of CM11 and Device has GT-I9082 the steps goes has follows
1) Enter the Following command in Terminal
Code:
cd cm11
Just Replace CM11 by your working directory of Rom . Ex : AOGP,AICP etc
2)Now enter following Command To Terminal
Code:
[COLOR=#000000][COLOR=#007700]. [/COLOR][COLOR=#0000BB]build[/COLOR][COLOR=#007700]/[/COLOR][COLOR=#0000BB]envsetup[/COLOR][COLOR=#007700].[/COLOR][COLOR=#0000BB]sh[/COLOR][/COLOR]
3) Build Instruction Varies from Rom to Rom so check manifest of ROM for the Same. General instuction is
Code:
[COLOR=#262626]time brunch <codename>[/COLOR] [COLOR=#000000][COLOR=#007700]-[/COLOR][COLOR=#0000BB]j[/COLOR][COLOR=#FF8000]#[/COLOR][/COLOR]
<Codename> CodeName of your Device
# is the No of CPU cores you have.
Building will take time depending on your system configuration.
Once building is Done.
Its Time to apply patches which will be given in our CM Rom thread if any.
Follow the guide by @rutvikrvr in Post 10 for applying patches.
Once Done rebuild again using command above (This time building will be fast)
Now go to your working directory and go to OUT/target/your device/ you will get the Zip of the Rom.
Always make a backup of your current Rom.
Flash it via recovery and check.:laugh::laugh:
Hurrrrrray You Just Developed A Rom from Source
Uploading Device Tree To Github
So Guys till now we learnt lot of stuffs and finally we build a Rom :highfive: During building the Rom we may have edited lot of stuffs in device tree To avoid those being repeated in case you delete the Tree or If your ROM is Unofficial then you have to upload the Device Source Tree to Github. There are lot of uses if you upload the device tree.
Lets Start with guide Now
1) Create a account in Github.
2) Generate a new SSH key
Enter Following command to Terminal
Code:
ssh-keygen -t rsa -C "[email protected]"
"[email protected]" = your github Email ID
After pressing Enter you will Observe the following output
Code:
# Creates a new ssh key, using the provided email as a label
# Generating public/private rsa key pair.
# Enter file in which to save the key (/home/you/.ssh/id_rsa):
Press Enter.
Now you need to enter the passphrase
Code:
# Enter passphrase (empty for no passphrase): [Type a passphrase] # Enter same passphrase again: [Type passphrase again]
Once all done you will see the following in your Terminal.
Code:
Your identification has been saved in /home/you/.ssh/id_rsa.
# Your public key has been saved in /home/you/.ssh/id_rsa.pub.
# The key fingerprint is:
# 01:0f:f4:3b:ca:85:d6:17:a1:7d:f0:68:9d:f0:a2:db [email protected]
Now go to ~/.ssh folder and copy your id_rsa.pub content into account administration on github.com.
That is go to github account settings and SSH
copy paste id_rsa.pub content there and save it done.
Now Its Time To Check If Everything Works.:highfive:
Enter The Following Command To Terminal
Code:
ssh -T [email protected]
It should display has follows
Code:
The authenticity of host 'github.com (207.97.227.239)' can't be established.
# RSA key fingerprint is 16:27:ac:a5:76:28:2d:36:63:1b:56:4d:eb:df:a6:48.
# Are you sure you want to continue connecting (yes/no)?
type yes and press enter
Code:
Hi username! You've successfully authenticated, but GitHub does not
# provide shell access.
Now All Done Its Time To Upload The Device Tree To Github
Example Device and Rom : GT-I9082 and AOGP Rom.
In the following steps i take my example device and Rom just replace the device with your device and Rom with your Rom
Steps :
In Terminal
Code:
cd aogp/device/samsung/i9082
Then Type Following
Code:
git init
Setting up of the git files required to push the files to the github account will be done by following command
Code:
git add .
Now we need to comment on the files we are pushing to github hence enter following command
Code:
git commit -m "first commit"
Now Go to your Github account click on add button on top next to your username and Select New repository
enter the Name of your repository in my case you can see the ScreenShot below
now you can see some commands displayed enter the git link displayed in your repository created the terminal in my case
Code:
git remote add origin https://github.com/username/aogp_device_samsung_i9082.git
Last Step is To Push The Source to Github. Enter The Following Command in Terminal
Code:
git push origin master
The Passphrase is the same you entered while creating SSH key.
Finally your source is in Github now add Readme.md File and mention This is <ROM NAME> Device Tree For <Your Device>
You Have Successfully Uploaded your Device Tree To Github
Credits
@rutvikrvr
@Kishan14
@k2wl (My Mentor and Inspiration for Android)
If You want to learn more about Github and Stuffs you can visit Following Guide by XDA Senior Moderator @eagleeyetom (Thanks a lot Sir)
Guide Link : http://forum.xda-developers.com/showthread.php?t=1877040
Frequently Asked Questions (F.A.Q)
Following are some frequently asked Questions
1) Can I Use Different Linux OS like Linux Mint , Arch linux , Ubuntu 14.04 etc ?
Yes. you are free to use any Linux System but remember some commands may not work in other Linux System or can result in error hence i cant give support to it. If it was successful to you in Other Linux OS kindly let me know
2) Where is the next part of the Guide?
This Thread Is Still Work In Progress (WIP) hence we are working on it and will be added once done
3) I got a error for Task X and solved it. Can i share here?
Yes you can share it with solution (If u have)
4) I Got a Error Where Should I Post ?
You can copy paste the error from terminal to here using Tag or You can Pastebin it. Whichever you are Comfortable with
5) Can I Use 32Bit Linux for Android Development ?
No You need 64bit Linux System For Android Development
6) Can I use X Device Tree for Y Device (Cloned Etc) ?
No You Should use your Device Specific Tree not other Device Tree even if they are similar Device/Kernel/Vendor Tree are Specific For Each Devices. So if you dont have it then Either you make your own Tree or wait for developers to do that
7) Are Device Specific Sources Android Version Specific ??
Yes Device Specific Sources are Version Specific but modification in Source may be little or huge depending on Android Upgrade Feature/Security Enhancement etc etc ...
8) Getting Java Error While Compiling What to do ?
Its due to Wrong Java for Compiling you need right Version of Java Installed for
Kitkat : Java v1.6
Lollipop : Java v1.7
Some Errors and Their Solution
Set-1 (Thanks @Nikhil)
1) gr_text
the line "note : previous declaration of 'gr_text' was here" says that minui.h has declaration of gr_text which is different from definition of gr_text function.
Solution : check minui.h, 36th line (as intimated in Screenshot) and compare declaration of gr_text with the definition of gr_text in file recovery/graphics.c in device tree. they should be same.
2) hardware ril
this generally happens when hardware/samsung is missing some files.
Solution : enter this in terminal
cd hardware && git clone https://github.com/SlimRoms/hardware_samsung.git -b kk4.4 && mv hardware_samsung samsung
you can use Rom specific github link, SlimRoms is an example.
3) hwc_blit
"'HWC_BLIT' was not declared in this scope". HWC_BLIT is a variable with value 4 and it is required to be declared
Solution : there is a file include/hardware/hwcomposer_defs.h in device tree, you can initialize HWC_BLIT as 4.
4) java version
From Froyo to Kitkat, version of java required is 1.6
From Android L, version of jave required will be 1.7
Screenshot has version 1.8 hence the error.
Solution : Install Java 1.6
//Install JDK6
//Download bin file from http://ghaffarian.net/downloads/Java/JDK/
//To remove existing java package
sudo apt-get purge openjdk-\* icedtea-\* icedtea6-\*
//install java JDK6 (download and keep .bin file in root directory.)
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
//add JDK path to .bashrc
gksudo gedit ~/.bashrc
//add following lines to .bashrc
# Java PATHs
export JAVA_HOME=/opt/java/64/jdk1.6.0_45
export PATH=$PATH:$JAVA_HOME/bin
//install jre
sudo apt-get install openjdk-6-jre-headless
Set-2 ([email protected]JJsevol)
# Errors you might see when you run the build command.
# Error 1: build/envsetup.sh: line 1365: schedtool: command not found
SOLUTION: sudo apt-get install schedtool and rerun build command.
# Error 2: /bin/bash: prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.7/bin/arm-linux-androideabi-gcc: cannot execute binary file
/bin/bash: prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.7/bin/arm-linux-androideabi-gcc: cannot execute binary file
SOLUTION: You're most likely not running a 64-bit linux version. To make sure, type uname -m
If you see i686, you have a 32-bit version. If you see x86_64, you have a 64-bit version. If you have 32-bit start over with a amd64 version http://releases.ubuntu.com/13.10/
# Error 3: If you see a 127 bison error
SOLUTION: sudo apt-get install bison build-essential curl flex git gnupg gperf libesd0-dev libncurses5-dev libsdl1.2-dev libwxgtk2.8-dev libxml2 libxml2-utils lzop openjdk-6-jdk openjdk-6-jre phablet-tools pngcrush schedtool squashfs-tools xsltproc zip zlib1g-dev
In addition to the above, do
sudo apt-get install g++-multilib gcc-multilib lib32ncurses5-dev lib32readline-gplv2-dev lib32z1-dev
Contributors To The Guide
@jackeagle
@Kishan14
@rutvikrvr
@k2wl
@Trach
Credits :
@k2wl (Thanks A Lot)
XDA Developers
Repo and Manifests
Hello guys..
There are many upcoming developers and many dev on xda.Till now you all have learned how to setup build enviroment and packages required and build process. Now here I will be sharing few tips and tricks that will help some new developer for developing their ROMs and Kernels. Well, I am not pro in all these stuff even I am a newbie. I have came across many guides and my best friend Google.
These tips may save your Time, Internet Bandwidth, HDD space etc..
Requirements:
Basic Knowledge of compiling ROM/kernel
Ok so here I Start:
Repository (Repo)
What is 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. Repo is not meant to replace Git, only to make it easier to work with Git in the context of Android. The repo command is an executable Python script that you can put anywhere in your path. In working with the Android source files, you will use Repo for across-network operations. For example, with a single Repo command you can download files from multiple repositories into your local working directory
Was that a bit tough definition.. no worries ... here's Screenshots explaining roughly.
The image shown above is repositories (Platform_mainfest,C-Rom Device tree, android etc.)
In Simple words you can say 'repo is a folder that stores code'. In the above image, the two repo's are highlighted. the black highlighted repo is the one which one have written or contributed. The other (red) one shows that the repo is forked from someone else repo.
Repo Tool:
This tool plays a vey important role in downloading rom source.. So the word ‘Repo’ is common with you guys as u do ‘repo init’ ‘repo sync’ ..
Remember,From the above guide, while setting up you Linux you entered a command
Code:
mkdir ~/bin && curl [URL]http://commondatastorage.googleapis.com/git-repo-downloads/repo[/URL] > ~/bin/repo && chmod a+x ~/bin/repo
In simple language This Step was to download and install the Repo tool..
Why This Tool is used?
The Repo Tool helps you to download the bunch of repositories by entering just a single command, which helps us to make our downloading part easier.To download the source following command is used:
Code:
repo sync -j#
# - number of jobs you want to give for your downloading source.
Now A question may arise that What does Repo Tool actually do??
Umm, Let me explain with an example, Let's take the above example. The repo tool takes all the reference for the code to be downloaded from a Manifest.xml. Suppose you wanna download cm source. So as mentioned above, you have to give 'repo init' command. after this command '.repo' folder is created. you ll find 'manifest.xml' file in '.repo' folder. Now when you open Manifest.xml file you'll find some path of files and folders. The command 'repo sync' downloads the folders and files that is mentioned in manifest.xml to the specific location mentioned.
Now, the '-j#' tag represents the number of jobs you allow your pc to download the source. For Normal internet speed it is recommended to use -j2 or -j4. For faster connection -j16 or -j32 is recommended.
The Manifest
The manifest.xml is a file which is written in xml markup and directs the repo tool to the repositories and their respective branches that need to be downloaded. This manifest is located under the head of the android source tree in the .repo/manifests/ directory. The manifest is formatted in XML markup and contains information regarding which git repositories to use, where they are located on the internet, where to put them in the source code directory, and what branches of the git repositories are used. Some of these repositories are pulled, unmodified from AOSP, but most come from CyanogenMod on GitHub. We can take repositories from different git servers, use different branches for each one of them, gather them into groups for easy management and more. Here’s an example for a manifest xml file:
Code:
<manifest>
<remote name="aosp"
fetch="https://android.googlesource.com/"/>
<remote name="aogp"
fetch="https://github.com/aogp/"/>
<default revision="master"
remote="aosp"
sync-j="4" />
<project path="art" name="platform/art" />
<project path="bionic" name="platform/bionic" groups="pdk" />
<project path="dalvik" name="platform_dalvik” remote=“aogp”/>
<project path="frameworks/base" name="platform_frameworks_base" remote=“ aogp" revision=“statusbar_fixes"/>
<project path="tools/adt/eclipse" name="platform/tools/adt/eclipse" groups="notdefault,tools" />
</manifest>
Let’s review its structure and see why it is used :laugh:
<remote>
The remote tag is describing the remote git servers we support pulling repositories from. In this case, we have a remote named aosp, linking to the Google’s AOSP git server, and another one named AOGP, linking to a Github account of the user “AOGP”.
<project>
Defines a single repository. These are the main attributes:
path – Where the repository will be checked out into, relative to the current working directory.
name – The name of the project on our git server
remote – The name of the remote server where the repository can be found.
revision – The branch/tag name we want to checkout.
group – The group name(s) for this project. We can declare a set of projects as members of a group, then sync only them. Omitting this attribute makes the project a member of the “default” group.
<default>
Now like the remote is specified , you can base you're manifest at a particular remote and define it as your default remote. it defines a default values for attributes we are using, when syncing the system. In this case, we set the default branch to checkout each project on its “master” branch and the default remote as “aosp”. If we omit those attributes when defining a project, the defaults defined here will be used. Other interesting attributes:
sync-j
The value for this will be the number of jobs to use when syncing the system. Parallelization helps get the job done quicker, but could also get the computer or the network stuck. Using 4 threads is what commonly used for syncing.
sync-c
syncing only the current branch/tag from git. This will checkout for each project only the current branch/tag that we specify for it, and not any other branches that exists on the repository. This will help save some space and bandwidth (and also time), but if you’ll need to switch between branches on a specific project later on – you’ll need to fetch it manually.
Local_Manifest :
If you wanted to change the manifest.xml list, you could edit default.xml directly. However, this would make your local copy of the manifest conflict with the official version on github. This could create issues when the official manifest is updated, as it would clash with your changes.
SO NEVER THINK OF EDITING DEFAULT.XML:silly:
Now The Question Arises how we can control the sync?
This is where local manifests come into play.
Creating a local manifest allows you to customize the list of repositories used in your copy of the source code by overriding or supplementing the default manifest. In this way, you can add, remove, or replace source code in the official manifest with your own. By including repositories (which need not even reside on GitHub) in a local manifest, you can continue to synchronize with the repo sync command just as you would have previously. Only now, both the official repositories from the default manifest and the additional repositories you specify will be checked for updates.
Hence Local_manifest.xml is BOON to Developers:highfive:
Uses of Local_manifest.xml
1) Adding and removing repositories
To add to the contents of the default manifest, create a file called local_manifests.xml under the .repo directory, this can also be created via terminal by using following steps:
A) open terminal (Ctrl+Alt+T) and type the following command and hit Enter.
Code:
cd path_of_ur_folder/.repo
B) Type following command
Code:
nano local_manifest.xml
Now type the content you wanna add to local_manifest.xml. After completing press "ctrl+O" and then hit enter to save it. to exit nano editor press "ctrl+X"
Simple Isn't it?:laugh:
Let's start with an Example which we can use to describe the scenario:
Code:
<?xml version="1.0" encoding="UTF-8"?>
<manifest>
<remote name="github" fetch="git://www.github.com/" />
<remove-project name="CyanogenMod/android_hardware_qcom_fm" />
<project path="hardware/qcom/fm" name="aogp/hardware/qcom/fm" remote="github" revision="cm-11.0"/>
</manifest>
Meaning of Above Terms
1) <?xml version="1.0" encoding="UTF-8"?>
It is a standard XML declaration, telling interpreters this is an Extensible Markup Language file. Once this is established, the <manifest> and </manifest> tags enclose some contents which the repo command will recognize.
2) <remote name="github" fetch="git://www.github.com/" />
First, a remote for git is declared and given the name "github". In git, a remote essentially refers to a place and method for accessing a git repository. In this case, www.github.com contains special up-to-date repositories for fm qcom hardware from "AOGP" platform. This is equivalent to the following git command:
git remote add github git://www.github.com/
3) <remove-project name="CyanogenMod/android_hardware_qcom_fm" />
This line removes a project (specifically, cyanogenmod/android_hardware_qcom_fm) declared in the default manifest. After running repo sync, it will no longer be available in the source tree.
4) <project path="hardware/qcom/fm" name="aogp/hardware/qcom/fm" remote="github" revision="cm-11.0"/>
This line defines a new project. In this case, it replaces the removed project android_hardware_qcom/fm with one from other, using the remote that was defined above.
When adding a new project that replaces an existing project, you should always remove that project before defining the replacement.
You can simply add a new project to the source code, such as when you want to add your own app to the build.
Note that when adding new projects, there are at least three parts defined:
• remote -- the name of the remote. this can be one that was defined in either the default manifest or local_manifest.xml.
• name -- the name of the git project-- for github it has the format account_name/project_name.
• path -- where the git repository should go in your local copy of the source code.
• revision -- (optional) which branch or tag to use in the repository. If this attribute is omitted, repo sync will use the revision specified by the <default ... /> tag in the default manifest.
After creating .repo/local_manifests.xml, you should be able to repo sync and the source code will be updated accordingly
This was all about Repo and Manifest
Now i'm gonna give you some tips that will help you a more better way in developing.!!!
TIPS AND TRICKS
Tip#1 Syncing a full new source tree in minutes!
Suppose you wanna compile multiple roms for device. For example, you may want to have an AOGP source tree as well as a CM tree.
Obvisouly, you could repeat the same steps, to repo init and then repo sync -j8 for both. But that would be twice as time consuming. isn't it?
No issues, there is a simple trick to download the source within few minutes(depending on your internet speed). Lets say that you have already initialized and synced a CM source tree, in ~/roms/cm11.
Now, we will prepare a new repo for AOGP tree, in ~/roms/aogp. Here comes the trick: We will use the --reference flag of repo init to indicate to repo that we already have a local repository that it can take information from, instead of downloading everything from Internet again:
So Lets say u wanna begin with AOGP, So here's the steps you got to follow :
Code:
mkdir roms/aogp &&cd roms/aogp
Code:
repo init --reference=~/roms/cm11 -u git://github.com/AOGP/android.git -b cm-11.0
You should notice a big time difference, from hours for a full repo sync, down to minutes using this trick!
Did u understood what it exactly did? NO!
here's simple words explaining about reference flags. In this tip (reference flag) the repo tool does it checks the locally downloaded source and skips downloading that it Symlinks the code from the existing source to the new source.
Tip#2 Using CCACHE a.k.a Compiler's Cache tool
CCACHE also known as a compiler cache tool, which caches the output of the compiler, to save time when compiling a file which has not been changed since the last compile. It is really a best companion of rom developers
To enable CCACHE,
use your favorite editor.. I ll be using nano editor
1) Open a terminal ( cntrl + alt + t ) and type
Code:
nano .bashrc
2) Add the following code :
Code:
export USE_CCACHE=1
After you log out and back in again, this change will take effect.
By default, the Android build process creates a subfolder named “out” within the root of your source tree. While for most users this is best, in some situations it can be advantageous to move the output directory to another file system. If, for example, you have a striped RAID array, it is beneficial to store the output directory on this array. All of the files within the out directory can be re-generated in the event of filesystem problems (if the sources were held on another filesystem).
To change the output directory to another filesystem, use the command
Code:
export OUT_DIR_COMMON_BASE= /<path_of_your_choice>/.ccache
Code:
prebuilts/misc/linux-x86/ccache/ccache -M 50G
The suggested cache size is 50-100G.
On OSX, you should replace linux-x86 with darwin-x86
The above defined output directory will created a new folder, named after your current source tree directory. For instance, if you have source trees as /source/tree1 and /source/tree2 and OUT_DIR_COMMON_BASE is set to /output, then output directories will be/output/tree1 and /output/tree2.
It is therefore important to ensure you do not have multiple sources stored in directories with the same name, as they would end up sharing an output directory, with unpredictable results.
Tip#3 Playing with local_manifest.xml
In many Manifest.xml you ll find many stuff not needed by our device. Also there are files needed and that is not present in the default.xml.
* Adding Projects to local_manifest.xml
So, to add projects to your local_manifest.xml for your device refer the following format that explains the same.
Code:
<?xml version="1.0" encoding="UTF-8"?>
<manifest>
<project path=" directory in work tree" name="name of the repository in remote" remote="name of remote defined earlier" revision="branch of the repository" />
</manifest>
Still have some doubts?? the following example will clear it..
Suppose i wanna add device tree, kernel and vendor for my device which is needed in Building ROM Guide Above i ll follow the above format and will make a new one for my device.
Device Example Used Here : Samsung Galaxy Grand Duos GT-I9082
Code:
<?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>
This will download your device Identity needed for Rom Building
* Remove Unwanted Stuff From default.xml
As I mentioned above the command for removing project, you can use that command to remove the unwanted stuff from default.xml
As majority of the people here are using Linux. As dawin tool chains are used by MAC OS, So darwin tool chains and darwin packages are useless for linux users. You can remove the same by using remove project command.
For Example :
Code:
<project path="prebuilts/gcc/darwin-x86/arm/arm-eabi-4.6" name="platform/prebuilts/gcc/darwin-x86/arm/arm-eabi-4.6" groups="pdk,darwin,arm" />
<project path="prebuilts/gcc/darwin-x86/arm/arm-linux-androideabi-4.6" name="platform/prebuilts/gcc/darwin-x86/arm/arm-linux-androideabi-4.6" groups="pdk,darwin,arm" />
<project path="prebuilts/gcc/darwin-x86/mips/mipsel-linux-android-4.6" name="platform/prebuilts/gcc/darwin-x86/mips/mipsel-linux-android-4.6" groups="pdk,darwin,mips" />
<project path="prebuilts/gcc/darwin-x86/x86/i686-linux-android-4.6" name="platform/prebuilts/gcc/darwin-x86/x86/i686-linux-android-4.6" groups="pdk,darwin,x86" />
Before Removing Darwin Lines see below
After Removing Darwin Lines
From above you can notice earlier there were 462 projects to be downloaded but after removing darwin lines its slimmed to 444 projects.
Less projects to download sync completes faster
*Remove all the official device not required by you for compiling.
There will be many devices that are officially supported by ROM developers and there Tree will be added to Default.xml which are useless for your device.
The device may be in the following format
Code:
android_device_companyname_codename
For Example :
Code:
android_device_samsung_codename
*Similarly Remove all the kernel source not required by you as it will take more time and your precious bandwidth.
* Remove all unnecessary vendor trees from the manifest.. Why do you need the blobs for a device you are not building for !!
Hope these tips helps you a lot...!!!
Any doubts.. post on this thread.. !!
credits:; @Jacleagle for editing and screenshots..
Making CM Device Tree Compatible With Your Rom For Compiling
Now has we know that how to download sources the next step is to compile the source for your mobile. But Some modification are needed to compile.
There are many devices with just CM.... but the cm device tree has to be modified to compile with other roms .. .
This guide will tell u specific to slimroms and will give u an idea in general ... i will be taking Galaxy Grand Duos as an example
IF YOU ARE BUILDING FOR ANOTHER DEVICE , SIMPLY RENAME i9082 to the name of your device AND SLIM TO WHICHEVER ROM YOU ARE BUILDING .
Ok Now lets start with it.
There are mainly 3 files in CM Tree Which Should Be Modified They are,
1) cm.mk
2) cm.dependencies
3) AndroidProducts.mk
The Image below shows the general device tree .... the 3 files marked in red are the files that have to be edited .
1) Rename cm.mk to slim.mk
The Image Below Shows The Differences Between The CM.MK AND SLIM.MK
As You can see That WE HAVE JUST REPLACED CM WITH SLIM AND ADDED THE BOOTANIMATION PATH ( THE BOOTANIMATION PATH IS NOT ReQUIRED IN ALL ROMS... ONLY SLIMROMS,VANIRAOSP,LIQUIDSMOOTH AND SOKP REQUIRE THIS)
The Boot Animation Values Have To Be Changed As Per YOUR DEVICE RESOLUTION
FOR EXAMPLE IF UR SCREEN IS HD (XHDPI) THEN IT SHOULD BE AS FOLLOWS
Code:
# Bootanimation
TARGET_SCREEN_HEIGHT := 1280
TARGET_SCREEN_WIDTH := 720
PRODUCT_COPY_FILES += \
vendor/slim/prebuilt/common/bootanimation/720.zip:system/media/bootanimation.zip
Now you all must be thinking why did we rename cm.mk to slim.mk.
A Simple Answer is we go to the vendor folder and check the name and replace it. ( SOME ROM's MIGHT GIVE AN ERROR)
...for example in vaniraosp if you rename cm.mk to vanir.mk
IN SUCH A CASE SIMPLY RENAME THE "cm.mk" to "vanir_i9082.mk" and your problem is sorted Simple isn't it
So now you must be wondering about the product name ...as in the above image only the "cm" changes to "slim" with the same logic of the vendor name
In this case we see that slim is the vendor ...so we rename the cm.mk to slim.mk
this same rule applies to the content inside the slim.mk too ... we first make sure that the files are available in that location .
As you can see the image above the files exist in the vendor/slim/config.. so that means we are moving on the right track
NOTHING ELSE NEEDS TO BE TOUCHED IN THIS FILE SO NOW 33.33% OF OUR DEVICE TREE IS READY FOR COMPILING WITH THE SLIMROM SOURCE :laugh:
2) Now we have to move second file "cm.dependencies"
This file will be simply renamed by Vendor Name ...
In This Case "slim" ....so we rename it to "slim.dependencies"
SO NOW 66.66% COMPLETED
3) The Last And The Final Change Required Is In The "AndroidProducts.mk"
In This File you Simply Rename The " device_i9082.mk" to whatever you renamed the "cm.mk" to . in this case it is "slim.mk" so "device_i9082.mk" will be renamed to "slim.mk" check the image below to understand better
Hurrrray NOW OUR DEVICE TREE IS FULLY COMPATIBLE WITH THE SLIMROM SOURCE.
ALL THE BEST!!!!!! :laugh::laugh:
CREDITS
A BIG THANX TO @k2wl and @xenon92 ...THE ONLY REASON I STARTED DEVELOPMENT :highfive:
How to apply patches to the source ?
There are many devices that need patches for the core functions to work . So in this guide i will be talking about applying patches from github and the Gerrit Code Review HERE AGAIN I WILL BE TAKING I9082 AS AN EXAMPLE
I) APPLYING PATCHES FROM THE GERRIT CODE REVIEW .
NOTE: IF THE ROM YOU ARE COMPILING IS BASED ON CYANOGENMOD AND THE COMMIT IS MERGED ... THEN THE PATCH DOESNT HAVE TO BE APPLIED
this is how a gerrit code review typically looks . To apply a patch from here ...
STEP 1: You first have to click on patch and then copy the link
STEP 2:In your terminal navigate to the place it has to be applied (in this case the path is "frameworks/native")
as you can see the command boxed in blue .. it should look somewhat similar
after the patch is applied it asks for an input to continue ... in such a case simply press "q"
CONGRATULATIONS YOU HAVE APPLIED THE PATCH FROM THE GERRIT CODE REVIEW!!!
NOW WE MOVE ON TO APPLYING PATCHES DOWNLOADED FROM GITHUB GISTS
(GENERALLY THE FORMAT IS ".diff" or ".patch")
STEPS TO BE FOLLOWED
STEP1: DOWNLOAD THE GIST
You can simply download the gist as shown in the image below
THIS IS HOW A PATCH TYPICALLY LOOKS
these patches are used generally for unofficial cm ports or official devices of cm for other roms not based on CM
Generally the CM devs write which location has to be patched .... otherwise simply use the search bar To apply the patch above we first have to enter the hardware/broadcom/libbt folder
STEP 2: We then copy, the file that we downloaded earlier, to the folder that has to be patched in this case hardware/broadcom/libbt
STEP 3: APPLYING THE PATCH
Code:
cd nameoftheromfolder/hardware/broadcom/libbt
git checkout .
patch -p1 < nameofthefile.diff or nameofthefile.patch
It should look something like this
ITS AS SIMPLE AS THIS ..... ALL THE BEST !!! HOPE THIS GUIDE HELPS ... IF YOU HAVE ANY ISSUES OR QUESTIONS PLEASE POST IT HERE ...SO I CAN HELP :-d
THANX TO CYANOGENMOD , PAWITP ,K2WL AND XENON92
reserved
Excellent, only this time I find someone who is pleased to provide this detail android science. I really appreciate this. Thank you very much :highfive:
Kindly permit marking thread, personally for reference material. :good:
Woow such a great guide! Huge thanks, will do this in the evening
Thanks for this very useful thread.
Excellent step by step guide!!!! Hats off and thank you for taking the time!!!
Git Knowledge
Before i start,i would like to express my gratitude to GitSCM,Github and others who have provided a learning platform for everyone to use Git and learn Git
If any information was stated wrongly here,please correct me and I am open to suggestions and criticism
First of all,let's start off with the basics
git init
- The git init command is used to create a new git repository in your folder.It can be used to convert an existing, unversioned project to a Git repository or initialize a new empty repository.When the command git init is being executed,in the folder itself,it will create a .git subdirectory and in order to view the sub directory,you need to hold CTRL+H to view it.In the .git subdirectory itself contains the metadata for the repo.
git clone
- The git clone command is used to copy an existing Git repository into your folder.The cloned repository will contain all its own history and manages its own files,and its a totally isolated environment from the original repository.Important note: This is where we should always remember to keep authorship when you clone something and upload to your own github.Always remember to keep the history commits when you upload.The tutorial is here(With courtesy to @Mazda)
git add
- The git add adds a change in the working directory to the staging area.Normally once it is added,it doesnt really get recorded yet until you execute the command git commit.Therefore,if you need to manage your files,execute git status to view the file changes.The various commands are
Stages the changes that was made in the file
Code:
git add <file>
Stages the changes that was made in a folder/directory
Code:
git add <directory/folder>
git commit
- The git commit command stages the snapshot to the project.This command is used after the command git add is executed and the git commit command will do the job in recording the changes you have made and sending it to the project history which will then be uploaded into Github or BitBucket.Some commands that normally developers use
The -m stands for message in full term --message
Code:
git commit -m "Hello"
The -a command is used to tell Git to stage all file changes,be it modified or deleted.Everything is added
Code:
git commit -a
The --reset-author command is used to change back to its original committer if the commits authorship have been changed
Code:
git commit --reset-author
More is coming soon!
nice
well this is the most complete guide that a first time user for ROM development should know. :good:..nice effort
reserved
About Linux
is that possible to build rom using linux os other than ubuntu ( like arch linux, kali ) ???
yeah
Nelson George said:
is that possible to build rom using linux os other than ubuntu ( like arch linux, kali ) ???
Click to expand...
Click to collapse
according to me yes you can use other linux OS but @jackeagle suggests you to use Ubuntu 13.10 as he used this version while making the guide
thnx alot @jackeagle for this awesome guide
{
"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"
}
How-to Build LineageOS
Introduction
These instructions will hopefully assist you to start with a stock device, unlock the bootloader (if necessary), and then download the required tools as well as the very latest source code for LineageOS (based on Google’s Android operating system) for your device. Using these, you can build both LineageOS and LineageOS Recovery image from source code, and then install them both to your device.
It is difficult to say how much experience is necessary to follow these instructions. While this guide is certainly not for the very very very uninitiated, these steps shouldn’t require a PhD in software development either. Some readers will have no difficulty and breeze through the steps easily. Others may struggle over the most basic operation. Because people’s experiences, backgrounds, and intuitions differ, it may be a good idea to read through just to ascertain whether you feel comfortable or are getting over your head.
Remember, you assume all risk of trying this, but you will reap the rewards! It’s pretty satisfying to boot into a fresh operating system you baked at home . And once you’re an Android-building ninja, there will be no more need to wait for “nightly” builds from anyone. You will have at your fingertips the skills to build a full operating system from code to a running device, whenever you want. Where you go from there– maybe you’ll add a feature, fix a bug, add a translation, or use what you’ve learned to build a new app or port to a new device– or maybe you’ll never build again– it’s all really up to you.
What you’ll need
* A device (supported by LineageOS)
* A relatively recent 64-bit computer (Linux, OS X, or Windows) with a reasonable amount of RAM and about 100 GB of free storage (more if you enable ccache or build for multiple devices). The less RAM you have, the longer the build will take (aim for 8 GB or more). Using SSDs results in considerably faster build times than traditional hard drives.
* A USB cable compatible with the OnePlus One (typically micro USB)
* A decent internet connection & reliable electricity
* Some familiarity with basic Android operation and terminology. It would help if you’ve installed custom roms on other devices and are familiar with recovery. It may also be useful to know some basic command line concepts such as cd for “change directory”, the concept of directory hierarchies, that in Linux they are separated by /. etc.
Summary
1. Install SDK
2. Install build packages
3. Java
4. Create the directories
5. Install the repo command
6. Initialize the LineageOS source repository
7. Download the source code
8.Prepare the device-specific code
9. Extract proprietary blobs
10. Turn on caching to speed up build
11. Configure jack
12. Start the build
13. Install the build
Build LineageOS and LineageOS Recovery
1. Install SDK
If you haven’t previously installed adb and fastboot, you can download them from Google. Extract it using:
Code:
unzip platform-tools-latest-linux.zip -d ~
Now we have to add adb and fastboot to our path. Open ~/.profile and add the following:
Code:
# add Android SDK platform tools to path
if [ -d "$HOME/platform-tools" ] ; then
PATH="$HOME/platform-tools:$PATH"
fi
Then, run this to update your environment.
Code:
source ~/.profile
2. Install build packages
Several packages are needed to build LineageOS. You can install these using your distribution’s package manager.
You’ll need:
Code:
bc bison build-essential ccache curl flex g++-multilib gcc-multilib git gnupg gperf imagemagick lib32ncurses5-dev lib32readline-dev lib32z1-dev liblz4-tool libncurses5-dev libsdl1.2-dev libssl-dev libwxgtk3.0-dev libxml2 libxml2-utils lzop pngcrush rsync schedtool squashfs-tools xsltproc zip zlib1g-dev
For Ubuntu versions older than 16.04 (xenial), substitute:
libwxgtk3.0-dev → libwxgtk2.8-dev
3. Java
Different versions of LineageOS require different JDK (Java Development Kit) versions.
LineageOS 11.0-13.0: OpenJDK 1.7 (install openjdk-7-jdk)*
LineageOS 14.1: OpenJDK 1.8 (install openjdk-8-jdk)
* Ubuntu 16.04 and newer do not have OpenJDK 1.7 in the standard package repositories. See Ask Ubuntu question How do I install openjdk 7 on Ubuntu 16.04 or higher Note that the suggestion to use PPA openjdk-r is outdated (the PPA has never updated their offering of openjdk-7-jdk, so it lacks security fixes); skip that answer even if it is the most upvoted.
4. Create the directories
You’ll need to set up some directories in your build environment.
To create them:
Code:
$ mkdir -p ~/bin
$ mkdir -p ~/android/system
5. Install the repo command
Enter the following to download the repo binary and make it executable (runnable):
Code:
$ curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
$ chmod a+x ~/bin/repo
Put the ~/bin directory in your path of execution
In recent versions of Ubuntu, ~/bin should already be in your PATH. You can check this by opening ~/.profile with a text editor and verifying the following code exists (add it if it is missing):
Code:
# set PATH so it includes user's private bin if it exists
if [ -d "$HOME/bin" ] ; then
PATH="$HOME/bin:$PATH"
fi
Then, use this to update your environment.
Code:
source ~/.profile
6. Initialise the LineageOS source repository
Enter the following to initialize the repository:
Code:
$ cd ~/android/system
$ repo init -u https://github.com/LineageOS/android.git -b lineage-16.0
7. Download the source code
To start the download of the source code to your computer:
Code:
$ repo sync
The Lineage manifests include a sensible default configuration for repo, which we strongly suggest you use (i.e. don’t add any options to sync). For reference, our default values are -j 4 and -c. The -j 4 part means that there will be four simultaneous threads/connections. If you experience problems syncing, you can lower this to -j 3 or -j 2. -c will ask repo to pull in only the current branch, instead of the entire LineageOS history.
8. Prepare the device-specific code
After the source downloads, ensure you’re in the root of the source code (cd ~/android/system), then type:
You have to change DEVICE with the codename of your device (for example: Oneplus ONE codename is bacon)
Code:
$ source build/envsetup.sh
$ breakfast "DEVICE"
This will download your device’s device specific configuration and kernel.
Important: Some maintainers require a vendor directory to be populated before breakfast will succeed. If you receive an error here about vendor makefiles, jump down to Extract proprietary blobs. The first portion of breakfast should have succeded, and after completing you can rerun breakfast
9. Extract proprietary blobs
Method 1
Now ensure your device is connected to your computer via the USB cable, with ADB and root enabled, and that you are in the ~/android/system/device/your_device/codename folder. Then run the extract-files.sh script:
Code:
$ ./extract-files.sh
The blobs should be pulled into the ~/android/system/vendor/your_device folder. If you see “command not found” errors, adb may need to be placed in ~/bin.
Method 2 (Recomended)
Search for your device blobs on TheMuppets or Donkeycoiote and add them to local manifest
10. Turn on caching to speed up build
You can speed up subsequent builds by running:
Code:
$ export USE_CCACHE=1
And adding that line to your ~/.bashrc file. Then, specify the maximum amount of disk space you want cache to use by typing this from the top of your Android tree:
Code:
$ prebuilts/misc/linux-x86/ccache/ccache -M 50.0G
Where 50G corresponds to 50GB of cache. This needs to be run once. Anywhere from 25GB-100GB will result in very noticeably increased build speeds (for instance, a typical 1hr build time can be reduced to 20min). If you’re only building for one device, 25GB-50GB is fine. If you plan to build for several devices that do not share the same kernel source, aim for 75GB-100GB. This space will be permanently occupied on your drive, so take this into consideration. See more information about ccache on Google’s Android build environment initialization page.
11. Configure jack
Jack is the new Java compiler used from Lineage 14. It is known to run out of memory
Simple fix is to run this command:
Code:
$ export JACK_SERVER_VM_ARGUMENTS="-Dfile.encoding=UTF-8 -XX:+TieredCompilation -Xmx4096m"
Adding that command to your ~/.bashrc file will automatically configure Jack to allocate a sufficient amount of memory.
If this doesn't help, you can reduce the number of Jacks to 1 in config.properties
$HOME/.jack-server/config.properties
jack.server.max-service=1
12. Start the build
Time to start building! Now, type:
Code:
$ croot
$ brunch [COLOR="red"]device[/COLOR]
Remember, device is the codename for your device
The build should begin.
13. Install the build
Assuming the build completed without errors (it will be obvious when it finishes), type the following in the terminal window the build ran in:
Code:
$ cd $OUT
There you’ll find all the files that were created. The two files we’re interested in are:
recovery.img, which is the LineageOS recovery image.
lineage-14.1-build_date-UNOFFICIAL-device.zip, which is the LineageOS installer package.
Success! So… what’s next?
You’ve done it! Welcome to the elite club of self-builders. You’ve built your operating system from scratch, from the ground up. You are the master/mistress of your domain… and hopefully you’ve learned a bit on the way and had some fun too.
Now, what to do next? You can jump to next section of this guide to understand how Github works and how to pick some commits from other developers/teams to improve your custom ROM
This guide was taken from Official LineageOS wiki and all credits goes to LineageOS Maintainers
What is Github and how to use it
GitHub is a code hosting platform for version control and collaboration. It lets you and others work together on projects from anywhere. It is a powerful tool with many features available and here i´m going to talk about how you can use it to help you build and customize your "Custom ROM"
Summary
1. Repositories
2. How to add/remove repositories
3. How to add/remove remotes
4. Repository Fork
1. Repositories
Now that you have built custom lineage from source to your device, you can explore deeper and see how things work and change them according to your needs.
First we are going to se what is inside .repo folder
Code:
cd ~/working_dir/.repo
ls
It will show you something similar to this:
Inside the .repo folder are the necessary "manifest files" that tell the repo sync command what to include or remove from our project when synchronizing with the source
Open manifest.xml
Code:
gedit ~/working_dir/.repo/manifest.xml
Inside that file you have all information about which repositories belongs to source. These are the base repositories to build LineageOS.
Inside ~/working_dir/.repo/local_manifests/roomservice.xml you can see the repositories needed to build for your specific device. This file is created after breakfast device step and includes, besides others, device tree and kernel.
2. How to add/remove repositories
Lets take a look at how we use roomservice.xml to add/remove repo's from our project, i will use Oneplus ONE device tree for example
Code:
<project name="LineageOS/android_device_oneplus_bacon" path="device/oneplus/bacon" remote="github" revision="cm-14.1" />
* project name="LineageOS/android_device_oneplus_bacon Name of repository (without https://github.com)
* path="device/oneplus/bacon" Here is where the files will reside in our working directory
* remote="github" Is the for remote we are using, in this case is github (see below how to add/remove remotes to your project)
* revision="cm-14.1" Revision is the branch we want to sync
Image:
3. How to add/remove remotes
Code:
<remote fetch="https://github.com" name="github" />
* remote fetch="https://github.com Url for remote you want to add to your project (in this case, we are working with github)
* name="github" This is the name for remote
Now that you understand the concept of repository, you can "fork" one and start making your
changes and keep it up to date with LineageOS source. For that, you need a Github Account.
4. Repository Fork
In this example, i will fork Oneplus ONE device tree
1. Create Github Account
2. Go to https://github.com/LineageOS/android_device_oneplus_bacon and tap on Fork button. After that you can see that repository on you Github account
Image:
3. Now that you have "forked" one repository, you need to edit ~/working_dir/.repo/local_manifests/roomservice.xml and change the default location to your location on your github.[/SIZE]
Image:
This is the basic steps you need to understand how to use Github to keep your code saved and updated. On next section, i will tell you how use Git so you can work on your project and start to pick some cool commits from others projects.
Reserved
Reserved
Hello ,
Thanks for your tutorial. It was very well explained.
I have a question in the step: "Prepare the device-specific code".
The last available branche of my device at https://github.com/LineageOS/android_device_samsung_treltexx/tree/cm-13.0, is the cm-13.0 version,
Should I tell which of the options on the device?
$ Source build / envsetup.sh
$ Breakfast "[COLOR =" Red] Samsung Galaxy Note 4 (Exynos) or treltexx [/ COLOR]
Another question: since the last branche is from cm-13.0, if I follow your tutorial, will it compile a, lineage 14.1 rom? Or CYanogenmod 13.0?
Thank you
John Jefferson said:
Hello ,
Thanks for your tutorial. It was very well explained.
I have a question in the step: "Prepare the device-specific code".
The last available branche of my device at https://github.com/LineageOS/android_device_samsung_treltexx/tree/cm-13.0, is the cm-13.0 version,
Should I tell which of the options on the device?
$ Source build / envsetup.sh
$ Breakfast "[COLOR =" Red] Samsung Galaxy Note 4 (Exynos) or treltexx [/ COLOR]
Another question: since the last branche is from cm-13.0, if I follow your tutorial, will it compile a, lineage 14.1 rom? Or CYanogenmod 13.0?
Thank you
Click to expand...
Click to collapse
Since your device tree doesn't have 14.1 branch you have to sync Lineage 13.0 branch
Code:
repo init -u https://github.com/LineageOS/android.git -b cm-13.0
After that you have to sync your especific device repos
Code:
$ source build/envsetup.sh
$ breakfast treltexx
A3 2017
Hi , I have Galaxy A3 2017 I got to point of breakfast and I cound download files for my phone. What I have to do if I want to have Lineage OS Nuggat in my phone. I hate original rom :-{
breakfast a3y17lte
including vendor/cm/vendorsetup.sh
build/core/product_config.mk:249: *** Can not locate config makefile for product "lineage_a3y17lte". Stop.
build/core/product_config.mk:249: *** Can not locate config makefile for product "cm_a3y17lte". Stop.
build/core/product_config.mk:249: *** Can not locate config makefile for product "lineage_a3y17lte". Stop.
Device a3y17lte not found. Attempting to retrieve device repository from LineageOS Github
Repository for a3y17lte not found in the LineageOS Github repository list. If this is in error, you may need to manually add it to your local_manifests/roomservice.xml.
build/core/product_config.mk:249: *** Can not locate config makefile for product "lineage_a3y17lte". Stop.
build/core/product_config.mk:249: *** Can not locate config makefile for product "lineage_a3y17lte". Stop.
** Don't have a product spec for: 'lineage_a3y17lte'
** Do you have the right repo manifest?
Is that mean that I have to wait for support from LineageOS dvlpr team <?
Roman
roman01110 said:
** Don't have a product spec for: 'lineage_a3y17lte'
** Do you have the right repo manifest?
Is that mean that I have to wait for support from LineageOS dvlpr team <?
Roman
Click to expand...
Click to collapse
Yes
Thanks for the great post! I have two questions to ask:
1. How to change LINEAGE_VERSION? Currently when performing brunch I've got
Code:
LINEAGE_VERSION=14.1-20170311-UNOFFICIAL-oneplus3
and I wish to change it to
Code:
LINEAGE_VERSION=14.1-20170311-HAZUKI-oneplus3
to distinguish my personal modified build.
2. When I wish to sync again to obtain latest commits, how far should I go back? Is performing "repo sync" and then "brunch oneplus3" already good enough? Do I need to perform "make clean" or something similar?
Thanks in advance!
I'm trying to build this for my galaxy s5 and I'm using that same guide to the letter and I'm just getting errors. And all those packages listed in op don't work either. I also get an error when extracting proprietary blobs. The extracting isn't the error it's that all the files aren't found in source code at all?!? I'm splitting bloody atoms trying to figure this crap out. Any help at all??
Hazuki Amamiya said:
Thanks for the great post! I have two questions to ask:
1. How to change LINEAGE_VERSION? Currently when performing brunch I've got
Code:
LINEAGE_VERSION=14.1-20170311-UNOFFICIAL-oneplus3
and I wish to change it to
Code:
LINEAGE_VERSION=14.1-20170311-HAZUKI-oneplus3
to distinguish my personal modified build.
2. When I wish to sync again to obtain latest commits, how far should I go back? Is performing "repo sync" and then "brunch oneplus3" already good enough? Do I need to perform "make clean" or something similar?
Thanks in advance!
Click to expand...
Click to collapse
1. In order to add some code to your build, you have to get familiar with git/GitHub. I'm preparing my next chapter to talk about it
2. Yes, you have to "make clean" everytime before build
thatsupnow said:
I'm trying to build this for my galaxy s5 and I'm using that same guide to the letter and I'm just getting errors. And all those packages listed in op don't work either. I also get an error when extracting proprietary blobs. The extracting isn't the error it's that all the files aren't found in source code at all?!? I'm splitting bloody atoms trying to figure this crap out. Any help at all??
Click to expand...
Click to collapse
You have to show all your errors and all your steps in order to get help!
I'm using the exact same directions in the OP. No different order exactly the same order only for my specific device. The first pic is when I extract the proprietary blobs from the lineage ROM zip. The second pic is after trying to build it I get the ninja wrapper error 1 at the end. Oh and I'm running ubuntu 16.10 on VirtualBox. And my build environment was setup step by step off the android website
thatsupnow said:
I'm using the exact same directions in the OP. No different order exactly the same order only for my specific device. The first pic is when I extract the proprietary blobs from the lineage ROM zip. The second pic is after trying to build it I get the ninja wrapper error 1 at the end. Oh and I'm running ubuntu 16.10 on VirtualBox. And my build environment was setup step by step off the android website
Click to expand...
Click to collapse
Why did you run: " ./extract-files.sh ~/original"
FSadino said:
* A relatively recent 64-bit computer (Linux, OS X, or Windows) with a reasonable amount of RAM and about 100 GB of free storage (more if you enable ccache or build for multiple devices). The less RAM you have, the longer the build will take (aim for 8 GB or more). Using SSDs results in considerably faster build times than traditional hard drives.
Click to expand...
Click to collapse
Can you tell me, where the space is nescessary in the file-sytem on a linux-PC?
Of course /home needs much space, as the build is done there, but where else?
JamBax said:
Can you tell me, where the space is nescessary in the file-sytem on a linux-PC?
Of course /home needs much space, as the build is done there, but where else?
Click to expand...
Click to collapse
It depends on which Linux distribution you install. Usually between 10Gb/15Gb should be enough for file system partition "/"
FSadino said:
It depends on which Linux distribution you install. Usually between 10Gb/15Gb should be enough for file system partition "/"
Click to expand...
Click to collapse
It is kubuntu 16.04.02, so this means all the hard disk space will be for /home filesystem, correct?
Another question, where is the space for the cache, for i can't see any parameter.
edit ok, looks like the cache is located at /home/..ccache, is there a possibility to move this location?
Could it be, that java 8 can be used for 13.0 also? I did not install java 7, but was able to build a working lineage 13.0.
JamBax said:
It is kubuntu 16.04.02, so this means all the hard disk space will be for /home filesystem, correct?
Click to expand...
Click to collapse
You have to make root partition for system (/) with 10Gb/15Gb and home partition (/home) with the remaining disk space.
Another question, where is the space for the cache, for i can't see any parameter.
edit ok, looks like the cache is located at /home/..ccache, is there a possibility to move this location?
Click to expand...
Click to collapse
Search on Google "how export ccache to other location"
Could it be, that java 8 can be used for 13.0 also? I did not install java 7, but was able to build a working lineage 13.0.
Click to expand...
Click to collapse
Yes
I have a question. I repo synced lineage 13. The build was successful but doesn't boot. I am building for Moto E surnia. I breakfast surnia it didn't ask for vendor files but built correctly. What could be wrong? The kernel log doesn't tell me too much. It's frustrating. All my previous builds booted up before.( I compiled DU for the surnia) Also use the same environment to build Twrp recoveries. I am downloading lineage 14 to try again. Maybe someone can point me in the right path please
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
[email protected] said:
I have a question. I repo synced lineage 13. The build was successful but doesn't boot. I am building for Moto E surnia. I breakfast surnia it didn't ask for vendor files but built correctly. What could be wrong? The kernel log doesn't tell me too much. It's frustrating. All my previous builds booted up before.( I compiled DU for the surnia) Also use the same environment to build Twrp recoveries. I am downloading lineage 14 to try again. Maybe someone can point me in the right path please
Click to expand...
Click to collapse
Try build with vendor files
sada23 said:
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
Click to expand...
Click to collapse
Try to use GCC 4.9 or if you already using it try update to GCC 5