(GUIDE) making ROM from source without DATA loss - Android Software/Hacking General [Developers Only]

if u dont have internet connection to make a ROM this guide is for you and you dont need to have download for GB's of file
first im taking carbon ROM for example
1.You will need to set up some directories in your build environment:
To create them run:
mkdir -p ~/bin
mkdir -p ~/carbon
2.Install the Repository
Enter the following to download the "repo" binary and make it executable:
curl http://commondatastorage.googleapis.com/git-repo-downloads/repo > ~/bin/repo && chmod a+x ~/bin/repo
You may need to reboot for these changes to take effect. Now enter the following to initialize the repository:
cd ~/carbon
Repositories:
Before you continue --> run this in the terminal:
repo init -u https://github.com/CarbonDev/android.git -b kk
3.now open carbon folderand press ctrl + H if u see .repo folder u can continue to next
repo sync --> firsy sync for 5mins to load the folder and then stop syncing by closing terminal
4.after that see the manifest.xml with notepad or any suitable one and you can see link for the packages EXAMPLE: android_art search in the cyanogenmod or in which u want to build
5.im sharing link database of packages for building carbon rest u have the job to search and typer in github
package which to be downloaded for carbon ROM is here http://d-h.st/zru
6.after making source proper --> Building the System --->>>Initialize the environment with the envsetup.sh script. Note that replacing "source" with a single dot saves a few characters, and the short form is more commonly used in documentation.
. build/envsetup.sh
lunch
Enter the number of the build you want to start and press enter:
make carbon -j7 = Run Squisher/Run Opticharger
make otapackage -j7 = No Squisher/No Opticharger
optional --> Submitting Patches
Patches are always welcome! Please submit your patches via CarbonDev Gerrit! You can do this by using these commands:
Setting up for repo upload: (run these commands once)
git config --global review.review.carbonrom.org.username <Your username registered at CarbonDev gerrit>
git config --global review.review.carbonrom.org.email <Your email registered at CarbonDev gerrit>
(From root android directory)
. build/envsetup.sh
repo start kk .
(Make your changes and commit)
repo upload .
Note: "." meaning current directory For more help on using this tool, use this command: repo help upload
Make your changes and commit with a detailed message, starting with what you are working with (i.e. vision: Update Kernel) Commit your patches in a single commit. Squash multiple commit using this command: git rebase -i HEAD~<# of commits>
To view the status of your and others' patches, visit EAMPLE:Carbondev Code Review
if you want to build :
CYANOGENMOD -->do steps upto initialisng repo ------------https://github.com/CyanogenMod/android
OMNIROM -->do steps upto initialisng repo ------------https://github.com/omnirom/android
CARBON -->do steps upto initialisng repo ------------https://github.com/CarbonDev/android
dont click thanks if i helped you because thanks button is gonna damage
CREDITS:
---------> Ramsudharsan madhavan for teaching me
---------> Guru sanjay my friend helping me to download
---------> and me for thinking this idea in my school time

Goin gud. keep it up.

Awesome man!
Worth for Portal!
Sent from my Xperia Sola using XDA Premium 4 mobile app

Nevermind.

Related

[Guide] How to use Github

Hi.
Today I would like to show you how to use github. I'm not an expert (I'm rather n00b TBH ) but I learned some things and might help you with simple git commands.
1. Github? What's that?
In short it's the web-based hosting service for software development projects that use the Git revision control system. In English - the place where you store your sources.
{
"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"
}
2. Creating an account.
2.0 Download the required libs
Code:
sudo apt-get install git
2.1 Create an account on github.com website
2.2 In terminal type:
Code:
git config --global user.name "Your Name Here"
git config --global user.email "[email protected]"
NOTE: use the e-mail used in the website account creation
2.3 Create your unique SSH public key
Code:
ssh-keygen -t rsa -C "[email protected]"
# Creates a new ssh key using the provided email
# Generating public/private rsa key pair.
# Enter file in which to save the key (/c/Users/you/.ssh/id_rsa): [Press enter]
Now you need to enter a passphrase.
Code:
# Enter passphrase (empty for no passphrase): [Type a passphrase]
# Enter same passphrase again: [Type passphrase again]
Which should give you something like this:
Code:
# Your identification has been saved in /c/Users/you/.ssh/id_rsa.
# Your public key has been saved in /c/Users/you/.ssh/id_rsa.pub.
# The key fingerprint is:
# 01:0f:f4:3b:ca:85:d6:17:a1:7d:f0:68:9d:f0:a2:db [email protected]
Now go to ~/.ssh folder and copy your id_rsa.pub content into account administration on github.com
... and check if everything works
Code:
ssh -T [email protected]
Code:
The authenticity of host 'github.com (207.97.227.239)' can't be established.
# RSA key fingerprint is 16:27:ac:a5:76:28:2d:36:63:1b:56:4d:eb:df:a6:48.
# Are you sure you want to continue connecting (yes/no)?
Duh?! Sure I want! Yes! Yes! Yessss!
Code:
# Hi username! You've successfully authenticated, but GitHub does not
# provide shell access.
And we are ready to do some serious things! :highfive:
3. Forking a repo
As an example I'll use https://github.com/CyanogenMod/android_packages_apps_Settings
Open this link in the browser and click fork.
3.1 Clone the source from your fork.
I use my account as an example.
Code:
git clone git://github.com/eagleeyetom/android_packages_apps_Settings.git -b gingerbread
-b gingerbread let us to choose what branch are we going to download
3.2 Do some changes!
For example add files, remove them etc.
3.3 Commit the changes
OPTIONAL I created new branch at my project and named it "xda"
To do this go to the cloned folder and type:
Code:
git branch xda
git checkout xda
Now it's time to see what's going on:
Magic command
Code:
git status
As you can see I removed few files and added one.
Now it's time to tell the git what we want to do.
4. Pushing the changes
Add all modified files:
Code:
git add .
Add all removed files
Code:
git add -u
You can also add/rm one file
Code:
git add name_of_file
git rm name_of_file
After git status we should get something like this:
Now it's time to commit:
Code:
git commit -m 'my first commit'
And finally to push:
Code:
git push
If you'll get some errors use the following:
Code:
git push [email protected]:eagleeyetom/android_packages_apps_Settings.git xda
I used the name of my github and the name of the branch in the end.
Woo hoo! Now let's check the website.
That's the most basic basics
In the next posts I will show you some more advanced commands like merge, cherry-pick, removing branches etc.
Credits:
Google
Github Team
All my friends from GingerDX IRC channel
If you find it useful hit thanks button. You can also consider a small donation
5. Removing branch.
This one took me a lot of googleing and many bad words has been said
I'll make a test branch 'deleteme'
Code:
git branch deleteme
git checkout deleteme
git push [email protected]:eagleeyetom/android_packages_apps_Settings.git deleteme
And I have new remote branch now.
But I want to delete it.
Here's the answer.
First:
Check the branches:
Code:
git branch -a
And I'll get:
Code:
remotes/origin/HEAD -> origin/gingerbread
remotes/origin/deleteme
remotes/origin/donut
remotes/origin/eclair
remotes/origin/froyo
remotes/origin/froyo-stable
remotes/origin/gb-release-7.2
remotes/origin/gingerbread
remotes/origin/gingerbread-release
remotes/origin/ics
remotes/origin/icsify
remotes/origin/wip
remotes/origin/xda
I want to delete this branch.
Type:
Code:
git branch -rd origin/deleteme
# Deleted remote branch origin/deleteme (was 808ffbb).
Code:
git push [email protected]:eagleeyetom/android_packages_apps_Settings.git :refs/heads/deleteme
And the remote branch is gone! Yeah!
6. Merging the commits
Imagine the situation that you want to add a commits created by someone else. Let's use our great Recognized Developer nobodyAtall
We need to add the source:
Code:
git remote add upstream https://github.com/MiniCM/android_packages_apps_Settings.git
Download the branch:
Code:
git fetch upstream
Code:
* [new branch] cm-9.0.0 -> upstream/cm-9.0.0
* [new branch] donut -> upstream/donut
* [new branch] eclair -> upstream/eclair
* [new branch] froyo -> upstream/froyo
* [new branch] froyo-stable -> upstream/froyo-stable
* [new branch] gb-release-7.2 -> upstream/gb-release-7.2
* [new branch] gingerbread -> upstream/gingerbread
* [new branch] gingerbread-release -> upstream/gingerbread-release
* [new branch] ics -> upstream/ics
* [new branch] jellybean -> upstream/jellybean
* [new branch] master -> upstream/master
* [new branch] wip -> upstream/wip
You'll get a message to resolve the conflicts. In short and most n00b friendly way is to open pointed files and delete the:
<<<<<<<<
=======
>>>>>>>>
symbols.
Don't forget to test make before pushing!
Now standard procedure:
Code:
git add .
git commit -m 'test merge'
git push [email protected]:eagleeyetom/android_packages_apps_Settings.git xda
7. Cherry-pick the single commit
Now it's time to add specific commit to our build. I'm going to use this one.
Code:
git remote add upstream https://github.com/MiniCM/android_packages_apps_Settings.git
git fetch upstream
git cherry-pick c95854e8c91ec279bd3719c637f531491855278a
And we're good :highfive:
Now commit should be added. All you need now is to push - no need to commit
8. Changing the branch
While using git you may noticed that sometimes after fresh sync there is no branch selected. Imagine the situation when you are on a branch A and want to check to branch B, because it uses a different method (like framework patch etc.)
The solution is pretty simple.
Code:
git checkout -t remote_name/remote_branch
It allows you to change the branch to remote one without cloning the whole repo again.
Pull request
If you feel that you have fixed a problem and want to help the developer to make his own ROM/kernel etc. you should consider to make a pull request. Pull request adds the changes you have made to the others repo.
First of all.
Fork and clone destined repo.
Check the previous post about forking and cloning.
Now make some changes and upload it to your own remote git.
Then, go to your forked repo using browser and click on Pull request.
Then choose the account and branch to pull-request.
Click and wait for your request to be merged
Merging a pull request.
Sometimes someone wants to add something to your code.
You'll be notified by e-mail and also see the notification on your github website.
Go there and click Open
When the changes can't be merged you'll see such message:
But when it's green, you are ready to merge it
Don't forget to review the code. In other way you'll be forced to delete the commit.
You can also use text method:
Code:
git checkout master
[COLOR="DeepSkyBlue"]# Check out your master branch[/COLOR]
git remote add TeamFun git://github.com/TeamFun/android_packages_apps_Settings.git
[COLOR="deepskyblue"]# Add a new remote named 'TeamFun'[/COLOR]
git fetch TeamFun
[COLOR="deepskyblue"]# Pull in all the commits from the 'cameronmcefee' remote[/COLOR]
git merge TeamFun/gingerbread
[COLOR="deepskyblue"]# Merge your master branch into the 'gingerbread' branch from the 'TeamFun' remote[/COLOR]
git push [email protected]:eagleeyetom/android_packages_apps_Settings.git master
[COLOR="deepskyblue"]# Push your newly-merged branch back to GitHub[/COLOR]
or
Code:
git checkout master
[COLOR="DeepSkyBlue"]# Check out your master branch[/COLOR]
$ curl http://github.com/octocat/Spoon-Knife/pull/25.patch | git am
[COLOR="deepskyblue"]# Grab the patch generated by a pull request and feed it into a new commit[/COLOR]
$ git push [email protected]:eagleeyetom/android_packages_apps_Settings.git master
[COLOR="deepskyblue"]# Push your newly-updated commit back to GitHub[/COLOR]
TIPS AND TRICKS
REVERT CHANGES
To discard all unstaged changes e.g. failed merge etc. type:
Code:
git checkout .
# to delete all changes
git checkout path/to/file
# to discard changes for a specific file
You can also use:
Code:
rm -rf ./
[COLOR="Cyan"]# deletes all of the files in the directory[/COLOR]
git reset --hard
[COLOR="cyan"]#This is going to restore the git to the previous state[/COLOR]
HOW TO REMOVE COMMITTED CHANGES?
To remove committed changes you have to revert the commit. But how to do that? It's your answer
Code:
git reset HEAD --hard
HEAD is the previous commit. To revert to previous state use HEAD~1, HEAD~2 etc. you can also use the code taken from git log.
GIT PATCH AND GIT APPLY
Now I want to make a patch file to e.g. send an e-mail with my commited changes.
First I need to find a changes made by a commit. To do this I need to know commit ID.
Code:
git log --oneline #This would show the commit ID's
Now pick the commit for example 22a95d1 and use git show to make a patch
Code:
git show 22a95d1 > patchname.patch
And I got patch, but how to apply it?
The answer is easy. Use git apply.
Code:
git apply patchname.patch
# --check checks if the patch can be applied
FORCE PUSH
Sometimes github doesn't want to cooperate - just like some people
You can force it by adding --force or -f
Code:
git push -f [email protected]:eagleeyetom/android_packages_apps_Settings.git master
n00b method to add changes after failed push.
Clone the repo and delete everything but .git directory. Then copy modified content, commit and push
guide-man funs!
Oh I needed this. Thanks EET! :good:
Thanks man really needed this !
Wow... this is also exactly what I would want! Thanks EET!
SEARCH. ASK. TEST... not the other way round! - lucastan96
Sent With My Brains To Yours
Great. Now i'll know what i'm doing wrong. :thumbup:
Please give credit where credit is due..
If you can't even search how can I help you??
Thanks bro needed this !
Wow... this is what i exactly learning too ! Thanks mate...
my current stage
repo branching and remote branching
im using merging conflict Kdiff3(downloaded from website)
Add the KDiff3 directory to your Windows System Path (e.g. C:\Program Files\KDiff3\)
Add kdiff3 as your Git mergetool (From Git Bash, run git config --global merge.tool kdiff3)
Add kdiff3 complete path to Git Config
(From Git Bash, run git config --global mergetool.kdiff3.path "C:/Program Files/KDiff3/kdiff3.exe")
Go into Git GUI settings and set the mergetool to kdiff3 (if Git GUI doesn't pick up this setting from git config, which it should)
git config --global diff.tool KDiff3
git config --global difftool.KDiff3.path "C:/Program Files/KDiff3/kdiff3.exe"
git config --global merge.tool KDiff3
git config --global mergetool.KDiff3.path "C:/Program Files/KDiff3/kdiff3.exe"
then type,
git mergetool
it will auto bring to your Kdiff3
Great guide.......
Sent from my GT-S6102 using Tapatalk 2
Hi EET,
Auto Fix conflicts,(merging commit)
Just want to clarified do we need delete
<<<<< HEAD
||||||| merged common ancestors
>>>>> 8ffc0cf20afc8efef75564965bfd497c597df465
along with those symbols
yes <<<<<<< u8928y4283ry23r2yhrfodknvoslf
======== sru2q8w9erfhwsd
>>>>>>>>> 90u7rw9wsdhjvosdkn
Delete all of this
I'm just bumping this thread, because it was moved from X8 section
eagleeyetom said:
I'm just bumping this thread, because it was moved from X8 section
Click to expand...
Click to collapse
To the Ace forums ?
Some additional info.
1. I suggest switching to https://github.com/robbyrussell/oh-my-zsh shell.
Not only it has plugin for git but also has built in themes. Finally, auto-completion is BOSS in zsh.
Type
Code:
/u/i/c++
hit Tab and you have a full path.
Code:
/usr/include/c++
2. Just type
Code:
alias
It'll spit present aliases, some of them for git.
Nice write up, helpful
Thank you Man
Thank you bro for the tutorial, I guess that I may need this in near future.
Thanks Again !
great piece!
Well, this is out of topic, but, does anyone know of a git app / tool which works on android and is able to do commits / pushes?

[Guide]Make your own rom(CM9/EVERVOLV) and kernel from source code | Advanced users

I think many want to know how this stuff is actually done,so....read
Kernel Development
U need Linux or Mac OS .The End
I can confirm the below method works on Ubuntu 11.10,32 bit(or other linux distros/mac u need different packages)
1)Open terminal and download these packages(for both 32/64 bit)
Code:
apt-get install git-core gnupg sun-java6-jdk flex bison gperf libsdl-dev libesd0-dev libwxgtk2.6-dev build-essential zip curl libncurses5-dev zlib1g-dev
For 64 bit ,install more packages,otherwise leave
Code:
ia32-libs lib32z1-dev lib32ncurses5-dev gcc-multilib g++-multilib
2)Download kernel source code for pico ,which u will compile,from www.htcdev.com (if u want to compile kernel for ics/jb,use lirokoa's source code from www.github.com/lirokoa/htc_pico_kernel )
Extract the archive somewhere safe
3)Download toolchain needed to compile the kernel from www.github.com/sakindia123/android_toolchains
We'll use arm-eabi-4.4.3 for pico
Now let's assume u have correctly set up your machine
extract the sources and everything else u downloaded....then go into the top directory
Code:
cd Kernel
u enter into the root of the kernel directory with this
then type :
Code:
gedit Makefile
The Make file will open.........look out for this and change CROSS_COMPILE= "your toolchain path"
EXAMPLE:
Code:
CROSS_COMPILE ?= /home/sarthak/Downloads/Toolchains/arm-eabi-4.4.3/bin/arm-eabi-
This will open up the Makefile in a gedit,and the changed values will correspond to wherever u placed your toolchain...
Make the kernel config
Code:
make msm7627a_defconfig
NOTE- Do "make htc_pico_defconfig" is making ics/jb kernel
This will make a working kernel config acc. to the source code
Now,make the necessary changes in your source.When you are done,type:
Code:
make -jX
,where X=no.op cpu threads multiplied by 1 or 2.
Sit down and have a smoke!
The resulting kernel will be in Kernel/arch/arm/boot/zImage
Easy,ain't it?
Remember,this guide doesnt teach u how to make particular changes,it just helps u setting up your build environment and compiling from a given source.
Packaging kernel for flashing on target device
- Take a stock boot.img(or any boot.img that works with the rom)
- Downloads boot image tools from -> https://github.com/sakindia123/boot-image-tools and keep them somewhere
- Place boot.img in source_img folder inside the boot.img-tools folder(create if not there)
- Enter the boot tools directory
- Unpack:
Code:
$ mkdir -p unpack
$ tools/unpackbootimg -i source_img/boot.img -o unpack
-Extracting boot.img-ramdisk.gz
Code:
$ mkdir -p boot
$ cd boot
$ gzip -dc ../unpack/boot.img-ramdisk.gz | cpio -i
$ cd ../
Packing a new ramdisk:
Code:
$ tools/mkbootfs boot | gzip > unpack/boot.img-ramdisk-new.gz
Create a new boot.img:
Code:
$ mkdir -p target_img
$ tools/mkbootimg --kernel unpack/boot.img-zImage --ramdisk unpack/boot.img-ramdisk-new.gz -o target_img/boot.img --base `cat unpack/boot.img-base`
Done!
Now take the boot.img from target_img folder and flash via fastboot.Also push the compiled modules or else wifi wont work
Code:
fastboot flash boot boot.img && fastboot reboot
adb push drivers/net/wireless/bcmdhd/bcmdhd.ko /system/lib/modules
adb push drivers/net/kineto_gan.ko /system/lib/modules
NOTE: If u are compiling kernel for stock/sense roms,wifi module will be found in drivers/net/wireless/bcm4330b2/bcm4330.ko
Enjoy !
Compile rom from source
1) Make your own CyanogenMod9 nightly
So cant wait for the developer to release the next build?gettin' itchy?
Compile on your own!
- Packages
For 64-bit systems(For ICS and above,u need 64 bit and above)
Code:
apt-get install git-core gnupg flex bison gperf build-essential zip curl libc6-dev libncurses5-dev:i386 x11proto-core-dev libx11-dev:i386 libreadline6-dev:i386 libgl1-mesa-dev:i386 g++-multilib mingw32 openjdk-6-jdk pngcrush schedtool tofrodos python-markdown libxml2-utils xsltproc zlib1g-dev:i386
- Create working directories for the build environment:
mkdir -p ~/bin
mkdir -p ~/android/system
- Get Google's repo tool
Code:
curl https://dl-ssl.google.com/dl/googlesource/git-repo/repo > ~/bin/repo
chmod a+x ~/bin/repo
Reboot
- Sync the Repository
Code:
cd ~/android/system/
repo init -u git://github.com/CyanogenMod/android.git -b ics
repo sync -j16
NOTE- USe -j4 if u have slow net connection!
Wait for a few hours depending upon your net connection,it will download 4-5 GB or more
Then ,after syncing finishes,in the root of the source,open the hidden folder ".repo"
create a file local_manifest.xml and put this xml code to sync relevant repos for compiling cm9 for pico
PHP:
<?xml version="1.0" encoding="UTF-8"?>
<manifest>
<project name="lirokoa/android_device_htc_pico_ics" path="device/htc/pico" revision="ics" />
<project name="sakindia123/ics-vendor-pico" path="vendor/htc/pico" revision="master" />
</manifest>
then save and do "repo sync " again
- Compile the actual rom
This is fun bit.Make changes to the sourc code if u want to fix bugs or experiment,then,in the root of working directory,type
Code:
. build/envsetup.sh
brunch pico -jX
NOTE- REPLACE X with the no. of cores on your computer,do not enter X
Wait for it to compile(depends on how crap the computer is)
When it finishes compiling,output will be in out/target/product/pico/cm9-UNOFFICIAL-xxxxxxxx.zip
Flash the zip via recovery
Enjoy
Compile Evervolv Nightly
SO u dont want cm9,u want to compile evervolv,eh?
Follow the setups upto "Get Google's repo tool" in cm9 guide,but instead of cm9 source ,sync this
Code:
cd ~/android/system/
repo init -u git://github.com/cm2pico/android.git -b ics
repo sync -j16
After syncing,do this
Code:
nano vendor/ev/vendorsetup.sh
in the text editor that opens up,type
[/CODE]add_lunch_combo ev_pico-eng[/CODE]
Then to compile,
Code:
. build/envsetup.sh
lunch
Select pico in menu and type
Code:
make -jX otapackage
Replace X with no. of cores on pc!
pico up output zip from out/target/product/pico/Evervolv-2.2.0.zip
Nice think I might try this. I'm running osx is there different tools avalible or am I better off installing win or Linux in a vm
Sent from my HTC Explorer A310e using xda app-developers app
---------- Post added at 01:48 PM ---------- Previous post was at 01:45 PM ----------
Sorry just read the op properly and seen my question answered
Sent from my HTC Explorer A310e using xda app-developers app
May I use cygwin software to use this on windows to emulate properties of Linux? I heard so!
Nice to see new how to threads...
Sent from my Galaxy Nexus using Tapatalk 2
arunsai123 said:
May I use cygwin software to use this on windows to emulate properties of Linux? I heard so!
Click to expand...
Click to collapse
Not really..there are some things that cant be properly emulated..u need a native install or Virtual MAchine
BUMP- Kernel part of the tut has been completed.Hope u guys are successfully in making your own kernel
dude wheres the tutorial for ROM developement!!
updated with instruction to compile own CM9 and evervolv kang
Great Tutorial dude ...
Great Tutorial dude ... ... very clearly explained .... :laugh: :good: :fingers-crossed:
Great I'm going to compile aokp from its source
Sent from my HTC Explorer A310 using xda premium
time to download
well i have airtel broadband connection(unlimited) on 256 kbps, i get a downloading speed of 30-40 kbps.
so, i wanted to ask you all the size of all the sources/data required to compile a single ROM and time taken to download all those things.
siddharth1102 said:
well i have airtel broadband connection(unlimited) on 256 kbps, i get a downloading speed of 30-40 kbps.
so, i wanted to ask you all the size of all the sources/data required to compile a single ROM and time taken to download all those things.
Click to expand...
Click to collapse
cm9 about 4-5gb, evervolv ics about 6-6.5gb
unlike cm7 where you had to download all supported devices which added additional size to main source (16gb or so) cm9 (by default) and evervolv (from sakindia123 that includes device tree and vendor prop files) both only download the main source only which makes the downloads less in size...........for you it would take a long time to download afew hours (i have 15mbps or 1.5meg a sec so didnt take long) once all setup and synced a single cm9 build takes me just over 1hr and evervolv slightly more, all depends on your hardware ie ram, processor etc.....have fun
LiVeRpOoL-FaN said:
cm9 about 4-5gb, evervolv ics about 6-6.5gb
unlike cm7 where you had to download all supported devices which added additional size to main source (16gb or so) cm9 (by default) and evervolv (from sakindia123 that includes device tree and vendor prop files) both only download the main source only which makes the downloads less in size...........for you it would take a long time to download afew hours (i have 15mbps or 1.5meg a sec so didnt take long) once all setup and synced a single cm9 build takes me just over 1hr and evervolv slightly more, all depends on your hardware ie ram, processor etc.....have fun
Click to expand...
Click to collapse
Can i download these things in installments?
siddharth1102 said:
Can i download these things in installments?
Click to expand...
Click to collapse
really the best way is to fully download in 1 go but in terminal you press Ctrl + z (on Ubuntu) to stop the process and then carry it on later, although it wont sync the whole project until all source is downloaded............
LiVeRpOoL-FaN said:
really the best way is to fully download in 1 go but in terminal you press Ctrl + z (on Ubuntu) to stop the process and then carry it on later, although it wont sync the whole project until all source is downloaded............
Click to expand...
Click to collapse
While learning to compile i found that compiling jelly bean on ubuntu 12.04 is it experimental mode. So, i wanted to ask won't it compile properly and will it work i do so?
siddharth1102 said:
While learning to compile i found that compiling jelly bean on ubuntu 12.04 is it experimental mode. So, i wanted to ask won't it compile properly and will it work i do so?
Click to expand...
Click to collapse
i`ve not used 12.04 for anything, i used 11.10 for cm7 and cm9 but found had to use 10.04.4 (lucid) for evervolv ics (aosp code, not cm modified code) i think jb aosp was compiled on 10.04.4 by android aosp team

[GUIDE][HOW_TO] BUILD a LINUX KERNEL FROM SOURCE [UBUNTU]

This is a general open source linux development thread!
Android's kernel is a derivative of linux's kernel. Its good to know how to build both of these kernels. You might be already familiar with building kernels for various devices from sources. So I have made a new thread for guiding people on how to compile linux kernel from source (example taken as ubuntu kernel).
Requirements:
Any linux os x64 bit(example here: ubuntu 14.04)
Git (sudo apt-get install git)
Minimum of 4GB RAM and some reasonable linux-swap
To get the currently running kernel image, type the following:
Code:
apt-get source linux-image-$(uname -r)
Now we need to obtain Ubuntu Kernel Sources from its repositories. Make a new directory and inside it, initialise the git and clone the repository.
Code:
git clone git://kernel.ubuntu.com/ubuntu/ubuntu-<release>.git
<release> : Type in the required source. It can be lucid, precise, trusty, utopic etc.
Setting up the build environment. There are lots of tools and packages that are very much essential for building a kernel. These tools can be downloaded as a whole bundle and can be installed easily. Here's the code to set it up:
Code:
sudo apt-get build-dep linux-image-$(uname -r)
NOTE: The above comand can be executed only after you obtain the currently running kernel image. I have already given the code to obtain it above.
Now, change directory to the root of the kernel and type the following:
Code:
chmod -R a+x *
The above code will set the required permissions for building and executing the kernel.
Now, run these two commands:
Code:
fakeroot debian/rules clean
fakeroot debian/rules editconfigs
The first command cleans up the code automatically.
The slightly tricky part is with the second line of the code. When you execute it, you will have to edit a series of menuconfigs. To make changes to the configuration file we need to edit the configuration file. The kernel developers have created a script to edit kernel configurations which has to be called through the debian/rules makefile, unfortunately you will have to go through all the flavors for this script to work properly. The script will ask you if you want to edit the particular configuration. You should not make changes to any of the configurations until you see your wanted flavour configuration
We have now covered about 70% of progress. The rest is building the kernel and testing it.
Building the kernel is quite easy. Change your working directory to the root of the kernel source tree and then type the following commands:
Code:
fakeroot debian/rules clean
fakeroot debian/rules binary-headers binary-generic
If the build is successful, a set of three .deb binary package files will be produced in the directory above the build root directory. For example after building a kernel with version "3.13.-0.35" on an amd64 system, these three .deb packages would be produced:
Code:
cd ..
ls *.deb
linux-headers-3.13.0-35_3.13.0-35.37_all.deb
linux-headers-3.13.0-35-generic_3.13.0-35.37_amd64.deb
linux-image-3.13.0-35-generic_3.13.0-35.37_amd64.deb
Testing the new kernel
Install the three-package set (on your build system, or on a different target system) with dpkg -i and then reboot:
Code:
sudo dpkg -i linux*3.13.0-35.37*.deb
sudo reboot
Guys, I hope I have made an easy tutorial. You are always welcome to ask doubts (even on PM). Thank You.
Specific Hardware/Architecture
Creating a new config
I’ll be using the method of creating a new flavour, this adds a bit more work but this way you can always compile the original kernels.
We’ll use the generic flavour as the base for our own flavour being i7, this extension needs to be in small caps.
Code:
cp debian.master/config/amd64/config.flavour.generic debian.master/config/amd64/config.flavour.i7
fakeroot debian/rules clean
debian/rules updateconfigs
To make changes to the configuration file we need to edit the configuration file. The kernel developers have created a script to edit kernel configurations which has to be called through the debian/rules makefile, unfortunately you will have to go through all the flavours for this script to work properly.
Code:
debian/rules editconfigs
The script will ask you if you want to edit the particular configuration. You should not make changes to any of the configurations until you see the i7 configuration
Code:
Do you want to edit config: amd64/config.flavour.i7? [Y/n]
Make your changes, save the configuration and then keep going until the script ends.
When you’re done, make a backup of the config flavor file.
Code:
cp debian.master/config/amd64/config.flavour.i7 ../.
Now we need to clean up the git tree in order to get ready for compilation.
Code:
git reset --hard
git clean -df
Getting ready for compilation
Because we are going to be creating a new flavour based on a existing flavour (generic in my case) we need to create some extra files. During compilation the process checks the previous release for some settings, as we’re creating a local flavour it doesn’t exist in the source, so we’re creating it.
To see the previous release we use:
Code:
ls debian.master/abi
cp debian.master/abi/3.0.0-12.20/amd64/generic debian.master/abi/3.0.0-12.20/amd64/i7
cp debian.master/abi/3.0.0-12.20/amd64/generic.modules debian.master/abi/3.0.0-12.20/amd64/i7.modules
Copy our flavored configuration file back.
Code:
cp ../config.flavour.i7 debian.master/config/amd64/
We need to edit some files:
File: debian.master/etc/getabis
Search for the line:
Code:
getall amd64 generic server virtual
Change it in:
Code:
getall amd64 generic server virtual i7
File: debian.master/rules.d/amd64.mk
Search for the line:
Code:
flavours = generic server virtual
Change it in:
Code:
flavours = generic server virtual i7
File: debian.master/control.d/vars.i7
This files does not exist and in order to make the compilation process aware of our own flavor we want to compile we need to create it.
Code:
cp debian.master/control.d/vars.generic debian.master/control.d/vars.i7
You can edit the file and make it your own.
Code:
arch="i386 amd64"
supported="i7 Processor"
target="Geared toward i7 desktop systems."
desc="x86/x86_64"
bootloader="grub-pc | grub-efi-amd64 | grub-efi-ia32 | grub | lilo (>= 19.1)"
provides="kvm-api-4, redhat-cluster-modules, ivtv-modules, ndiswrapper-modules-1.9"
We need to commit our changes in the git repository.
Code:
git add .
git commit -a -m "i7 Modifications"
The text after -m is the message you add to your commit.
Compilation
It’s finally time for compiling, to keep our newly created branch in pristine condition we will do the compilation in a separate branch. We keep our branch clean as this will help later on when we want to update our new branch to a newer kernel.
Code:
git checkout -b work
fakeroot debian/rules clean
All the packages will be created in the directory /d1/development/kernel/ubuntu/oneiric
Create independent packages:
Code:
skipabi=true skipmodule=true fakeroot debian/rules binary-indep
The above statement will create the following deb files:
Code:
linux-doc_3.0.0-13.21_all.deb
linux-headers-3.0.0-13_3.0.0-13.21_all.deb
linux-source-3.0.0_3.0.0-13.21_all.deb
linux-tools-common_3.0.0-13.21_all.deb
Create the tools package:
Code:
skipabi=true skipmodule=true fakeroot debian/rules binary-perarch
The above statement will create the following deb file:
Code:
linux-tools-3.0.0-13_3.0.0-13.21_amd64.deb
Create the flavour depended files:
Code:
skipabi=true skipmodule=true fakeroot debian/rules binary-i7
The above statement will create the following deb files:
Code:
linux-headers-3.0.0-13-i7_3.0.0-13.21_amd64.deb
linux-image-3.0.0-13-i7_3.0.0-13.21_amd64.deb
Installation
After the compilation is finished we’ll have the above packages in the parent directory.
To install the files
Code:
cd ..
sudo dpkg -i linux-headers-3.0.0-13-i7_3.0.0-13.21_amd64.deb linux-headers-3.0.0-13_3.0.0-13.21_all.deb linux-image-3.0.0-13-i7_3.0.0-13.21_amd64.deb
Check your bootloader if the newly installed Ubuntu kernel is the default one, for grub check the file /boot/grub/menu.lst or if you run grub2 check /boot/grub/grub.cfg
thx for your info
nice job mate..!! :good:
now i'm gonna try this..!!
Nice ,i can't say anything
faizauthar12 said:
Nice ,i can't say anything
Click to expand...
Click to collapse
Thank you for the great guide!!!
Nice thread. I'll try it at home
Thanks
Enviado de meu Moto G usando Tapatalk
Thx for the guide
tra_dax

[GUIDE][Lollipop]How to fix constant Google Play Services FC

Most of you would have experienced or heard of the constant 'Google Play Services has stopped' messages problem, and here I present a fix! Just follow the guide below to compile your own fixed libjavacore.so which you just copy to /system/lib(overwriting the existing one) and you should see the problem is solved The fix from Google: libjavacore.so fix. EDIT: Unfortunately the fix causes build errors on newer Android source code, so a modified version of the commit is used now: thanks @zephiK
NOTE: If you are using a PURE AOSP ROM, and your ROM build date is later than Mon Mar 23 2015, then you likely DO NOT need this fix
NOTE: This guide assumes that you already have a build environment setup for your device in question(and that you already finished a repo sync), and that you have basic knowledge about how to use a Linux Terminal. There are many guides on the internet on this topic so I'll leave it out.
Steps: First open a new Terminal session on your Linux/Cygwin machine
RECOMMENDED BUT OPTIONAL: Do a 'repo sync'(you can just do it on the libcore repo) and a 'make clean'
Code:
repo sync -j4
Code:
make clean
1. Go to the 'libcore' directory in the root of your android source tree
Code:
cd libcore
2. Add a new remote with whatever name you want(in this guide I will call the new remote fix)
Code:
git remote add [COLOR="red"]fix[/COLOR] https://android.googlesource.com/platform/libcore
Code:
git remote add [COLOR="red"]fix[/COLOR] https://github.com/zephiK/android_libcore.git
3. Now do a git fetch on 'fix'(or whatever name you called the new remote)
Code:
git fetch [COLOR="red"]fix[/COLOR]
4. Now time for a cherry-pick!
Code:
git cherry-pick 08d97aee56db51f718544562f5b74671be34dfaf
Code:
git cherry-pick 4fd69cb3de4e52b5b6d78ac61237f914853de151
OPTIONAL: Remove the new remote(Replace fix with whatever name you called it)
Code:
git remote remove [COLOR="red"]fix[/COLOR]
5. Now the fix has been imported into libcore, which will be compiled into a fixed libjavacore.so!
Code:
cd ..
source build/envsetup.sh
make -j4 libjavacore
6. Just wait for a while(probably about 30 mins on an average computer), and then goto your out directory. Proceed to 'target/product/<device name>/system/lib', and you should find a newly compiled libjavacore.so
Code:
cd $OUT/target/product/<device name/system/lib>
7. Now just upload it to your device, and copy it to /system/lib with 0644 permissions(in other words, -rw-r-r). Optional: backup the original /system/lib/libjavacore.so in case something goes wrong or this fix doesn't work
Code:
chmod 0644 /system/lib/libjavacore.so
You are now done! Feel free to share the lib to help others solve their problems, and enjoy lollipop
Credits
temasek(for sharing about this fix)
arter97_dev on Twitter(for a fixed libjavacore.so for his device)
Google(for original fix)
zephiK(for his fix)
XDA(for this awesome forum )
Fixed libjavacore.so downloads
If you had successfully compiled libjavacore.so and tested it on your device, and you would like to share it here, just mention me or pm me with the link and your device name and I'll put it here. Thanks!
Galaxy S4(compiled for CM12, but should work on all 5.0 ROMs)
Reserved post

[GUIDE] Building Pure Nexus

Introduction
Hello everyone, this is a guide to get you up and running with your own build of Pure Nexus for the Nexus 5X. In this thread, you will learn how to get your computer set up to build and the commands you will need to run. Please read the entire guide and the FAQ. Additionally, this is a developer's thread, there should be no off topic discussion.
Compilation Guide
This is available on my Github, where it may be a little more up to date.
0. Getting started
In this guide, I will go over how to build Pure Nexus on your Linux machine. This particular tutorial will focus on Ubuntu 16.04 as that is what I use (Mint 18 is also good) but this should work with any version of Linux; it does need to be 64-bit however. I will leave the installation of that up to you, Google is a wonderful resource. If you don't have a good computer but still want to build, check out this thread on XDA: http://forum.xda-developers.com/chef-central/android/guide-how-to-build-rom-google-cloud-t3360430
1. Set up your environment
1. Automatically
Code:
sudo apt-get install git-core
git clone https://github.com/akhilnarang/scripts
cd scripts
ls
bash <script-name>
<script-name> should be one of the scripts in the folder for your particular architecture.
2. Manually
1. Install Java 8
Code:
sudo apt-get update
sudo apt-get install openjdk-8-jdk
sudo apt-get install openjdk-8-jre
2. Install other build tools
Code:
sudo apt-get install git-core gnupg flex bison gperf build-essential zip curl zlib1g-dev gcc-multilib g++-multilib libc6-dev-i386 lib32ncurses5-dev x11proto-core-dev libx11-dev lib32z-dev ccache libgl1-mesa-dev libxml2-utils xsltproc unzip
2. Configure repo and git
If you have any problems with the below commands, try running as root:
Code:
sudo -s
Git is an open source version control system which is incredibly robust for tracking changes across repositories. Repo is Google's tool for working with Git in the context of Android. More reading if you are interested: https://source.android.com/source/developing.html
Run these commands to get repo working (only do this if you did the manual set up method above:
Code:
mkdir ~/bin
PATH=~/bin:$PATH
curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
chmod a+x ~/bin/repo
Run these commands to get git working:
Code:
git config --global user.name "Your Name"
git config --global user.email "[email protected]"
3. Download the source
First, before downloading the source, create a folder for the source and move into it.
Code:
mkdir ~/<foldername> (eg. mkdir ~/PN or ~/PureNexus)
cd ~/<foldername>
Then, we need to grab the manifest and sync down the repositories. Here are the commands to do this for Pure Nexus for Nougat (make sure you are in the source folder you made above):
Code:
repo init -u https://github.com/PureNexusProject/manifest.git -b n
repo sync --force-sync
Here is the process generally for other ROMs:
When you go to build a ROM, you must download its source. All, if not most, ROMs will have their source code available on Github. To properly download the source, follow these steps:
Go to your ROM's Github (e.g. http://github.com/PureNexusProject)
Search for a manifest (usually called manifest or android_manifest).
Go into the repo and make sure you are in the right branch (located right under the Commits tab).
Go into the README and search for a repo init command. If one exists, copy and paste it into the terminal and hit enter.
If one does not exist, you can make one with this formula:
Code:
repo init -u <url_of_manifest_repo>.git -b <branch_you_want_to_build>
For example:
Code:
repo init -u http://github.com/PureNexusProject/manifest.git -b n
After the repo has been initialized, run this command to download the source:
Code:
repo sync --force-sync
This process can take a while depending on your internet connection.
4. Build it!
At this point, it'd be a good idea to set up ccache. ccache is a compiler cache, it stores previously compiled files in a directory and pulls from that instead of recompiling if nothing has changed. This speeds up compilation a LOT. If you want to use it, follow the below steps:
Open up your .bashrc file in your home directory using a text editor or nano and append this to the end of it:
Code:
export USE_CCACHE=1
Then type:
Code:
source ~/.bashrc
After that, run one of the below command (replacing the # with how many GBs of ccache you want, 50 is recommended)
Use this one if you used the manual method of set up in section 1:
Code:
prebuilts/misc/linux-x86/ccache/ccache -M #G
Use this one if you used the automatic method of set up in section 1:
Code:
ccache -M #G
After that, it's time to build!
Code:
. build/envsetup.sh
breakfast bullhead
mka bacon
After that, your computer will build the flashable zip file and if you see something that says make completed, you've done it!
Any time that you want to rebuild, type the following commands:
Code:
repo sync --force-sync
. build/envsetup.sh
breakfast bullhead
mka clobber
mka bacon
I also have a script to do this on my Github here
Frequently Asked Questions
1.1 Q: I got an error, what do I do??
1.1 A: Well to start, if it is anything with Ninja, I would go ahead and disable it. You can add this to your .bashrc file:
Code:
export USE_NINJA=false
Then type this
Code:
source ~/.bashrc
. build/envsetup.sh
breakfast bullhead
mka clobber
mka bacon
If it is saying you ran out of memory, follow this post.
If it isn't Ninja related, check out @AzraelsKiss's post here, where he has documented a few common issues. If none of those apply, post here with a detailed list of what you have done and we will do our best to help you.
1.2 Q: Can you guys share your personal builds?
1.2 A: No, personal builds are just that: personal. Beans releases whenever he feels that the release is ready for the masses and if a bunch of personal builds are floating around, that tarnishes the Pure Nexus name. We are more than happy to help get you up and running but we will not be sharing our builds. Thanks for understanding!
this wont work on Windows, right?
RonnellTapawan said:
this wont work on Windows, right?
Click to expand...
Click to collapse
I have heard people try to use Bash for Windows but I don't think it will work. Linux or bust.
nathanchance said:
I have heard people try to use Bash for Windows but I don't think it will work. Linux or bust.
Click to expand...
Click to collapse
I tried on bash for windows but it can't build android roms
Dude you should seriously get a XDA medallion or some sort of metal for all you do all over XDA. I see you everywhere. Thanks for building for us and also for this write up. :good: @ nathan
SM210 said:
Dude you should seriously get a XDA medallion or some sort of metal for all you do all over XDA. I see you everywhere. Thanks for building for us and also for this write up. :good: @ nathan
Click to expand...
Click to collapse
Talk to my superiors :silly: thanks for the kind words
Edited.......
Sent from my Nexus 5X using Tapatalk
myawan said:
Anybody wanna share home made build?
Sent from my Nexus 5X using Tapatalk
Click to expand...
Click to collapse
If you read at the end of the OP, it says:
"1.2 Q: Can you guys share your personal builds?
1.2 A: No, personal builds are just that: personal. Beans releases whenever he feels that the release is ready for the masses and if a bunch of personal builds are floating around, that tarnishes the Pure Nexus name. We are more than happy to help get you up and running but we will not be sharing our builds. Thanks for understanding!"
Reason being, because if we start compiling these and handing it out like it's no ones business, we're going to run Pure Nexus into the ground and people will start uploading them on AFH and it'll be one big mess. My guess is, this is just a courtesy by the original poster to those of us who can't wait.
My two cents.:laugh::highfive:
i'm on it!!!!! thank you very much!!! download is taking forever ugh
Building it right now! Thanks
I think this would work in Cygwin. I used to compile stuff for the PS3 way back. I'd have a lot of reading to do if I wanted to build this for my phone.
Which gapps to use with this?
Open Gapps micro are working fine.
Gesendet von meinem Nexus 5X mit Tapatalk
So WE can't share our build either? Or what, i didn't get it.
CreasingMass Dev said:
So WE can't share our build either? Or what, i didn't get it.
Click to expand...
Click to collapse
Don't distribute personal builds. Flash them yourself and that is it.
4 hours of download :crying:
OOH MAN!!!!!! no more space in my device!!! how can i resume that???
Code:
Checking out files: 100% (1717/1717), done.
error: unable to write file current/platforms/android-21/arch-x86_64/usr/lib/libz.a
error: unable to write file current/platforms/android-21/arch-x86_64/usr/lib/libz.so
fatal: cannot create directory at 'current/platforms/android-21/arch-x86_64/usr/lib64': Spazio esaurito sul device
Traceback (most recent call last):
File "/home/matteo/Scaricati/PureNexus/.repo/repo/main.py", line 531, in <module>
_Main(sys.argv[1:])
File "/home/matteo/Scaricati/PureNexus/.repo/repo/main.py", line 507, in _Main
result = repo._Run(argv) or 0
File "/home/matteo/Scaricati/PureNexus/.repo/repo/main.py", line 180, in _Run
result = cmd.Execute(copts, cargs)
File "/home/matteo/Scaricati/PureNexus/.repo/repo/subcmds/sync.py", line 769, in Execute
project.Sync_LocalHalf(syncbuf, force_sync=opt.force_sync)
File "/home/matteo/Scaricati/PureNexus/.repo/repo/project.py", line 1325, in Sync_LocalHalf
self._InitWorkTree(force_sync=force_sync)
File "/home/matteo/Scaricati/PureNexus/.repo/repo/project.py", line 2482, in _InitWorkTree
raise GitError("cannot initialize work tree")
error.GitError: cannot initialize work tree
can i move the PureNexus folder in an external drive and resume??? please
MatteXperiaU said:
4 hours of download :crying:
OOH MAN!!!!!! no more space in my device!!! how can i resume that???
can i move the PureNexus folder in an external drive and resume??? please
Click to expand...
Click to collapse
You can try. Your build times will be much slower though.
Sent from my Nexus 6P using XDA Labs
nathanchance said:
You can try. Your build times will be much slower though.
Sent from my Nexus 6P using XDA Labs
Click to expand...
Click to collapse
i have another partition in the same HD (300GB).. i can use that :fingers-crossed:
which command i need to resume?
sorry for the questions man, you're too kind
TPMJB said:
I think this would work in Cygwin. I used to compile stuff for the PS3 way back. I'd have a lot of reading to do if I wanted to build this for my phone.
Click to expand...
Click to collapse
No promises...
http://www.howtogeek.com/249966/how-to-install-and-use-the-linux-bash-shell-on-windows-10/
Out of curiosity, realistically how much disk space would be required to download everything and compile with a 50GB cache? I got everything downloaded and the compile ran but threw some warnings (most of which may have been benign). When the compile terminated with an error, I had about 40MB left on my Linux Mint 18 partition so I assume it ran out of space I started with about 70GB free space
I deleted everything and decided to try again if and when I have a larger partition to play with..... I am currently dual booting on a Windows machine and didn't think to allocate that much space to Mint.
Paul

Categories

Resources