Problem building Lineage? - Xiaomi Redmi Note 3 Questions & Answers

I was trying to build Lineage myself and was following this guide: http://wiki.lineageos.org/kenzo_build.html
At
Code:
breakfast kenzo
it said
Code:
Dependencies file not found bailing out
.
Code:
repo sync
didn't fix it either
Also does someone know how to do inline code formatting on XDA?

Related

[GUIDE][COMPLETE] All in one Android Development [NOOB FRIENDLY]

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 supported​If 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

Local Manifest Help

Hey, i am from India. I am trying to compile a CM13 ROM for my device Micromax Q370 following XDA University guide. Well. There is no such fork available for my device in git. Well. I am done up to repo sync state successfully. But stucked after that. No idea about making device specific tree or adding a local manifest xml file. Whenever I give the command " $source build/envsetup.sh ", after repo sync process completes, I get an error with bash build/envsetup.sh : no such file or directory. same with Vendor/cm command also.
Whats the fix ?

✦✦✦ [GUIDE] Build LineageOS ✦ How To use Github ✦✦✦

{
"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

Building AOSP

I am trying to build AOSP. I have followed some instructions and the best are the instructions of Sony. But when I come to the point to clone the local_manifests, I need to have another file because I am trying to build it for the OnePlus One. I have found the AOSP-bacon repo on github where is a local_manifests to clone. So I have done that but when I try to sync the repo with the command 'repo sync' it gives this back:
[email protected]:~/android$ repo sync
fatal: remove-project element specifies non-existent project: platform/build
I have searched but could not find the answer what to do now. Can someone help me or say what I need to do to build AOSP?
You're cluttering your roomservice.xml with too much stuff. You only really need 3 things, device tree, vendor and kernel sources. You don't need to define the github tag since it should already have been defined in your default.xml located in .repo/manifests.

Building a custom ROM for the Moto-Z

I need to add the SMSC95XX drivers to the Linux Kernel in an AOSP for the Moto-Z. Can someone tell me how one builds the Linux Kernel then the AOSP for the Moto-Z?
Thx,
Y-
YileKu said:
I need to add the SMSC95XX drivers to the Linux Kernel in an AOSP for the Moto-Z. Can someone tell me how one builds the Linux Kernel then the AOSP for the Moto-Z?
Thx,
Y-
Click to expand...
Click to collapse
Hello,
to include the driver download the kernel sources from here:
https://github.com/boulzordev/android_kernel_motorola_msm8996
and change
Code:
# CONFIG_USB_NET_SMSC95XX is not set to
to
Code:
CONFIG_USB_NET_SMSC95XX=Y
in "arch/arm64/configs/griffin_defconfig"
Something like
Code:
sed "/CONFIG_USB_NET_SMSC95XX/d" -i arch/arm64/configs/griffin_defconfig/griffin_defconfig && echo "CONFIG_USB_NET_SMSC95XX=y" >> arch/arm64/configs/griffin_defconfig/griffin_defconfig
should do the job ( run these inside the cloned kernel repo )
Moto-Z AOSP newbie
Thanks for the pointer. I can do that. I have built AOSP for the Nexus-6, but I have not built it for the Moto-Z Droid. Can someone point me to the general instructions on how to build for the Moto-Z?
CHeers,
Y-
Maybe can build MIUI for the Moto-Z?
rakee said:
Maybe can build MIUI for the Moto-Z?
Click to expand...
Click to collapse
Building miui has 2 way :
Building with rompatch and porting from similar device (Mi5 is good for for moto z) (it's not very common and certain way)
Here's patchrom link : https://github.com/MiCode/patchrom/branches
Patchrom latest version is marshmallow and it's too late to start building most of the people is updated to nuogat so they can't install MM kernel
But about second way (porting), I've tried this but no success to boot I got some errors on netlink uevent
So we need to wait for patchrom to get nougat update and I'll try porting it if I didn't buy new phone
rakee said:
Maybe can build MIUI for the Moto-Z?
Click to expand...
Click to collapse
I don't recognize 'MIUI' what is meant by this?
YileKu said:
I don't recognize 'MIUI' what is meant by this?
Click to expand...
Click to collapse
MIUI is a custom ROM from china
Any chance I can build a ROM for the Moto-Z from here https://source.android.com/source/building-kernels?
StarStorm said:
Hello,
to include the driver download the kernel sources from here:
https://github.com/boulzordev/android_kernel_motorola_msm8996
and change
Code:
# CONFIG_USB_NET_SMSC95XX is not set to
to
Code:
CONFIG_USB_NET_SMSC95XX=Y
in "arch/arm64/configs/griffin_defconfig"
Something like
Code:
sed "/CONFIG_USB_NET_SMSC95XX/d" -i arch/arm64/configs/griffin_defconfig/griffin_defconfig && echo "CONFIG_USB_NET_SMSC95XX=y" >> arch/arm64/configs/griffin_defconfig/griffin_defconfig
should do the job ( run these inside the cloned kernel repo )
Click to expand...
Click to collapse
Thanks StarStorm,
After making these changes, how does one build the ROM with the new kernel?
Y-
YileKu said:
Thanks StarStorm,
After making these changes, how does one build the ROM with the new kernel?
Y-
Click to expand...
Click to collapse
Oh, didn't see your reply until you quoted me~
You can follow Lineage's wiki entry for the Moto Z. Depending on which ROM you want to build you just change
Code:
repo init -u https://github.com/LineageOS/android.git -b cm-14.1
to
Code:
repo init -u <url> -b <branch>
, e.g.
Code:
repo init -u https://github.com/ResurrectionRemix/platform_manifest.git -b nougat
for Resurrection Remix. If you use a ROM that doesn't officially support the Moto Z ( everything other than AOKP/Lineage afaik ) you'll have to add https://github.com/boulzordev/android_device_motorola_griffin and https://github.com/boulzordev/proprietary_vendor_motorola_griffin to your local manifest. You can skip the "extract-files.sh" step if you do that. Once you synched everything with "repo sync" you can make the changes I described in my earlier post.
StarStorm said:
Oh, didn't see your reply until you quoted me~
You can follow Lineage's wiki entry for the Moto Z. Depending on which ROM you want to build you just change
Code:
repo init -u https://github.com/LineageOS/android.git -b cm-14.1
to
Code:
repo init -u <url> -b <branch>
, e.g.
Code:
repo init -u https://github.com/ResurrectionRemix/platform_manifest.git -b nougat
for Resurrection Remix. If you use a ROM that doesn't officially support the Moto Z ( everything other than AOKP/Lineage afaik ) you'll have to add https://github.com/boulzordev/android_device_motorola_griffin and https://github.com/boulzordev/proprietary_vendor_motorola_griffin to your local manifest. You can skip the "extract-files.sh" step if you do that. Once you synched everything with "repo sync" you can make the changes I described in my earlier post.
Click to expand...
Click to collapse
StarStorm,
Thanks for the direction. I am a bit of a newbie on this so I want to verify the steps:
1. Follow the instructions at https://forum.xda-developers.com/chef-central/android/how-to-build-lineageos-14-1-t3551484, up to the point you do the 'repo init'
2. Use the repo init command 'repo init -u https://github.com/ResurrectionRemix/platform_manifest.git -b nougat' instead.
3. Add the following repos to my manifest: https://github.com/boulzordev/androi...torola_griffin and https://github.com/boulzordev/propri...torola_griffin
4. Skip the 'extract-files.sh' command
5. do a 'repo sync' command
6. Modify the linux kernel to include the driver
7. follow the instructions for building at: https://forum.xda-developers.com/chef-central/android/how-to-build-lineageos-14-1-t355148
thx,
Y-
YileKu said:
StarStorm,
Thanks for the direction. I am a bit of a newbie on this so I want to verify the steps:
1. Follow the instructions at https://forum.xda-developers.com/chef-central/android/how-to-build-lineageos-14-1-t3551484, up to the point you do the 'repo init'
2. Use the repo init command 'repo init -u https://github.com/ResurrectionRemix/platform_manifest.git -b nougat' instead.
3. Add the following repos to my manifest: https://github.com/boulzordev/androi...torola_griffin and https://github.com/boulzordev/propri...torola_griffin
4. Skip the 'extract-files.sh' command
5. do a 'repo sync' command
6. Modify the linux kernel to include the driver
7. follow the instructions for building at: https://forum.xda-developers.com/chef-central/android/how-to-build-lineageos-14-1-t355148
thx,
Y-
Click to expand...
Click to collapse
Yep, looks good to me :good:
StarStorm said:
Yep, looks good to me :good:
Click to expand...
Click to collapse
I did the repo init command and I was looking to add the repos to the manifest. The only file I found was .repo/manifest.xml, it didn't seem obvious how to add the two repos above.
Y-
StarStorm said:
Oh, didn't see your reply until you quoted me~
You can follow Lineage's wiki entry for the Moto Z. Depending on which ROM you want to build you just change
Code:
repo init -u https://github.com/LineageOS/android.git -b cm-14.1
to
Code:
repo init -u <url> -b <branch>
, e.g.
Code:
repo init -u https://github.com/ResurrectionRemix/platform_manifest.git -b nougat
for Resurrection Remix. If you use a ROM that doesn't officially support the Moto Z ( everything other than AOKP/Lineage afaik ) you'll have to add https://github.com/boulzordev/android_device_motorola_griffin and https://github.com/boulzordev/proprietary_vendor_motorola_griffin to your local manifest. You can skip the "extract-files.sh" step if you do that. Once you synched everything with "repo sync" you can make the changes I described in my earlier post.
Click to expand...
Click to collapse
When I did the 'breakfast lineage_griffin-userdebug'
I get:
.......
* [new branch] cm-14.1 -> github/cm-14.1
Fetching projects: 100% (5/5), done.
Checking out files: 100% (52729/52729), done.
Syncing work tree: 100% (5/5), done.
Looking for dependencies in kernel/motorola/msm8996
Dependencies file not found, bailing out.
Looking for dependencies in external/bson
Dependencies file not found, bailing out.
Looking for dependencies in external/stlport
Dependencies file not found, bailing out.
Looking for dependencies in device/qcom/common
Dependencies file not found, bailing out.
Looking for dependencies in packages/resources/devicesettings
Dependencies file not found, bailing out.
Done
build/core/product_config.mk:254: *** _nic.PRODUCTS.[[device/motorola/griffin/lineage.mk]]: "vendor/motorola/griffin/griffin-vendor.mk" does not exist. Stop.
build/core/product_config.mk:254: *** _nic.PRODUCTS.[[device/motorola/griffin/lineage.mk]]: "vendor/motorola/griffin/griffin-vendor.mk" does not exist. Stop.
** Don't have a product spec for: 'lineage_griffin'
** Do you have the right repo manifest?
[email protected]:~/android/system$
YileKu said:
When I did the 'breakfast lineage_griffin-userdebug'
I get:
.......
* [new branch] cm-14.1 -> github/cm-14.1
Fetching projects: 100% (5/5), done.
Checking out files: 100% (52729/52729), done.
Syncing work tree: 100% (5/5), done.
Looking for dependencies in kernel/motorola/msm8996
Dependencies file not found, bailing out.
Looking for dependencies in external/bson
Dependencies file not found, bailing out.
Looking for dependencies in external/stlport
Dependencies file not found, bailing out.
Looking for dependencies in device/qcom/common
Dependencies file not found, bailing out.
Looking for dependencies in packages/resources/devicesettings
Dependencies file not found, bailing out.
Done
build/core/product_config.mk:254: *** _nic.PRODUCTS.[[device/motorola/griffin/lineage.mk]]: "vendor/motorola/griffin/griffin-vendor.mk" does not exist. Stop.
build/core/product_config.mk:254: *** _nic.PRODUCTS.[[device/motorola/griffin/lineage.mk]]: "vendor/motorola/griffin/griffin-vendor.mk" does not exist. Stop.
** Don't have a product spec for: 'lineage_griffin'
** Do you have the right repo manifest?
[email protected]:~/android/system$
Click to expand...
Click to collapse
Did you add https://github.com/boulzordev/proprietary_vendor_motorola_griffin to your manifest? What does your local manifest look like?
YileKu said:
I did the repo init command and I was looking to add the repos to the manifest. The only file I found was .repo/manifest.xml, it didn't seem obvious how to add the two repos above.
Y-
Click to expand...
Click to collapse
You aren't supposed to modify .repo/manifest.xml , add your local changes to .repo/local_manifests.xml ( with the same syntax as manifest.xml uses )
StarStorm said:
Did you add https://github.com/boulzordev/proprietary_vendor_motorola_griffin to your manifest? What does your local manifest look like?
Click to expand...
Click to collapse
build/core/product_config.mk:254: *** _nic.PRODUCTS.[[device/motorola/griffin/lineage.mk]]: "vendor/motorola/griffin/griffin-vendor.mk" does not exist. Stop.
build/core/product_config.mk:254: *** _nic.PRODUCTS.[[device/motorola/griffin/lineage.mk]]: "vendor/motorola/griffin/griffin-vendor.mk" does not exist. Stop.
** Don't have a product spec for: 'lineage_griffin'
** Do you have the right repo manifest?
[email protected]:~/moto-z/lineage$ cat .repo/local_manifest
<?xml version="1.0" encoding="UTF-8"?>
<manifest>
<remote name="1"
fetch="https://github.com/boulzordev/android_device_motorola_griffin" />
<remote name="2"
fetch="https://github.com/boulzordev/proprietary_vendor_motorola_griffin" />
</manifest>
[email protected]:~/moto-z/lineage$
YileKu said:
build/core/product_config.mk:254: *** _nic.PRODUCTS.[[device/motorola/griffin/lineage.mk]]: "vendor/motorola/griffin/griffin-vendor.mk" does not exist. Stop.
build/core/product_config.mk:254: *** _nic.PRODUCTS.[[device/motorola/griffin/lineage.mk]]: "vendor/motorola/griffin/griffin-vendor.mk" does not exist. Stop.
** Don't have a product spec for: 'lineage_griffin'
** Do you have the right repo manifest?
[email protected]:~/moto-z/lineage$ cat .repo/local_manifest
<?xml version="1.0" encoding="UTF-8"?>
<manifest>
<remote name="1"
fetch="https://github.com/boulzordev/android_device_motorola_griffin" />
<remote name="2"
fetch="https://github.com/boulzordev/proprietary_vendor_motorola_griffin" />
</manifest>
[email protected]:~/moto-z/lineage$
Click to expand...
Click to collapse
Add something like this to your local manifest, right now you only defined from where you want to download the device tree and the vendor files, you also need to specify where you want them located
Code:
<project path="device/motorola/griffin" name="android_device_motorola_griffin" remote="1" />
<project path="vendor/motorola/griffin" name="proprietary_vendor_motorola_griffin" remote="1" />
StarStorm said:
Add something like this to your local manifest, right now you only defined from where you want to download the device tree and the vendor files, you also need to specify where you want them located
Code:
<project path="device/motorola/griffin" name="android_device_motorola_griffin" remote="1" />
<project path="vendor/motorola/griffin" name="proprietary_vendor_motorola_griffin" remote="1" />
Click to expand...
Click to collapse
Thanks that worked. I had to remove a duplicate path in roomservice.xml, then the sync and breakfast worked.
Y-
Thanks. Okay the build is working. I tried : 'cd kernel/motorola/msm8996'; make ARCH=arm64 CROSS_COMPILE=arm-linux-androideabi- menuconfig; /* enabled SMSC drivers to be in the kernel */; cd -; breakfast lineage_griffin-userdebug; brunch lineage_griffin-userdebug;" and get an error compiling setup.c. Any chance i can get the steps to configure, compile and include the kernel in an android build?
Thanks,
Y-

Categories

Resources