ROM Building Guide for DROIDRAZR - Motorola Droid RAZR

This guide is referred to people who don’t know anything about building ROMs.
ROM Building Guide
Index
-Prepare building enviroment
-Install necesary packages
-Syncronize repos from ROM
-Put all the dependecies for Device
-Making NON-CM based ROMS
-Make Changes on BASE to build
-Commands for build
-Build
-Errors, Bugs and Fails
Prepare building enviroment​
First of all we need to have a prepared enviroment for build, normally if you install Ubuntu you need to download manually some programs like SDK, Phyton and other tools, but this is a really easy guide so we use a preconfigured SO in order to have most of the things configured and downloaded.
We need to download this ISO and install it on our machine:
http://www.mediafire.com/download/h5t5mbht8d85dbq/builduntu.v12.iso
install it is so easy so only burn the iso into a disk and install it.
If you don’t want to install Ubuntu in your machines you can use a Virtual Machine, if you want to use a VM you have to download this:
http://nathanpfry.com/builduntu-virtual-machine-android-rom-compiling/
Extact it and you will see a ova file, go to VM VirtualBox and then press “ctrl” + “I” and find .ova file and import it. When this finish go to “configuration” and give the machine 4GB of RAM or more and 2 processors or more.
*It’ll work anyway if you set 2GB of RAM but if you put more, much more faster the rom will build*
Install necesary packages​
If you choose VM continue to the next step.
If you choose Native OS(or secondary boot), when you finish installing Ubuntu you have to open a “terminal” and put this:
mkdir ~/bin && curl http://commondatastorage.googleapis.com/git-repo-downloads/repo > ~/bin/repo && chmod a+x ~/bin/repo
This will install “repo” to use it later.
When this finish use nano to edit ~/.bashrc
sudo nano ~/.bashrc
And scroll down at the very bottom and add this into a new(empty) line:
export PATH=~/bin:$PATH
Save it. In nano that would be Ctrl-O and then Enter. Then Ctrl-X to exit back to a prompt. Restart bash:
source ~/.bashrc
And this is all
Syncronize repos from ROM​
Okay, we have the enviroment, so now we need to set up the ROM, and I have to tell you that we only have to use Terminal, Firefox and File Manager. First of all you need to know that for linux is not the same if write things in capital letter, so if you can do anything or terminal didn’t recognize your command see this first. I’ll teach you some commands:
mkdir
HTML:
mkdir ~/
This command will make a new folder, after “/” you have to put the name of the new folder, where all the repos will be. For example I want to make a folder named DU:
HTML:
mkdir ~/DU
cd
HTML:
cd ~/DU
This will open this folder to work on it in my case “DU”
*note “~/DU” this made my folder into “home”
repo init
HTML:
repo init
This command will initializate the repo this will change depending the rom that you want to build, some examples:
DU
HTML:
repo init -u https://github.com/DirtyUnicorns-KitKat/manifest.git -b du44
AOKP
HTML:
repo init -u https://github.com/AOKP/platform_manifest.git -b kitkat
AOSB
HTML:
repo init -u https://github.com/AOSB/android.git
To find the repo for specific rom you have to find the manifest like this:
https://github.com/AOSB/android/tree/android-4.4
https://github.com/AOKP/platform_manifest
repo sync
HTML:
repo sync
This will download and make all the files to build a rom(sync one rom maybe tooks hours because the size of all the repo is about 10GB or more, depending wich ROM pick)
This command will be the same for all roms(but some roms made a change, but you will be noticed in the manifest)
And last thing to know is that all the files and manifest files are on:
https://github.com/
(it’s recomended to make an account here)
Ready continue, we need to make a folder to download the repos, I want to make DU(you can put the name that you want, remember the use of capital letters):
HTML:
mkdir ~/DU
Then I have to make DU my working folder:
HTML:
cd ~/DU
And initializate the repo:
HTML:
repo init -u https://github.com/DirtyUnicorns-KitKat/manifest.git -b du44
(remember to find the repo command for your rom in the manifest file, if you don’t find it Google it)
You will see that some files were downloaded.
IMPORTANT: Maybe you need to make an account and a password to download the repos from github.
Then type this:
HTML:
repo sync
And all the repos will be downloaded.
Maybe you will see that some repos didn’t download well or in terminal appears “fatal” so make “repo sync” twice(the second time will be much more faster that the first).
Put all the dependecies for Device​So we have all the repos for build the rom in our HDD, now we need to download the files to build the rom to our device.
Well in this part some roms admit to download teh device from Cyanogen and others not, so the easy way(try this first) is this:
Go to your working folder with "file explorer" and open ".repo", here create a folder named "local_manifests" open it and make a text file named "roomservice.xml"(yes, its "room") and inside the file paste this as I provide:
HTML:
<?xml version="1.0" encoding="UTF-8"?>
<manifest>
<project name="CyanogenMod/android_device_motorola_umts_spyder" path="device/motorola/umts_spyder" remote="github" revision="cm-12.0" />
<project name="CyanogenMod/android_device_motorola_omap4-common" path="device/motorola/omap4-common" remote="github" revision="cm-12.0" />
<project name="CyanogenMod/android_kernel_motorola_omap4-common" path="kernel/motorola/omap4-common" remote="github" revision="cm-12.0" />
<project name="CyanogenMod/android_device_motorola_spyder" path="device/motorola/spyder" remote="github" />
<project name="TheMuppets/proprietary_vendor_motorola" path="vendor/motorola" remote="github" revision="cm-12.0" />
</manifest>
and this is all, only make a new repo sync and if you see that the new projects are beeing downloaded your rom support this way, but if this don't work try the option below:
OPTION 2
First we need to know the codename of the device, Razr is “UMTS_SPYDER” and “SPYDER” depends if its GSM or CDMA. When we know this, we need to find the device in CyanogenMod github, to do this go here:
https://github.com/CyanogenMod
and put the name of your phone in the box that says “find a repository...”
for RAZR are these two:
(UMTS)
https://github.com/CyanogenMod/android_device_motorola_umts_spyder
(CDMA)
https://github.com/CyanogenMod/android_device_motorola_spyder
You will se something like that:
{
"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"
}
And you have to change the branch that you want to download by clicking in the button as you can see in the photo and select “cm-11.0”
When you change this then press on “download ZIP” at the right on the screen.
Okay, you will see that is a zip file, open it. When you open the file you will se a folder named like this(depending what you download this will change but this is an example).
“android_device_motorola_spyder-cm-11.0”
This name says in what folder you have to place tha files that are inside the folder(if some folder don’t exist make it).
REMEMBER TO WRITE ALL IN LOWERCASE
android=ROM folder; in my example is “DU”
device=this folder will be inside ROM folder, in my case “DU/device”
motorola=if this folder don’t exist make it
spyder=this folder will contain all the files that are into the zip inside “android_device_motorola_spyder-cm-11.0”
If you do all the steps well you will have something like this:
Inside this folder you will find some files, you you have to open one named “cm.dependencies”, inside this file you will find some lines like this:
HTML:
[
{
"repository": "android_device_motorola_omap4-common",
"target_path": "device/motorola/omap4-common"
},
{
"repository": "android_kernel_motorola_omap4-common",
"target_path": "kernel/motorola/omap4-common"
}
]
This repositories you have to download and put in the folder that says “target_path”
To find it faster only add repository name at the end of this in firefox:
https://github.com/CyanogenMod/
in my case this will be like this:
https://github.com/CyanogenMod/android_device_motorola_omap4-common
and again you have to do the same like device(choose branch, and download as a ZIP) but you have to put the files into the correct folder, in this case I have to put it in DU/device/motorola/omap4-common.
And the same with Kernel:
https://github.com/CyanogenMod/android_kernel_motorola_omap4-common
But you have to put this in the correct folder, in my case: DU/kernel/motorola/omap4-common
Remember: If the folder didn’t exist make it and DON’T PUT THE FOLDER THAT COME INSIDE THE ZIP INSIDE THE FOLDER THAT YOU MAKE, put the files only, like this: DU/kernel/motorola/omap4-common ->>> in this folder you have to put all the files that came into the folder “android_kernel_motorola_omap4-common” inside the zip.
And finally you have to find your vendor folder, for this device "motorola", download from here and put this in the correct folder, in my case: DU/vendor/motorola(inside "motorola" you have to see other folder with the name of the devices, if you see this you are ready)
Thats all for now, you have all the files to make the rom to your device(IF YOU ARE BUILDING A CM BASED ROM).
Making NON-CM based ROMS​
If you want to build a non-CM based ROM you may have to change some files in your device folder, there are a lot of roms that need this changes so I can't explain all but in general you have to make changes(NOT IN OMAP4 FOLDERS) in "cm.mk", "AndroidProducts.mk", in this web you can see all the changes needed to build OMNIROM, not all the roms have this tutorials, so if you want ask me in this post(not PM me) I can help you, and I can modify and upload the file to be usefull for everyone. A little trick, all the roms that are non-CM based need changes in "cm.mk"(and maybe only with this change you can build the rom), you have to change the name of this file and edit this two lines:
"$(call inherit-product, vendor/cm/config/common_full_phone.mk)"
"PRODUCT_NAME := cm_spyder" or "PRODUCT_NAME := cm_umts_spyder"(obviusly depending wich device you open)
for DU for example you have to change like this:
"$(call inherit-product, vendor/du/config/common.mk)"(this is the same for all phones to build DU)
"PRODUCT_NAME := du_spyder" or "PRODUCT_NAME := du_umts_spyder"(depending wich device you open)
The first line is easy, for other roms only go to *Working folder*/vendor/*name of the rom*/config(in some roms is "configs") and here find the .mk file like "common" or "common_phone".
Or other way is to go to the github page and find a supported device and compare name of files and other things.
Then you have to create a new file named vendorsetup.sh in the device repo(doing this your device will appear to build later)
"add_lunch_combo *vendorROM*_*device*-userdebug"
OMNI ROM TUTORIAL TO PORT A DEVICE:
http://docs.omnirom.org/Porting_Omni_To_Your_Device
Make Changes on BASE to build​PLEASE THIS IS FOR ADVANCED USERS, AND IF YOU WANT TO TRY FIRST OF ALL TRY TO BUILD ONCE WITHOUT THIS STEP, BECAUSE IF YOU MADE A BAD CHANGE YOUR ROM CAN BE UNUSABLE
Not all the devices have the same hardware posibilities, so some options are disabled, but once you build the ROM you can't enable it(some, not all), so you have to find the "config" file to make some changes and add functions. The config file that I'm refering you can find it in:
*Working folder*(in my case: DU)/framework/base/core/res/res/values/config.xml
and this file looks like this https://github.com/AOKP/frameworks_base/blob/kitkat/core/res/res/values/config.xml
Usually the lines that appears at the bottom are the variables from the rom, so I recomend to start from the bottom and then go up, PLEASE READ CAREFULLY ALL THE VARIABLES, don't pretend to enable funtions that the device can't support, and don't make any changes to variables that you don't know.
Some lines that appears in some config files that can be activated:
HTML:
<integer name="config_deviceHardwareKeys">0</integer>
HTML:
<bool name="config_enableWifiDisplay">false</bool>
HTML:
<bool name="config_allowAllRotations">false</bool>
(THIS IS FOR EXPERTS BUT IF YOU WANT TO BE AN EXPERT I'LL TOLD YOU SOME TRICKS, IF YOU SEE THE LINES ABOVE AND YOU DON'T KNOW WHAT THIS MEANS FIRST READ IN THE FILE "CONFIG.XML" ABOVE THE VARIABLE AND YOU CAN KNOW MORE ABOUT IT, AND THEN PAY ATTENTION TO THIS:
Example:
<bool name="config_allowAllRotations">false</bool>
IN BLUE YOU CAN SEE THE NAME OF THE CHANGE, OBVIOUSLY THIS ENABLE ALL SCREEN ROTATIONS
AND IN GREEN YOU CAN SEE THE VALUE OF THIS VARIABLE(THIS VALUE CAN BE, A NUMBER OR "true" OR "false")
Commands for build​
If you read other guides you can see that appears a lot of commands to build a ROM, like breakfast, brunch, bacon, etc. I recomend to use "make otapackage" "mka bacon" or "time mka bacon"
Build​
The last step is build the ROM, to do this go to a terminal and go into your working folder, then initialize the repo(supposing that you have follow all the other steps and have a full repo sync) and put this command: "lunch", after this you will see all the devices supported to build, if you do all OK you will be able to see your device in the list, so only pick the number of your device and then in terminal will appear all the information about the device, finaly put "time mka bacon" or "make otapackage" and the terminal will start building the ZIP, the first command "time mka bacon" will build the rom using all the resources of your computer(so the build will be faster) and at the end you can se the time that it tooks.(depending if you are building in a VM or Native OS, and the specs of your computer it will take a time, in a VM for example my computer with 5GB of RAM and 3 cores(at 3.5GHz) can make one build in 6 hours, but in native OS with 6 cores and 16GB of RAM tooks 30 minutes).
ESPECIAL THANKS TO: @sylentprofet and nathanpfry.com (for the VM and OS)
Thanks for reading and sorry for my English.
Regards

I found this link: https://github.com/SimpleAOSP-Lollipop/platform-manifest, can I build this for umts spyder? In the read me, there are nexus only supported device...is this means a port if a want it on razr? Thanks in advance..
Im a noob in this kind of stuffs.....wanna make my own rom...well tried to make one...if possible....
Edit: its not public so cant use it i guess
Btw, i have error in init repo -u command, fatal error cant find username...or something like that
And where should i open terminal in builduntu? Desktop, home or else? Thanks..
Hello me!! Its me again!!

nice guide but one issue
device/motorola/omap4-common/Android.mk:43: *** my-dir must be called before including any other makefile.. Stop.
i m getting this error while i m building it ... plz help..

Related

[TUTORIAL][WIP] Working with GIT and GITHUB for Android Source

Working with GIT and GITHUB
for Android Source
I want to start by saying that I am no EXPERT on GIT, but I believe the best way to learn is through trial and error. Through my trials and errors, this is what I have found that works when working with Android Source Code (AOSP).
I started my Android Development basically porting and hacking Android Operating Systems for the HTC Thunderbolt. In my opinion I learned the basics plus some, and was able to create stable builds, which most users found enjoyable to operate. In my quest to further improve my Android development skills, I moved on the next step in Android Operating System development, build a custom AOSP ROM from source. I soon started browsing other developers GITHUB repositories and tried my best to figure out what was going on behind the scenes, in order to share my code with others and visa versa. This lead me to setting up a development platform, downloading the latest (at the time ICS) source and then compiling everything, to obtain, a fresh updated ROM. Obviously, the next step was editing the code to my liking and then trying to figure out how to update my code (push) to Github for version tracking and also hosting purposes. I shopped around on the net for GIT tutorials, and for the life of me, I could not figure out how to make things work the way they should. After doing research on the REPO command (which I came to find was basically the same as GIT but updated to work better with Android) I became more confused. I never found an article or tutorial which explained step-by-step the processes in which I am about to explain, which is why I decided to take the time to compose this tutorial.
Finally, through many hours of research and frustration, I came up with the answers I was so diligently seeking. Here are my findings:
The following Tutorial is for an INITIAL COMMIT of your source to GITHUB. Once you accomplish sending the initial data over, sending only changes thereafter, is very similar, but doesn't require as many steps.
Prerequisites:
(1) Create an account on GITHUB.com
(2) Download the Android Source into a working directory (in my case "android").
(3) Generate your Private SSH Keys for GITHUB (this will allow you to push files without logging in every time) You will find easy to understand directions HERE
For this example I will be working with the following variables:
My default Android directory: ~/android
For this tutorial I will editing the Setting.apk source code in order to add "XYZ" functionality
The source code for the Settings.apk is located in ~/android/packages/apps/Settings
So lets BEGIN!
First Step: You want to go into the directory where you are editing the source.
Code:
cd ~/android/packages/apps/Settings
Second Step: Initialize the Settings source folder and create a git repository
(which will track all changes)
Code:
git init
Third Step: Now you want to log-in to GITHUB and create a repository for your updated Settings source to go. In my case I created a folder on GUTHUB called android_packages_apps_Settings
Forth Step: After you have created your repository on GITHUB, from your Settings source folder, you need to tell git where to push the changes you have made. When you do the initial push, it is actually going to push all of the files in the Settings source folder including the changes you have made. Do this by typing the following command:
Code:
git remote add github [email protected]:yourusername/android_packages_apps_Settings.git
Obviously, you are going to change "yourusername" to whatever username you created on GITHUB.
Fifth Step: Add the entire Settings directory to git so that it starts tracking your additions, deletions, changes, etc for the entire directory.
Code:
git add -A
Sixth Step: Commit the changes that you made to the files in order to push to GITHUB. Now for this example, I want to commit changes to ALL files in the Settings folder.
Code:
git commit -a
If I wanted to just commit changes to one specific file, I would use "git commit whateverfile.java". After you commit, a text editor is going to pop-up. This is where you add the description for the change(s) you have made. If you have detailed change-log of each file you changed, you will not want to use the "git -a" command because the description you enter there is going to be the description for all of the files you edited.
Seventh Step: Now you want to change to the branch you plan on using to push your content. In my case its "jellybean".
Code:
git branch jellybean
Eighth Step: Finally you will now push your initial Settings commit to github. In order to do this, type:
Code:
git push github jellybean
This is going to push github ("github" is the name you gave the REMOTE when you executed the "git remote add" above) to a branch on GITHUB.com called "jellybean". You can name the branch whatever you like, but obviously naming it to the current Android release name is the easiest to remember for you and others.
You should now see that your computer sent files to GUTHUB.com and if you check online, you should see that your changes have been implemented and copied for the world to access.
I hope this helps people out with Android based git commands. I wish I found somthing like this months ago and maybe I would have a few extra hairs on my head. Let me know if you have any additional questions or would like me to add to this tutorial in any fashion. I will be doing a video shortly which I will post to this thread when complete.
Saved for Questions and Answers . . .
Create repository on github called packages_apps_Settings
Clone it
Code:
git clone https://github.com/lithid/packages_apps_Settings.git
cd packages_apps_Settings
Find the aosp settings and pull that repo so all proper history is still entact. Then merge it.
Code:
git pull https://android.googlesource.com/platform/packages/apps/Settings refs/tags/android-4.1.1_r6
Save it
Now add it all and push to your local repo.
Code:
git push
Hello, how do you create a device tree because I want to build from source but my phone does not yet have one. Thanks
itzdarockz said:
Hello, how do you create a device tree because I want to build from source but my phone does not yet have one. Thanks
Click to expand...
Click to collapse
When you say "a device tree" are you referring to the propriety device drivers and such for a particular device?
MyComputerDoctor said:
When you say "a device tree" are you referring to the propriety device drivers and such for a particular device?
Click to expand...
Click to collapse
I mean to build from source and when picking your lunch such as crespo and crespo 4G i want to add my phone into that. Is that necessary to build from source though?
itzdarockz said:
I mean to build from source and when picking your lunch such as crespo and crespo 4G i want to add my phone into that. Is that necessary to build from source though?
Click to expand...
Click to collapse
Let me know if this helps: http://www.netmite.com/android/mydr...build_new_device.html#androidBuildNewFileTree
Thanks for this tut! I've been wanting to push out sources to my github for a while...but couldn't really find a good tut/didn't have the time to do all the research...this seems like it should get me going with my github and I will definatly be using this tut soon
Sent from my SGH-I997 using Tapatalk 2
question, Let's say I want to merge a commit from CyanogenMod's GitHub ..... I use AOKP's Source, is there a command using git that I can use to facilitate this ??
johnhany97 said:
question, Let's say I want to merge a commit from CyanogenMod's GitHub ..... I use AOKP's Source, is there a command using git that I can use to facilitate this ??
Click to expand...
Click to collapse
Use git cherry-pick but first you need to add the repo
So for example you want a commit from settings first you add CM's settings as a repo with git remote add <name> <url> ....Name can be anything
So it will be $ git add remote cm https://github.com/CyanogenMod/android_packages_apps_Settings
then you can either git fetch cm which will sync all the branches out you can just sync a single branch $ git fetch cm cm-10.1
Now you can use git cherry-pick to cherry-pick the commit from CM settings
$ git cherry-pick <sha1>
e.g
$ git cherry-pick 64c377
Now you will probably need to resolve some conflicts which is hard to explain how to resolve as it varies between has been added where cherry-picked.
can some one ell me how i merge the halo from PA ?
thanks
MyComputerDoctor said:
Working with GIT and GITHUB
for Android Source
I want to start by saying that I am no EXPERT on GIT, but I believe the best way to learn is through trial and error. Through my trials and errors, this is what I have found that works when working with Android Source Code (AOSP).
I started my Android Development basically porting and hacking Android Operating Systems for the HTC Thunderbolt. In my opinion I learned the basics plus some, and was able to create stable builds, which most users found enjoyable to operate. In my quest to further improve my Android development skills, I moved on the next step in Android Operating System development, build a custom AOSP ROM from source. I soon started browsing other developers GITHUB repositories and tried my best to figure out what was going on behind the scenes, in order to share my code with others and visa versa. This lead me to setting up a development platform, downloading the latest (at the time ICS) source and then compiling everything, to obtain, a fresh updated ROM. Obviously, the next step was editing the code to my liking and then trying to figure out how to update my code (push) to Github for version tracking and also hosting purposes. I shopped around on the net for GIT tutorials, and for the life of me, I could not figure out how to make things work the way they should. After doing research on the REPO command (which I came to find was basically the same as GIT but updated to work better with Android) I became more confused. I never found an article or tutorial which explained step-by-step the processes in which I am about to explain, which is why I decided to take the time to compose this tutorial.
Finally, through many hours of research and frustration, I came up with the answers I was so diligently seeking. Here are my findings:
The following Tutorial is for an INITIAL COMMIT of your source to GITHUB. Once you accomplish sending the initial data over, sending only changes thereafter, is very similar, but doesn't require as many steps.
Prerequisites:
(1) Create an account on GITHUB.com
(2) Download the Android Source into a working directory (in my case "android").
(3) Generate your Private SSH Keys for GITHUB (this will allow you to push files without logging in every time) You will find easy to understand directions HERE
For this example I will be working with the following variables:
My default Android directory: ~/android
For this tutorial I will editing the Setting.apk source code in order to add "XYZ" functionality
The source code for the Settings.apk is located in ~/android/packages/apps/Settings
So lets BEGIN!
First Step: You want to go into the directory where you are editing the source.
Code:
cd ~/android/packages/apps/Settings
Second Step: Initialize the Settings source folder and create a git repository
(which will track all changes)
Code:
git init
Third Step: Now you want to log-in to GITHUB and create a repository for your updated Settings source to go. In my case I created a folder on GUTHUB called android_packages_apps_Settings
Forth Step: After you have created your repository on GITHUB, from your Settings source folder, you need to tell git where to push the changes you have made. When you do the initial push, it is actually going to push all of the files in the Settings source folder including the changes you have made. Do this by typing the following command:
Code:
git remote add github [email protected]:yourusername/android_packages_apps_Settings.git
Obviously, you are going to change "yourusername" to whatever username you created on GITHUB.
Fifth Step: Add the entire Settings directory to git so that it starts tracking your additions, deletions, changes, etc for the entire directory.
Code:
git add -A
Sixth Step: Commit the changes that you made to the files in order to push to GITHUB. Now for this example, I want to commit changes to ALL files in the Settings folder.
Code:
git commit -a
If I wanted to just commit changes to one specific file, I would use "git commit whateverfile.java". After you commit, a text editor is going to pop-up. This is where you add the description for the change(s) you have made. If you have detailed change-log of each file you changed, you will not want to use the "git -a" command because the description you enter there is going to be the description for all of the files you edited.
Seventh Step: Now you want to change to the branch you plan on using to push your content. In my case its "jellybean".
Code:
git branch jellybean
Eighth Step: Finally you will now push your initial Settings commit to github. In order to do this, type:
Code:
git push github jellybean
This is going to push github ("github" is the name you gave the REMOTE when you executed the "git remote add" above) to a branch on GITHUB.com called "jellybean". You can name the branch whatever you like, but obviously naming it to the current Android release name is the easiest to remember for you and others.
You should now see that your computer sent files to GUTHUB.com and if you check online, you should see that your changes have been implemented and copied for the world to access.
I hope this helps people out with Android based git commands. I wish I found somthing like this months ago and maybe I would have a few extra hairs on my head. Let me know if you have any additional questions or would like me to add to this tutorial in any fashion. I will be doing a video shortly which I will post to this thread when complete.
Click to expand...
Click to collapse
Did you finish the video tutorial?
Sent from my LG-LS970 using Tapatalk 4 Beta
sooo?
Does anyone have further information on how you would sync back to a master? That is, if I sync from AOSP today, make my own changes, and then a few weeks from now I want to resync to an updated AOSP, how do I do this?

[GUIDE]How to build kernel from Samsung Source/Edit ramdisk[n5110/n5100]

{
"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"
}
Team FAH-Q Presents....
Hey guys the following tutorial is for any thinkerers of Stock Samsung Kernel for Samsung Note 8(n5110/n5100)
*Most kernels work the same way but my guide is using this source
Step One:
Download the samsung kernel source for your device
- www.opensource.samsung.com
- search for your device(in this case I'm using n5110)
- now download source(in this case MI1 source)
- download Beastools as you will need them later.
Step Two:
After source is downloaded you will have a giant zip file
- unzip GT-N5110_SEA_JB_Opensource_Update2.zip
- next you need to unzip the Kernel.tar.gz file(any zip manager should work)
Step Three:
Now you have your source to build your zImage(kernel) so lets get the toolchain!
- get Toolchain from android git server , codesourcery and etc ... arm-eabi-4.4.3
Step Four:
Lets edit the Makefile so it uses the toolchain.
- edit Makefile
edit "CROSS_COMPILE" to right toolchain path(You downloaded).
Ex) CROSS_COMPILE=/usr/local/toolchain/arm-eabi-4.4.3/bin/arm-eabi- // check the location of toolchain
Step Five:
To build the kernel follow these steps.
- Open a terminal
- cd to the location of your kernel source
- exceuted the following two commands:
make kona_01_defconfig
make
- give it some time as it can take up to hours to build depending on your build machine.
Step Six:
Once zImage and modules are built get them together with the ramdisk.
- the following are the locations where to find kernel and modules:
kernel/drivers/scsi/scsi_wait_scan.ko
kernel/drivers/net/wireless/bcmdhd/dhd.ko
kernel/arch/arm/boot/zImage
Step Seven:
Lets extract the ramdisk from a stock boot.img or a recovery.img file.
*use the beastools.zip file attached to this post to complete the following.
- unzip my beastools.zip and place boot.img in the same extracted folder.
- open a terminal and cd to the extracted beastools
- run this command to split ramdisk and zImage:
./split_boot boot.img (if using recovery.img just replace boot.img with recovery.img)
*I have included a script by the name of Unpack_kernel.sh that can save you the last step by just running this command:
./Unpack_kernel.sh (this is if you're lazy lol)
Step Eight:
With your ramdisk extracted make whatever changes you want to it(such as making kernel insecure or whatever)
- grab modules and place them in the ramdisk: ramdisk/lib/modules/ (replace old modules or wifi wont work).
- after modules are placed and ramdisk changes are done continue to step nine.
Step Nine:
Place the ramdisk and zImage in the same beastools unzipped folder
- to repack kernel you can use the script I included called pack_kernel.sh by running( ./pack_kernel.sh)
or
- run the commands on your own:
#Ramdisk Repacking
./mkbootfs ramdisk | gzip > ramdisk-new.gz
cd ramdisk
find . | cpio -o -H newc | gzip > ../newramdisk.cpio.gz
cd ../
#Boot.img repacking
./mkbootimg --kernel zImage --ramdisk newramdisk.cpio.gz -o new_boot.img
Step 10:
You will now have your new kernel named new_boot.img
- rename it to boot.img and flash it through heimdall or make it into a flashable for CWM/TWRP.
My Kernel using these steps and making boot.img insecure/enabling init.d access.
Link: Proton_test_kernel
DISCLAIMER:
As always I am not held responsible for anything that happens with your device by flashing anything I make/guide you through making youself.
I am not responsible if flashing my file makes girls more attracted to you either. lol
Hope you guys found this tutorial useful, if so please hit the thanks/donate buttons
In case some of you notice there's an extra file I didn't use in the beastools, boot_info (this file will be used in another little guide but in short it helps you check the following things:
- page size
- base address
- ramdisk address
- cmdline
for those that didn't notice that was in there, shame on you! lol jk kinda.
Post 2,3 and 4 will be taken by me as i will post other guides such as how to make boot.img insecure and how to properly flash boot.img/recovery.img to our Note 8.0 with heimdall as I've yet to see anyone flash anything with heimdall to this tablet.
** Guides will be leaned toward making your kernel from samsung sources, making a zip file to flash it, how to flash through heimdall, and changes you can make yourself to the ramdisk. I like to keep guides that are about the same aspect of modding in the same thread.
mine! lol
30 seconds is too long of a wait to win the post lol
this post smells lol
Pretty cool how about a guide on porting a touch wiz ROM all guide I seen before only show porting from devices that have the same chipset or same android version I'd love to learn to port
DLM2583 said:
Pretty cool how about a guide on porting a touch wiz ROM all guide I seen before only show porting from devices that have the same chipset or same android version I'd love to learn to port
Click to expand...
Click to collapse
My time is limited full time work and full time school :/
I have a couple of projects including this one to work on for the note 8.
After that, for sure I'll put a guide up just know theres no generic way to port touchwiz as every rom is different and theres alot of kernel dependencies for it to work.
Sent from my SCH-I605 using xda app-developers app
Beastmode said:
Team FAH-Q Presents....
Hey guys the following tutorial is for any thinkerers of Stock Samsung Kernel for Samsung Note 8(n5110/n5100)
*Most kernels work the same way but my guide is using this source
Step One:
Download the samsung kernel source for your device
- www.opensource.samsung.com
- search for your device(in this case I'm using n5110)
- now download source(in this case MI1 source)
- download Beastools as you will need them later.
Step Two:
After source is downloaded you will have a giant zip file
- unzip GT-N5110_SEA_JB_Opensource_Update2.zip
- next you need to unzip the Kernel.tar.gz file(any zip manager should work)
Step Three:
Now you have your source to build your zImage(kernel) so lets get the toolchain!
- get Toolchain from android git server , codesourcery and etc ... arm-eabi-4.4.3
Step Four:
Lets edit the Makefile so it uses the toolchain.
- edit Makefile
edit "CROSS_COMPILE" to right toolchain path(You downloaded).
Ex) CROSS_COMPILE=/usr/local/toolchain/arm-eabi-4.4.3/bin/arm-eabi- // check the location of toolchain
Step Five:
To build the kernel follow these steps.
- Open a terminal
- cd to the location of your kernel source
- exceuted the following two commands:
make kona_01_defconfig
make
- give it some time as it can take up to hours to build depending on your build machine.
Step Six:
Once zImage and modules are built get them together with the ramdisk.
- the following are the locations where to find kernel and modules:
kernel/drivers/scsi/scsi_wait_scan.ko
kernel/drivers/net/wireless/bcmdhd/dhd.ko
kernel/arch/arm/boot/zImage
Step Seven:
Lets extract the ramdisk from a stock boot.img or a recovery.img file.
*use the beastools.zip file attached to this post to complete the following.
- unzip my beastools.zip and place boot.img in the same extracted folder.
- open a terminal and cd to the extracted beastools
- run this command to split ramdisk and zImage:
./split_boot boot.img (if using recovery.img just replace boot.img with recovery.img)
*I have included a script by the name of Unpack_kernel.sh that can save you the last step by just running this command:
./Unpack_kernel.sh (this is if you're lazy lol)
Step Eight:
With your ramdisk extracted make whatever changes you want to it(such as making kernel insecure or whatever)
- grab modules and place them in the ramdisk: ramdisk/lib/modules/ (replace old modules or wifi wont work).
- after modules are placed and ramdisk changes are done continue to step nine.
Step Nine:
Place the ramdisk and zImage in the same beastools unzipped folder
- to repack kernel you can use the script I included called pack_kernel.sh by running( ./pack_kernel.sh)
or
- run the commands on your own:
#Ramdisk Repacking
./mkbootfs ramdisk | gzip > ramdisk-new.gz
cd ramdisk
find . | cpio -o -H newc | gzip > ../newramdisk.cpio.gz
cd ../
#Boot.img repacking
./mkbootimg --kernel zImage --ramdisk newramdisk.cpio.gz -o new_boot.img
Step 10:
You will now have your new kernel named new_boot.img
- rename it to boot.img and flash it through heimdall or make it into a flashable for CWM/TWRP.
My Kernel using these steps and making boot.img insecure/enabling init.d access.
Link: Proton_test_kernel
DISCLAIMER:
As always I am not held responsible for anything that happens with your device by flashing anything I make/guide you through making youself.
I am not responsible if flashing my file makes girls more attracted to you either. lol
Hope you guys found this tutorial useful, if so please hit the thanks/donate buttons
In case some of you notice there's an extra file I didn't use in the beastools, boot_info (this file will be used in another little guide but in short it helps you check the following things:
- page size
- base address
- ramdisk address
- cmdline
for those that didn't notice that was in there, shame on you! lol jk kinda.
Post 2,3 and 4 will be taken by me as i will post other guides such as how to make boot.img insecure and how to properly flash boot.img/recovery.img to our Note 8.0 with heimdall as I've yet to see anyone flash anything with heimdall to this tablet.
** Guides will be leaned toward making your kernel from samsung sources, making a zip file to flash it, how to flash through heimdall, and changes you can make yourself to the ramdisk. I like to keep guides that are about the same aspect of modding in the same thread.
Click to expand...
Click to collapse
Nice 1.
I'll try this method for build different model.
Beastmode said:
Team FAH-Q Presents....
Hey guys the following tutorial is for any thinkerers of Stock Samsung Kernel for Samsung Note 8(n5110/n5100)
*Most kernels work the same way but my guide is using this source
Step One:
Download the samsung kernel source for your device
- www.opensource.samsung.com
- search for your device(in this case I'm using n5110)
- now download source(in this case MI1 source)
- download Beastools as you will need them later.
Step Two:
After source is downloaded you will have a giant zip file
- unzip GT-N5110_SEA_JB_Opensource_Update2.zip
- next you need to unzip the Kernel.tar.gz file(any zip manager should work)
Step Three:
Now you have your source to build your zImage(kernel) so lets get the toolchain!
- get Toolchain from android git server , codesourcery and etc ... arm-eabi-4.4.3
Step Four:
Lets edit the Makefile so it uses the toolchain.
- edit Makefile
edit "CROSS_COMPILE" to right toolchain path(You downloaded).
Ex) CROSS_COMPILE=/usr/local/toolchain/arm-eabi-4.4.3/bin/arm-eabi- // check the location of toolchain
Step Five:
To build the kernel follow these steps.
- Open a terminal
- cd to the location of your kernel source
- exceuted the following two commands:
make kona_01_defconfig
make
- give it some time as it can take up to hours to build depending on your build machine.
Step Six:
Once zImage and modules are built get them together with the ramdisk.
- the following are the locations where to find kernel and modules:
kernel/drivers/scsi/scsi_wait_scan.ko
kernel/drivers/net/wireless/bcmdhd/dhd.ko
kernel/arch/arm/boot/zImage
Step Seven:
Lets extract the ramdisk from a stock boot.img or a recovery.img file.
*use the beastools.zip file attached to this post to complete the following.
- unzip my beastools.zip and place boot.img in the same extracted folder.
- open a terminal and cd to the extracted beastools
- run this command to split ramdisk and zImage:
./split_boot boot.img (if using recovery.img just replace boot.img with recovery.img)
*I have included a script by the name of Unpack_kernel.sh that can save you the last step by just running this command:
./Unpack_kernel.sh (this is if you're lazy lol)
Step Eight:
With your ramdisk extracted make whatever changes you want to it(such as making kernel insecure or whatever)
- grab modules and place them in the ramdisk: ramdisk/lib/modules/ (replace old modules or wifi wont work).
- after modules are placed and ramdisk changes are done continue to step nine.
Step Nine:
Place the ramdisk and zImage in the same beastools unzipped folder
- to repack kernel you can use the script I included called pack_kernel.sh by running( ./pack_kernel.sh)
or
- run the commands on your own:
#Ramdisk Repacking
./mkbootfs ramdisk | gzip > ramdisk-new.gz
cd ramdisk
find . | cpio -o -H newc | gzip > ../newramdisk.cpio.gz
cd ../
#Boot.img repacking
./mkbootimg --kernel zImage --ramdisk newramdisk.cpio.gz -o new_boot.img
Step 10:
You will now have your new kernel named new_boot.img
- rename it to boot.img and flash it through heimdall or make it into a flashable for CWM/TWRP.
My Kernel using these steps and making boot.img insecure/enabling init.d access.
Link: Proton_test_kernel
DISCLAIMER:
As always I am not held responsible for anything that happens with your device by flashing anything I make/guide you through making youself.
I am not responsible if flashing my file makes girls more attracted to you either. lol
Hope you guys found this tutorial useful, if so please hit the thanks/donate buttons
In case some of you notice there's an extra file I didn't use in the beastools, boot_info (this file will be used in another little guide but in short it helps you check the following things:
- page size
- base address
- ramdisk address
- cmdline
for those that didn't notice that was in there, shame on you! lol jk kinda.
Post 2,3 and 4 will be taken by me as i will post other guides such as how to make boot.img insecure and how to properly flash boot.img/recovery.img to our Note 8.0 with heimdall as I've yet to see anyone flash anything with heimdall to this tablet.
** Guides will be leaned toward making your kernel from samsung sources, making a zip file to flash it, how to flash through heimdall, and changes you can make yourself to the ramdisk. I like to keep guides that are about the same aspect of modding in the same thread.
Click to expand...
Click to collapse
Thanks. I have looked for something like this for a while. Do you think this would work for a Galaxy Note 3? I am not asking for an exact answer; rather do know of any reason it would not? Should I use a different tool? Any gotchas? etc.
Beastmode said:
Step Seven:
Lets extract the ramdisk from a stock boot.img or a recovery.img file.
*use the beastools.zip file attached to this post to complete the following.
- unzip my beastools.zip and place boot.img in the same extracted folder.
Click to expand...
Click to collapse
Hi and thank you for the great post. I have been able to ceate the image and modules for a Note 3 device. I am not sure which boot.img you are referting to. Where do I get this? I did a search on my machine, and I don't have it. Do I need to get this file somewhere else online since I am working on a different device? I really appreciate your advice.
Code:
[email protected]:~/Kernel$ make kona_01_defconfig
HOSTCC scripts/kconfig/conf.o
SHIPPED scripts/kconfig/zconf.tab.c
SHIPPED scripts/kconfig/zconf.lex.c
SHIPPED scripts/kconfig/zconf.hash.c
HOSTCC scripts/kconfig/zconf.tab.o
HOSTLD scripts/kconfig/conf
drivers/usb/gadget/Kconfig:1107:warning: leading whitespace ignored
drivers/motor/Kconfig:38:warning: type of 'BCM_SS_VIBRA' redefined from 'boolean' to 'tristate'
arch/arm/mach-hawaii/Kconfig:272:warning: choice value used outside its choice group
arch/arm/mach-hawaii/Kconfig:277:warning: choice value used outside its choice group
arch/arm/mach-hawaii/Kconfig:282:warning: choice value used outside its choice group
arch/arm/mach-hawaii/Kconfig:304:warning: choice value used outside its choice group
arch/arm/mach-hawaii/Kconfig:287:warning: choice value used outside its choice group
arch/arm/mach-hawaii/Kconfig:331:warning: choice value used outside its choice group
arch/arm/mach-hawaii/Kconfig:336:warning: choice value used outside its choice group
***
*** Can't find default configuration "arch/arm/configs/kona_01_defconfig"!
***
make[1]: *** [kona_01_defconfig] Error 1
make: *** [kona_01_defconfig] Error 2
PLEASE HELP
Hi
is this method can change the SElinux status ? ( I want to change it to permissive )

[GUIDE] How-To Cherry-Pick Features for your ROM (both GitHub and Gerrit)

Hi guys. So I've had a few people PM me and ask for help cherry picking features to build a ROM from source. I've decided I might as well post a guide with what I've gathered. I'll outline the procedure for cherry-picking from both gerrit as well as GitHub, and what to do afterwards.
Once you've completed the guide, feel free to post questions/comments/advice in the thread. If you run into any issues, I will be happy to answer them (along with other helpful members of our community). If you think I should add something to the guide or change something, also feel free to let me know. I haven't noticed any good resource concerning cherry-picking on XDA, so discussion is encouraged.
Before we begin cherry-picking, I'm going to be making a few assumptions. I assume that:
you are using Ubuntu (or another Linux distribution) and you have git installed
you have the source code for your ROM downloaded on your PC
you know how to compile your ROM
you are somewhat comfortable using the terminal
Let's get started!
Table of contents:
1. Cherry-Picking from Gerrit
2. Cherry-Picking from GitHub
3. Conflict Resolution
4. Troubleshooting/After the Cherry-Pick
Cherry-Picking from Gerrit
Cherry Picking a feature from Gerrit
To begin cherry-picking, you should first go to the gerrit for your desired cherry-pick and find its entry/entries. I'll cherry-pick Halo from the ParanoidAndroid gerrit into AOSP.
Because I want Halo, I'll open go to ParanoidAndroid gerrit at http://gerrit.paranoidandroid.co and find the Halo entries. This is what it looks like:
{
"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"
}
You'll notice there are two Halo entries, one titled [1/2] Settings: HALO, and one titled [2/2] Frameworks: HALO. To get this feature, I'll need both, hence the tags 1/2 and 2/2 at the beginning. Here are the links for reference:
[1/2] Settings: HALO
[2/2] Frameworks: HALO
Great, now we have the entries for the two “commits” that we want to add to our ROM. We'll start with the first one. The page may look overwhelming at first, but there are two bits that are most important to us: the Project tag and the Download tab. Here's what they look like:
Look at the project title. It says “AOSPA/android_packages_apps_Settings”. This tells us exactly where in our source code to apply this commit. On my system, I have AOSP downloaded to the folder ~/AOSP. I open a terminal and enter the command “cd ~/AOSP”. Replace “AOSP” with your code directory.
Now, in your terminal, type:
Code:
cd packages/apps/Settings
Now that you're in the right spot, it's time to download the commit and try to apply it. Click the download tab in your browser, then from the dropdown choose “anonymous HTTP” and choose “cherry-pick”. Here's what it looks like:
When you click the clipboard next to the “Cherry-Pick” option, it'll copy to your clipboard. Now, go back to your terminal and press CTRL + Shift + V to paste it.
Code:
git fetch https://gerrit.paranoidandroid.co/AOSPA/android_packages_apps_Settings refs/changes/39/239/14 && git cherry-pick FETCH_HEAD
Chances are, unless you're very lucky, your terminal will do some work and look like this:
To continue, skip to post #4
Cherry-Picking a Feature from GitHub
Cherry-Picking a Feature from GitHub
To begin cherry-picking, you need to find the GitHub “commit” for what you want. A commit is a record of the changes that were made to achieve something, whether it be a new feature or a bug fix.
Today, I'm going to take pure AOSP and cherry-pick ParanoidAndroid's Halo. Because ParanoidAndroid gave up the feature, I can't take it from their GitHub. Conveniently, I have it in my own GitHub and will use that.
Note: you will only find things that have already been added to a project's code on GitHub. ParanoidAndroid gave up on Halo, so it is not added to their code. Because it is not already merged, it will not be in GitHub
First things first, you locate the commit. I know it's in my GitHub, so I'll open that in my browser at http://github.com/jabza-. I already know that Halo requires two commits, one for the settings and one for the frameworks. I'll open the projects “aospa_packages_apps_Settings” and “aospa_frameworks_base”. I'll start with the frameworks.
When you open the page, it's a little confusing. We want to see the commits, so we'll click “commits” toward the top.
Now, I'll have to go down the list to the Halo commit. Here's a link for reference: [2/2] Frameworks: HALO
Note: the commit name has [2/2] at the beginning, showing us that it is the 2nd commit of two. The other is in aospa_packages_apps_Settings
Note: my commit history in aospa_frameworks_base currently has two commits for Halo. The more recent one was a bug fix and I mistakenly left the commit message as it is – you want the older commit for the full change
Scroll down to the bottom of the blue commit message. Below it, there' s a list of the files and the changes made. You may use this for reference later, but it's not important now. What's important is the commit ID, which is listed at the bottom of the commit message.
Now, we go to the terminal. I have my AOSP source in ~/AOSP, so when I open my terminal first enter
Code:
cd ~/AOSP
The project name that we are working from is aospa_frameworks_base. This tells us that the commit belongs in frameworks/base. So, to begin work:
Code:
cd frameworks/base
Now, we have to “fetch” the project so we can cherry-pick the commit.
Code:
git fetch git://github.com/jabza-/aospa_frameworks_base.git
Now that we have the commit history of aospa_frameworks_base, we can tell the terminal to cherry-pick. We must use the commit ID at the bottom that we found earlier. You can copy the commit to your clipboard, and paste it in the terminal with CTRL + Shift + V.
Code:
git cherry-pick ab72e4ab36778474593ffce89150aece01d5f9c6
Obviously, when cherry-picking anything else, replace “ab72e4ab36778474593ffce89150aece01d5f9c6” with the commit ID of that commit.
Now, your terminal will do some work, and it will say it couldn't commit it automatically. It should look something like this:
Now, we get to resolve the conflicts. Continue to the next post.
Resolving Conflicts from Cherry-Picking
Resolving Conflicts from Cherry-Picking
So you've found the commit you want to cherry-pick. You've gone to the right place in your source code to apply it. You've told your computer to apply the cherry-pick. It said it couldn't. Now what?
Well let's see what's wrong.
Code:
git status
Your terminal will now tell you what files have been automatically changed for you and what you need to change yourself. In green are the files that are done, and in red are the files you need to tell it what to do with. Here's what your terminal should look like after “git status”:
If you cherry-picked from gerrit with me and did [1/2] Settings: HALO, it'll look something like this:
If you cherry-picked from GitHub with me and did [2/2] Frameworks: HALO, it'll look something like this:
In looking at the files in red, we see two different tags.
deleted by us – this means that there's a file in the commit that doesn't exist on our computer
both modified – this means that there's a file that was supposed to be modified, but that was modified on our computer from what was expected in the commit
deleted by them – this is a third tag you may see, though it's not here. This means that the commit deletes a file which we stil have on our computer
So, what do we do? Let's start with the ones tagged “both modified”. The first file in red underneath the frameworks/base commit is packages/SystemUI/res/layout/status_bar_expanded_header.xml. We'll open it in our favorite text editor and see what it's all about.
Code:
gedit packages/SystemUI/res/layout/status_bar_expanded_header.xml
Now we search for what's messing with our cherry-pick. It's enclosed in the tags “<<<<<<< HEAD” and “>>>>>>> ab72e4a... [2/2] Frameworks: HALO”. Lines 78-118 look like this:
Code:
<<<<<<< HEAD
android:layout_width="50dp"
android:layout_height="50dp"
android:scaleType="center"
android:src="@drawable/ic_notify_clear"
android:background="@drawable/ic_notify_button_bg"
android:contentDescription="@string/accessibility_clear_all"
/>
=======
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_marginLeft="4dp"
android:scaleType="center"
android:src="@drawable/ic_notify_clear"
android:background="@drawable/ic_notify_button_bg"
android:contentDescription="@string/accessibility_clear_all"
/>
<FrameLayout android:id="@+id/context_button_holder"
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_marginStart="4dp"
>
<ImageView android:id="@+id/halo_button"
android:layout_width="50dp"
android:layout_height="50dp"
android:scaleType="center"
android:src="@drawable/ic_notify_halo"
android:contentDescription="@string/accessibility_halo"
/>
<ImageView android:id="@+id/edit_mode_button"
android:layout_width="50dp"
android:layout_height="50dp"
android:scaleType="center"
android:src="@drawable/ic_notify_edit_normal"
android:background="@drawable/ic_notify_button_bg"
android:visibility="gone"
android:contentDescription="@string/accessibility_clear_all"
/>
</FrameLayout>
>>>>>>> ab72e4a... [2/2] Frameworks: HALO
Between the <<<<<< HEAD and ======== is code that wasn't expected to be there. Between ====== and >>>>>> ab72e4a... [2/2] Frameworks: HALO is the code that was added in by the commit. Here is where we use our judgement to edit the code to what we need. Because I can see that the code between <<<<<< HEAD and ====== is duplicated by the commit, I can just delete that snippet altogether. We also need to delete the tags added by our cherry pick. In the end, the code looks like this:
Code:
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_marginLeft="4dp"
android:scaleType="center"
android:src="@drawable/ic_notify_clear"
android:background="@drawable/ic_notify_button_bg"
android:contentDescription="@string/accessibility_clear_all"
/>
<FrameLayout android:id="@+id/context_button_holder"
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_marginStart="4dp"
>
<ImageView android:id="@+id/halo_button"
android:layout_width="50dp"
android:layout_height="50dp"
android:scaleType="center"
android:src="@drawable/ic_notify_halo"
android:contentDescription="@string/accessibility_halo"
/>
<ImageView android:id="@+id/edit_mode_button"
android:layout_width="50dp"
android:layout_height="50dp"
android:scaleType="center"
android:src="@drawable/ic_notify_edit_normal"
android:background="@drawable/ic_notify_button_bg"
android:visibility="gone"
android:contentDescription="@string/accessibility_clear_all"
/>
</FrameLayout>
Now we can save and quit.
We've resolved the conflict (assuming that was the only one), and now we can mark it as such in the terminal. To do so, we use this command:
Code:
git add packages/SystemUI/res/layout/status_bar_expanded_header.xml
Now, we can do “git status” again and work on the next file we need to modify.
But what about the “deleted by us” files? Well, git is smart. All we need to do is determine if we need those files (hint: unless you really know what you're doing, you do need them). If we need them, git already loaded the files up, so we just have to mark them as resolved by doing
Code:
git add res/values/pa_arrays.xml
You can replace “res/values/pa_arrays.xml” with the rest of the files labeled “deleted by us”. You can also do more than one file at once, like so:
Code:
git add res/values/pa_arrays.xml res/values/pa_strings.xml whatever/files/I/want.java
Continue until you've fixed all the issues.
Note: when you open a file in gedit, it creates a file with the same name but with a ~ added to the end. When you do “git status” these files will show up as “untracked files”. You can either delete them with the command “rm path/to/file.java~” or just ignore them.
Once you do “git status” and all the files turn up green, you have finished resolving the conflicts. Now is the best time to compile your ROM and see if your changes worked. If you're in a rush (or lazy or don't feel like waiting for a ROM to compile or you've already tested it), you can now commit your changes.
Code:
git commit
It'll take you to a screen to write your commit message. It opens it in the in-terminal editor “nano”. You can edit it to say whatever you want, and when you're done press CTRL + X to exit, and then press Y to save the changes. Then your terminal will say you've committed the changes.
Congratulations! You've successfully cherry-picked a commit.
Troubleshooting/After the Cherry-Pick
Troubleshooting/After the Cherry-Pick
Once you've finished adding a cherry-pick, a whole variety of things can happen. You might:
build, and it will stop with some build erros
build, and it will complete, but something will go wrong when you flash it
want to get rid of the cherry-picks altogether
Well, what do you do?
If you build, and it stops building, there will be build errors. Your terminal will tell you what's wrong. Look/scroll up, and there will be something that says:
Code:
path/to/file/problem.java:86: some sort of error ocurred
line.of(code, that causes); a problem {
^
The first thing it says is a file. It will be a path relative to the part it was compiling, so you might have to look for a clue above that to see where it was working on. At the end of the file is a number (in this case 86). That number tells you what line the problem is on in that file. After that, it tells you what the error was that in ran into. Then, it'll print the line that had the error with a carat (^) underneath where it had an issue.
How do you fix it? Just open up the file with something like
Code:
gedit path/to/file/problem.java
and go to line 86 and see what the problem is. Usually it's something pretty straightforward, like mismatched parentheses or a dropped semicolon. Once you've fixed the issue, save the file and build again!
But what about if the build is successful, but it causes bugs in your build? Well, start up your phone plugged into your computer, and use this command:
Code:
adb logcat > errorlog
Once the phone becomes available, your computer will start recording the logcat to the file errorlog. Once you've captured the bug, then you can disconnect your phone and reflash something stable. You can also use CTRL + C to stop the logcat command. Now, you can open the logcat with the command
Code:
gedit errorlog
Reading logcats may take some getting used to. It will take quite a bit of scrolling, but the errors are probably marked with an E at the beginning of the line.
Now, what about if you've got some issues, and you just want to scrap the cherry-picks? Well, it's pretty straightforward. Just use
Code:
repo sync
and all committed cherry-picks will be wiped out and you'll be synced with the source that you're building from/
What if you want to do a repo sync and keep that commit, you ask? Don't worry! Git is smart. It remembers how you resolved the cherry-pick. You can do a repo sync and then cherry-pick again, and it'll automatically try to apply your previous resolution. Neat, huh?
Alternatively, you can fork the project to your own git repository (GitHub accounts are free for students!) and add that to your repo manifest. That's a whole different story, though, and will require extra research.
You should also mention how to cherry pick multiple commits
was looking for a guide like this for modding my build...gr8 guide...
AWSM !!
Just when I decided to make some personal builds, this shows up. Thank you so much! You're awesome!
Sent from my Nexus 7 using Tapatalk
Grarak said:
You should also mention how to cherry pick multiple commits
Click to expand...
Click to collapse
I would like to know this too, when I try to add two commits to the same location, it wants to drop one and add the other. I want to keep both but I cant figure out how to do so. Thanks for your help!
Great guide. It really helps noobs like me xD. One question what are the repositories I should fork from paranoid android into my github to build a ROM for nexus 4. Their github have soooo many repositories like apps and settings, packages, manifest etc etc
Sent from my Nexus 4 using Tapatalk
Grarak said:
You should also mention how to cherry pick multiple commits
Click to expand...
Click to collapse
SleepyS40 said:
I would like to know this too, when I try to add two commits to the same location, it wants to drop one and add the other. I want to keep both but I cant figure out how to do so. Thanks for your help!
Click to expand...
Click to collapse
Cherry-picking multiple commits is pretty straightforward. Once you've resolved any conflicts for one commit, you have to finish by using the command
Code:
git commit
if you want to add another cherry-pick in the same location.
Once you've committed that, you should be able to start the cherry-picking process over again exactly the same. If you have an issue, can you tell me what your terminal says, or post a screenshot?
Walterwhite007 said:
Great guide. It really helps noobs like me xD. One question what are the repositories I should fork from paranoid android into my github to build a ROM for nexus 4. Their github have soooo many repositories like apps and settings, packages, manifest etc etc
Sent from my Nexus 4 using Tapatalk
Click to expand...
Click to collapse
To build ParanoidAndroid, you first have to download the source to your computer. So you'd have to make a directory and use "repo init -u http://github.com/AOSPA/manifest.git -b kitkat && repo sync" to start the download. It's a big download, so be ready to wait a couple hours. There's a good guide for building ParanoidAndroid 4+ here
However, as far as forking a repository, you only need to fork the repositories that you want to make your own changes to and keep track of. Really, you don't have to fork anything.
Nicely written.
karanrajpal14 said:
Just when I decided to make some personal builds, this shows up. Thank you so much! You're awesome!
Sent from my Nexus 7 using Tapatalk
Click to expand...
Click to collapse
+100
Took the workds right outta my mouth!!:laugh::highfive:
I have the source code. But when I successfully cherry pick some commits and when I say gitpush it says access denied something. I want to fork pa's nexus 4 ROM sources into my git repository so that I can sync from my github and build. But what are the things I need to fork??
Walterwhite007 said:
I have the source code. But when I successfully cherry pick some commits and when I say gitpush it says access denied something. I want to fork pa's nexus 4 ROM sources into my git repository so that I can sync from my github and build. But what are the things I need to fork??
Click to expand...
Click to collapse
Well yeah, git push tries to send your changes to the repository you took it from - in this case, PA's. For obvious reasons, you don't have permissions to push changes to the PA github. You just have to fork the repos you want to change and add them in your repo manifests. If you want the entire ROM in your git, you'll have to look at all the projects in .repo/manifest.xml and fork every single one. That's a little excessive, so just fork the repos you want to change.
jabza said:
Well yeah, git push tries to send your changes to the repository you took it from - in this case, PA's. For obvious reasons, you don't have permissions to push changes to the PA github. You just have to fork the repos you want to change and add them in your repo manifests. If you want the entire ROM in your git, you'll have to look at all the projects in .repo/manifest.xml and fork every single one. That's a little excessive, so just fork the repos you want to change.
Click to expand...
Click to collapse
Thanks bro. I tried many times cherry picking halo but that always messed up. Now after following this great guide I'll give it another try !!
Say my name
Thank you so much for the awesome thread..:good:
Very good tutorial :good:
But I've two question:
- What does the command "git commit" do? Will the rom compile without the cherry-pick without this command?
- Can I compile a flashable zip for my rom just with the cherry-pick and without compiling the whole rom again?
I was hoping that someone could help me here so the problem is that I am trying to build OMNI ROM for mako but even after following the guide I dont't see any zip out/target/product/mako. I followed this guide http://docs.omnirom.org/Build_for_mako
xxLeoxx93 said:
Very good tutorial :good:
But I've two question:
- What does the command "git commit" do? Will the rom compile without the cherry-pick without this command?
- Can I compile a flashable zip for my rom just with the cherry-pick and without compiling the whole rom again?
Click to expand...
Click to collapse
- "git commit" tells your computer it's done with editing and finishes the cherry-pick process. That is when git saves your resolution, so that if you go back and cherry-pick that commit again it can automatically apply your resolution to the problem. The ROM will compile without this command, but you won't be able to use "repo sync" to update that project or add any other cherry-picks to that location until you run "git commit" or "git cherry-pick --abort", which removes the cherry-pick altogether.
- When you rebuild the ROM, as long as you don't use "make clean" or "make clobber", it will only recompile the parts that have changed. The next build will go much faster. If you want the builds to go even faster, you should use ccache.

Create specific device tree for AOSP

I followed official Google`s tutorial to build my own AOSP and succeeded in all steps: I have "Pure AOSP version" running on nexus emulator.
The story is I have some rare device came with some Android version full of pre-installed app's obviously I don't want... So I want to port Pure AOSP to my device - Simple as that, without any improvements or new features (So for example I don`t want to know how to build CM git repo).
Is it working just add to my local above master branch correct files into /device/vendor/model and then under cwd of master branch execute $ . build/envsetup.sh ?
If so, what are the files and their content I need to put under /device/vendor/model ? I found a lot of guides how to pull already existing tree of CM or something else, and looking on some git repo's of several devices, I tried to figure out the minimum complete set of files & their content but I didn't find correlation. I think there must be the minimum complete set and there is programming reason for the existence of each file. And what I saw in existed git repo`s was this set + custom extras each developer added by his own reasons.
Aftermath How do I determine the Build name & Buildtype to exucte $ lunch <Build name>-<Buildtype > ?
How to integrate $ make otapackage in order to build the familiar one zip file to load via recovery like CWM?
Thanks,

Looking to create your own custom kernel? Start here!

INTRODUCTION
I create this guide in the hope to jump start development on our lovely Exynos devices.
I expect that before you start, you have a Linux installation in either a virtual machine or on a physical PC.
Debian Jessie, Kali Linux, Mint, or Ubuntu are excellent choices and what I'm familiar with, so if you get stuck it'll be easier for me to help you if you use these.
PREREQUISITES
WARNING: Custom kernels on the Note 7, S7, and S7 edge currently require encryption to be disabled in order to boot. They also have to disable some secure MobiCore firmware. You will have to format your entire data partition when going from stock kernel to a custom kernel! Once you're on a custom kernel with non-encrypted data, you shouldn't have to wipe it going to another custom kernel.
Be careful not to disable developer options or OEM unlock, otherwise all your data will be destroyed! Back up your data partition whenever you flash stock. (for upgrades, etc.)
First off, you'll want to download some tools necessary for building and downloading kernel sources:
git-core - you'll want git for downloading and maintaining your sources
build-essential - native gcc & tools for building (needed for build commands)
libncurses5-dev - needed to build menuconfig
diff - used to compare config changes
colordiff - used by diff to provide colorful human readable diff output
Code:
apt-get install git-core build-essential libncurses5-dev diff colordiff
PREPARING YOUR ENVIRONMENT
Once you've got that out of the way, you should create an organized environment for working. I like to use ~/build.
Code:
mkdir -p ~/build/toolchain ~/build/kernel
DOWNLOADING & INSTALLING A TOOLCHAIN
You'll want to download a toolchain for kernel building. I recommend using Linaro's optimized ARM toolchains.
The Exynos 8890 benefits from the Cortex-A53 code compiling optimizations.
GCC 4.9: https://releases.linaro.org/components/toolchain/binaries/4.9-2016.02/aarch64-linux-gnu/
GCC 5.X: https://releases.linaro.org/components/toolchain/binaries/latest-5/aarch64-linux-gnu/
The actual file that you want ends in -x86_64_aarch64-linux-gnu.tar.xz (assuming you have a 64-bit Linux install, seriously, 32-bit needs to go! )
We'll use the GCC 5.3.1 2016.5 toolchain in this example.
Let's download and extract it now:
Code:
cd ~/build/toolchain
wget "https://releases.linaro.org/components/toolchain/binaries/latest-5/aarch64-linux-gnu/gcc-linaro-5.3.1-2016.05-x86_64_aarch64-linux-gnu.tar.xz"
tar xf ./*linux-gnu.tar.xz
rm ./*linux-gnu.tar.xz
That's it for installing the toolchain, easy right?
DOWNLOADING THE KERNEL
Rather than download your kernel sources directly from Samsung full of wacky issues when you change a single configuration option, you can grab it from my GitHub!
Using this method, you have an already working stock kernel prepared to be modified and built at your leisure.
You're also able to grab updates and fixes from me should you want them. I'll be committing new kernel source updates from Samsung to the opensource branch.
The stock-6.0 branch will be rebased on top of opensource when that happens, then stock-6.0.y (stock, with Linux updates) will be rebased on top of that.
Cool concept, right?
First, you'll want to create a GitHub account if you don't have one already.
This will allow you to upload your changes and share your kernel with other interested users and developers.
Once you've got your account, and you're logged in, browse to:
https://github.com/jcadduono/android_kernel_samsung_universal8890
You want to fork the sources to your own account, to do this simply click the [Fork | ] button near the top right of the page:
{
"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"
}
Now you've got your own copy of the Note 7 / S7 / S7 edge kernel sources on your GitHub!
The next step is to use git to download it to your PC.
Replace "your_username" with your actual GitHub username. Using [email protected] you can avoid being asked for your username each time you push new changes.
Code:
cd ~/build/kernel
git clone https://[email protected]/your_username/android_kernel_samsung_universal8890 samsung_universal8890
cd samsung_universal8890
The default branch is stock-6.0. This is what most users will want. If you wish to start on a kernel that is updated to the latest Linux minor version, then simply:
Code:
git checkout stock-6.0.y
There's a twrp-6.0 branch that's used for building the kernel inside the official TWRP for Note 7 / S7 / S7 edge.
There's also a nethunter-6.0 branch used to build the kernel used by Kali NetHunter on those devices.
You can use git log <branch> to view commits, and git cherry-pick <commit id> to copy commits from those branches into yours if you like.
CONFIGURING GIT
Before you start working on your kernel, you will need to set up your git profile.
The user values show up in commit messages to tell people who authored them.
Code:
git config --global user.name "Your Name"
git config --global user.email "[email protected]"
git config --global push.default simple
YOUR FIRST COMMIT
We'll want to check out a new branch, and give it your own cool name. I suggest adding a -6.0 suffix to it because you'll probably want to start a new branch when Android 7.0 comes out.
We're going to use "coolname" as our example, so be sure to replace that with what you really want it to be called in the next steps.
Code:
git checkout -B coolname-6.0
Next we'll need to modify the build scripts to fit our setup.
Open build.sh, menuconfig.sh, and dtbgen.sh.
You'll want to set the TOOLCHAIN= path in all 3 scripts. If you're following this guide, then it's already correct!
In menuconfig.sh and build.sh, you'll want to set your default target config name.
See the line:
Code:
[ "$TARGET" ] || TARGET=samsung
You'll want it to look like this:
Code:
[ "$TARGET" ] || TARGET=coolname
Now you want to copy the default samsung kernel configuration so you have your own to work with:
Code:
cp arch/arm64/configs/samsung_defconfig arch/arm64/configs/coolname_defconfig
Now you'll have prepared your kernel source for starting work on your own custom kernel!
Let's turn that into a commit, but first look at the changes you've made using:
Code:
git diff
Does that look good? If not, fix what's broken before proceeding.
Next you'll want to add files that will be part of your commit.
For simplicity's sake, let's just add all of the changed files into the commit.
Code:
git add .
Now to make your commit:
Code:
git commit -m "My first commit, setting up my coolname kernel!"
You've done it!
CONFIGURING YOUR KERNEL
We'll use the menuconfig.sh script to launch the kernel menuconfig.
Code:
./menuconfig.sh
Change whatever options you're interested in, but don't change a lot all at once, otherwise when or if you run into issues, you won't know which option caused it.
Once you're done playing in the menuconfig, exit and save.
You'll be shown a colorful difference between your old configuration and your new one.
It will ask you if you want to save it, and you just have to type "y" and press enter for it to be saved.
At this point it's a good idea to make another commit to save your configuration changes.
If you need to edit the commit, you can easily use git commit --amend to fix it up.
BUILDING YOUR NEW KERNEL
Let's take your new config for a test drive.
To build your kernel, simply run:
Code:
./build.sh gracelte xx
gracelte = Note 7
herolte = S7
hero2lte = S7 edge
xx = International N930F & N930FD
kor = Korean N930K, N930L, & N930S
Yes, you can compile your kernel to all 3 of those devices using just your single config!
The power of device specific config additions.
Once your kernel is finished building, the resulting files will be located at:
Code:
build/arch/arm64/boot/Image
build/arch/arm64/boot/dtb.img
build/modules/*.ko (if modules are enabled)
INSTALLING YOUR NEW KERNEL
The LazyFlasher project comes to the rescue here. It's the swiss army knife of kernel flashing in TWRP.
There's a specific branch for the Note 7 called kernel-flasher-gracelte. (use kernel-flasher-herolte instead if building for S7/S7 edge!)
To download it (feel free to fork it so you can have a copy on your GitHub to modify instead!):
Code:
cd ~/build
git clone -b kernel-flasher-gracelte https://github.com/jcadduono/lazyflasher.git
cd lazyflasher
To use LazyFlasher, you'll probably want to take a look at the Makefile, config.sh, and META-INF/com/google/android/update-binary (a shell script).
There's a few things you can change there to personalize it to your needs.
You should also enter the patch.d folder and delete 060-f2fs-fstab if you don't have f2fs enabled in your kernel, and edit the io_scheduler in 070-kernel-settings if you don't have fiops enabled either.
(make another git commit to save your setup!)
Once the installer is set up to your liking, all you have to do to build it is copy the Image and dtb.img from your build output into the lazyflasher folder.
If you have any modules (.ko files) to install, place them in the modules folder.
Now simply run:
Code:
make
A TWRP flashable zip and sha1sum is created!
At this point, you will need to use the [Format Data] button in TWRP if your device is encrypted! There is no known way around this.
This will wipe all data from your phone, including your internal storage, essentially making it like new.
Transfer it to TWRP and flash away, you've just lost your custom kernel development virginity.
Go have a few beers to celebrate, or to drown your sorrows in the case of a boot loop.
You should consider taking a look at the patch.d scripts sometime so you know what it's actually doing.
PROBLEMS?
Post a reply here and I'll try to find a solution and add it to this post.
RESOURCES
Need a text editor for coding? I use gedit. It's pretty, light, and you can get some decent plugins for it.
It's a minimal editor, so don't expect anything really fancy. Configure it and enable plugins before you decide to trash it.
Code:
apt-get install gedit gedit-plugins
Here's an awesome git starter guide: http://rogerdudler.github.io/git-guide/
THANKS
If not for @Tkkg1994 finding out what changes are needed to get custom kernels up and running, we wouldn't have this lovely guide here!
Thanks for the amazing guide, i got it compiled successfully but the problem comes after the device boots up, it asks for my Pattern and when i enter it, it keeps saying incorrect and wont let me in, any help?
Ather said:
Thanks for the amazing guide, i got it compiled successfully but the problem comes after the device boots up, it asks for my Pattern and when i enter it, it keeps saying incorrect and wont let me in, any help?
Click to expand...
Click to collapse
Sorry, I forgot to add to the guide that custom kernels don't support encryption. You should flash your stock kernel & supersu, install something like titanium backup, and back up all your things to an external SDcard.
I've added a warning in the thread and included it in the instructions now.
that's weird, I disabled lockscreen security and reinstalled the kernel, booted up fine with selinux enforcing http://i.imgur.com/IVSTfV1.png
Ather said:
that's weird, I disabled lockscreen security and reinstalled the kernel, booted up fine with selinux enforcing http://i.imgur.com/IVSTfV1.png
Click to expand...
Click to collapse
Are you still encrypted?
Maybe it's just one of the secure mobicore firmware that were removed that your lock screen depended on. You might be able to set up the lock screen again now, and this time it won't require that specific piece of firmware.
no i had already wiped data when i installed hydra kernel so after flashing my custom kernel i tried to setup the fingerprint and it gave an error that the fingerprint sensor isn't available try later, do you have any idea how to make a decrypted kernel like hydra?
Ather said:
no i had already wiped data when i installed hydra kernel so after flashing my custom kernel i tried to setup the fingerprint and it gave an error that the fingerprint sensor isn't available try later, do you have any idea how to make a decrypted kernel like hydra?
Click to expand...
Click to collapse
Oh, I'm not sure why that happened then. There shouldn't have been anything extra removed on top of what HydraKernel removes.
My device is working with both Iris and Fingerprint unlock right now.
Can you post the output of:
Code:
ls /system/app/mcRegistry
can you test out my kernel? i see hydra zip has some files that it replaces, and the lazyflasher has similar files, could that be the problem?
Ather said:
can you test out my kernel? i see hydra zip has some files that it replaces, and the lazyflasher has similar files, could that be the problem?
Click to expand...
Click to collapse
try backing up your system/data to !!external sdcard!! in twrp, saving your internal storage to pc, then formatting data.
restore your stock kernel and system before flashing your custom kernel.
then see if it works from scratch.
if it's all fine, try restoring your data backup.
Ather said:
no i had already wiped data when i installed hydra kernel so after flashing my custom kernel i tried to setup the fingerprint and it gave an error that the fingerprint sensor isn't available try later, do you have any idea how to make a decrypted kernel like hydra?
Click to expand...
Click to collapse
This sounds exactly like you did not patch /system/app/mcRegistry files
Sent from my SM-N930F using XDA Labs
Tkkg1994 said:
This sounds exactly like you did not patch /system/app/mcRegistry files
Sent from my SM-N930F using XDA Labs
Click to expand...
Click to collapse
They shouldn't be patched though, the installer simply removes the secure ones that the device is unhappy with.
It works fine for me, so I know the offending ones are being removed, but maybe somehow it deleted all of his tlbins?
Be nice if he provided the contents of his mcRegistry :/
jcadduono said:
They shouldn't be patched though, the installer simply removes the secure ones that the device is unhappy with.
It works fine for me, so I know the offending ones are being removed, but maybe somehow it deleted all of his tlbins?
Be nice if he provided the contents of his mcRegistry :/
Click to expand...
Click to collapse
Hello @jcadduono,
I am one of your "orphan" users of Idlekernel. It is the very best kernel for the Note 3.
Would you produce a blind update of it, please, please.
I would be more than happy to test it before you upload to general public.
Sorry guys for the OT.
Need help for finalisation kernel
Hello and thank you OP for the tutorial, I have done everything and no worries except when I want to flash the kernel does not boot, then I would like to know how to get a boot.img with the dtb.img files and the image create after Compilation, if someone can help I will be grateful
Thank you
Help on Kernel modules and patches
{MY QUESTIONS ARE ABOUT BOLD ITEMS BELOW}
Once your kernel is finished building, the resulting files will be located at:
Code:
build/arch/arm64/boot/Image
build/arch/arm64/boot/dtb.img
[B]build/modules/*.ko (if modules are enabled)[/B]
INSTALLING YOUR NEW KERNEL
The LazyFlasher project comes to the rescue here. It's the swiss army knife of kernel flashing in TWRP.
There's a specific branch for the Note 7 called kernel-flasher-gracelte. (use kernel-flasher-herolte instead if building for S7/S7 edge!)
To download it (feel free to fork it so you can have a copy on your GitHub to modify instead!):
Code:
cd ~/build
git clone -b kernel-flasher-gracelte https://github.com/jcadduono/lazyflasher.git
cd lazyflasher
To use LazyFlasher, you'll probably want to take a look at the Makefile, config.sh, and META-INF/com/google/android/update-binary (a shell script).
There's a few things you can change there to personalize it to your needs.
You should also enter the patch.d folder and delete 060-f2fs-fstab if you don't have f2fs enabled in your kernel, and edit the io_scheduler in 070-kernel-settings if you don't have fiops enabled either.
(make another git commit to save your setup!)
Once the installer is set up to your liking, all you have to do to build it is copy the Image and dtb.img from your build output into the lazyflasher folder.
If you have any modules (.ko files) to install, place them in the modules folder.
Now simply run:
Code:
make
Got a few question for anyone that is familiar with the exynos8890-gracelte BUILD. This in regards to files output after compilation of kernel code; specifically with editing patches and providing module support.
Where are the *.ko files located if default output is used(using your ./build.sh gracelte xx)? By the way...Your tutorial is awesome, first and foremost...but I want to be sure that I am pulling the files from the correct location (being a newbie at this android kernel building stuff). I found my modules under "~/build/kernel/samsung_universal8890/build/lib/modules/3.18.14-dee-gracelte-xx-0.1" which is the parent folder to other folders/files that seem to be of interest. After digging deeper there are even folders within the previously mentioned (named) one that have items of question as to whether they are needed in my "flasher" module folder. Such as pictured https://drive.google.com/open?id=0B-3GHX6_T7lYRkRUUVVORE1OM1k
I just want to have a functioning kernel with module support/modules in there proper place. Another item is patches. Would it be possible to just change "070-kernel-settings" patch to "io_scheduler=noop" if I changed default setting to such? If so, what other, if any, items in this file would need editing? Where else can I find patch files located on the web or is this something home-brewed? Thanks for all your hard work.
I also assume that by changing to the proper package manager commands, this procedure will work for pretty much most Linux distros.
Windows 10 Support Number

Categories

Resources