[NOOB GUIDE][how to]build cm or cm based rom from source+support - Galaxy S II Android Development

****NOOB GUIDE ON HOW TO BUILD CM OR CM BASED ROM FROM SOURCE FOR S2****
****FULL SUPPORT ****​
So guys from the concept of sharing and caring ..am going to share the way through which i have succeeded to compile my first rom based on omni source.
I will try to make this guide as much as easy ..so dont worry..and feel free to ask any doubt if u have..
Note: Most of the instructions are fit for Ubuntu running normally on any PC and not specific to Virtual Box
Things Required:
**Computer/Laptop with decent amount of ram (min 6gb)and also decent storage
**Internet connection(now thats obvious)
**Some knowledge about linux commands..like basic command such as cd for “change directory”,(anyways even if u dont know just copy and paste the codes given in the thread
**Last but not least "U must have android mobie" not an iphone (kidding)
This Guide will cover below things:
** How to install Ubuntu on virtual box
**How to set up Build environment
**How to build and compile rom
**transfer the zip from ubuntu to your phone
So lets begin
How to install ubuntu on Virtual box:
1. Download ubuntu from HERE(download ubuntu 12.04 LTS 64 bit)if u are having system with 2gb then pls dont try to compile
2. Download virtual box from HERE(download the latestwindows version x86/amd64)
3. After downloading vm click on it and select "NEXT"
4.Choose not to install USB support, networking, or Python support. Do this by clicking the grey icon near each option and selecting the red X or “Entire feature will be unavailable”. Then click “Next” to continue.
{
"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"
}
5.Uncheck the Quick Launch Bar checkbox and click “Next” to continue
6.Click install and finish.
7.Now click the new button at the top to create a new virtual machine.
8.Give your virtual machine a name and select the operating system you’ll be running(for e,g select version as ubuntu 64 if u are on 64bit os). Click “Next”.then slect create virtual hard drive now
9.now type the amount of memory ..(4gb is absolute minimum)
10.Click “Next” to create a new virtual hard disk, then click “Next” again
11.Select dyanmically allocated storage
12.now type the amount of storage(200 gb is minimum) and click create .
13.Select your new virtual machine. Once you've done this, click the “Settings” button.
14.Click “Storage” tab and Click the “CD/DVD icon" having "+" on it and select ISO to mount.
15.Click system on the left and Choose boot order and keep CD/DVD on the top as first priority.
16.Now close the settings window and Select your virtual machine. Then click the “Start” button
15.Now ubuntu will start and select the language
16.select install ubuntu
17.click continue and select the first radio button ..then hit continue again and install now(wait for some time)
18.Go through all the steps and finally u should have the below screen.(if u have got that screen then u are ok to proceed ahead )
16.So i assume you have got the ubuntu desktop .
17.click on ubuntu software centre avaliable on the left side and select edit/software sources
18.click on update tab and follow the screenshot below
19.After couple of min u should see update box is dancing on the left side , click that and install all the update packages
How to set up build environment:
1. Go to THIS awesome thread , I Bet u would not have any problem in setting up build environment if u had followed it correctly..
2.If u have any troubles in setting up build env then u are free to ask/post in this thread.
3.You can also set up adb and fast boot very easily instead of sdk tools (but remember it does not mean u can skip downloading sdk tools, you have to download all the packages .
Set up adb and fastboot with ease
4.you only need to download the below packages
JDK 6
Python
Git 1.7
Android SDK
ia32libs
So i assume you have set up your build environment successfully ..
How to build and compile :
1.We will install build packages needed to compile the rom.
2.Open your ubuntu terminal by pressing ctrl+alt+t
3.As of now u cannot copy/paste text between ubuntu and your windows ..so we will be installing guest addition cd image which u can install by clicking on Devices/install guest addition cd image .
4.it will install now , after that select Devices/share clipboard/bidirectional ..now reboot your ubuntu by typing the below code in terminal
Code:
sudo reboot
5.Now copy paste the below code in terminal to install build packages
Code:
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
Code:
sudo apt-get update
Code:
apt-get install g++-4.7 gcc-4.7
For 32-bit & 64-bit systems
Code:
git-core gnupg flex bison gperf libsdl1.2-dev libesd0-dev libwxgtk2.8-dev squashfs-tools build-essential zip curl
libncurses5-dev zlib1g-dev openjdk-6-jre openjdk-6-jdk pngcrush schedtool
For 64-bit only systems
Code:
g++-multilib lib32z1-dev lib32ncurses5-dev lib32readline-gplv2-dev gcc-4.7-multilib g++-4.5-multilib
6.You should not have any problem in installing the above packages if u had followed it correctly.
7.Now Create the directories
Code:
mkdir -p ~/bin
8.Install the repo command
:
Code:
curl http://commondatastorage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
chmod a+x ~/bin/repo
9.Important thing now is u have to put the bin directory in your path of execution..to do so ..copy and paste the below code
Code:
export PATH=${PATH}:~/bin
10. type
Code:
gedit ~/.bashrc
and now paste
Code:
export PATH=${PATH}:~/bin
11.save it by pressing ctrl+x
12. now we have to create a directory in which our source will get downloaded
Code:
mkdir -p dirname
(type the directory name )
Code:
cd dirname
13.Now its time for us to initialize the repository
Syntax :
Code:
repo init -u url -b branch
for e.g am going to fetch omni source..so i wil type as
Code:
repo init -u https://github.com/omnirom/android.git -b android-4.4
for pacman
Code:
repo init -u git://github.com/PAC-man/pacman.git -b pac-4.4
for slimbean( google, exynos and non qcom devices)
Code:
repo init -u git://github.com/SlimRoms/platform_manifest.git -b kk4.4
slimbean(for qcom devices which are using CodeAuroraForum trees)
Code:
repo init -u git://github.com/SlimRoms/platform_manifest.git -b kk4.4-caf
for cm
Code:
repo init -u git://github.com/CyanogenMod/android.git -b cm-11.0
14.then go to THISanother awesome thread to understand about the local manifest ,manifest and many more..(this thread is highly recommended to those who have poor internet connection)
15.IF u are lazy and dont want to go throu the above thread then u can skip and follow the below steps.
16.type
Code:
repo sync -c -j4
Note: if u have low bandwidth the use -j2 instead of -j4 and if u have good internet connection use -j16 instead of -j4
repo sycn -c will download only the current version so it saves time for u
17.repo sync will take more time..(for me it took 3 days to complete because my internet speed was 50kb/sec
18.After repo sync is done u have to fetch some additional repoistory using local_manifest.xml
Code:
<remote fetch="https://github.com/DonkeyCoyote" name="donkey" />
<project name="DonkeyCoyote/proprietary_vendor_samsung" path="vendor/samsung" remote="github" revision="android-4.4" />
<project name="android_device_samsung_i9100" path="device/samsung/i9100" remote="omnirom" revision="android-4.4" />
<project name="android_device_samsung_galaxys2-common" path="device/samsung/galaxys2-common" remote="omnirom" revision="android-4.4" />
thanks to chasmodo
note: above is an example for omni rom...if u are fetching aokp,pac etc then u have to change the path , remote , revision accordingly
19.Let's configure ccache too. It will reduce the build time to 40% after first build
Code:
echo "export USE_CCACHE=1" >> ~/.bashrc
Code:
directoryname/prebuilts/misc/linux-x86/ccache/ccache -M 25G
25G means it will use upto 25 gb of disk space for ccaching. Atleast 10 gb is recommended.
20.Now its time for compiling .simply type
Code:
. build/envsetup.sh
Code:
brunch i9100
21.it may take some time depending upon your pc/laptop configuration
22.u should get package complete at the end..(unfortunately i could not save screenshot of that..but soon s.s will be posted when i repo sync again)
23.If yes then u have successfully built your rom ..congrats:good:
24.now how to transfer that zip to the phone for flashing?..follow the below steps
how to transfer files from ubuntu to your phone:
1: Download and install the AirDroid app to your Android device.
2: Launch the app and read the starter guide. As soon as you’re done, click “Start”.
3: Take note of the web address that is being shown on the app. You’ll need that web address to access your smartphone through your computer’s web browser.
4.now type the code in ubuntu browser and there u go ...u have connected your phone to ubuntu.
5.transfer the file by selection files/sdcard/upload
6.Done
Hope this guide helps u the most.
IF U HAVE ANY QUESTION FEEL FREE TO POST ..cheers.
GOOD LUCK:good:
Credits:
@Myself5 (this guy really deserves it)
@chasmodo @engloa
google
Hit the thanks button if u think it deserves to have..:highfive:

Nice!

-Grift- said:
Nice!
Click to expand...
Click to collapse
Thanks buddy.
Took me 3hr to write.. Phew
Sent from my GT-I9100 using Tapatalk 2

corruptionfreeindia said:
Thanks buddy.
Took me 3hr to write.. Phew
Sent from my GT-I9100 using Tapatalk 2
Click to expand...
Click to collapse
*Browser crashes just before you get to post* FUUUUUU:laugh:

Will Surely try................... Great effort thou.....

Although this is of immense help, IMO this shows the huge amount of work put out by our ROM developers.
So, thank you @cfi and hopefully some new devs will grow out of this.
Sent from my GT-I9100 using XDA Premium 4 mobile app

corruptionfreeindia said:
Thanks buddy.
Took me 3hr to write.. Phew
Sent from my GT-I9100 using Tapatalk 2
Click to expand...
Click to collapse
It took me 3hr to read and Digest Phew!!U should also Add the Min Hardware requirement to the guide

Sun90 said:
It took me 3hr to read and Digest Phew!!U should also Add the Min Hardware requirement to the guide
Click to expand...
Click to collapse
Min hardware requirement of what mate?
if you mean virtualbox, you can check this out

engloa said:
Min hardware requirement of what mate?
if you mean virtualbox, you can check this out
Click to expand...
Click to collapse
The system (computer) hardware requirement ma8

Thanks "again" for a "monster" thread

Sun90 said:
It took me 3hr to read and Digest Phew!!U should also Add the Min Hardware requirement to the guide
Click to expand...
Click to collapse
Sure buddy..I will.
Am already tired.
Have to go college tomo
Sent from my GT-I9100 using Tapatalk 2

-Grift- said:
*Browser crashes just before you get to post* FUUUUUU:laugh:
Click to expand...
Click to collapse
Lol
Sent from my GT-I9100 using Tapatalk 2

Sun90 said:
The system (computer) hardware requirement ma8
Click to expand...
Click to collapse
You could (theoretically) build with almost everything where you get Linux to work on but remember, it will then finish today's nightly in 3 days Also there are some people reporting compiling crashes when you don't have enough RAM (@corruptionfreeindia was one of them ).
Greetings
Myself5

Myself5 said:
Also there are some people reporting compiling crashes when you don't have enough RAM (@corruptionfreeindia was one of them ).
Greetings
Myself5
Click to expand...
Click to collapse
haha..;D

Great thread,thanks
keep it up:good::good:

Set up ADB and Fastboot for Ubuntu with ease
http://www.webupd8.org/2012/08/install-adb-and-fastboot-android-tools.html
After installing it this way you can excess ADB or Fastboot commands through the terminal from anywhere. This integrates the commands perfectly

-Grift- said:
Set up ADB and Fastboot for Ubuntu with ease
http://www.webupd8.org/2012/08/install-adb-and-fastboot-android-tools.html
After installing it this way you can excess ADB or Fastboot commands through the terminal from anywhere. This integrates the commands perfectly
Click to expand...
Click to collapse
Buddy..thanks.
Looks so easy.
Adding it to the op if u dont mind.
Biftor said:
Great thread,thanks
keep it up:good::good:
Click to expand...
Click to collapse
Thanks biftor.
Sent from my GT-I9100 using Tapatalk 2

corruptionfreeindia said:
Buddy..thanks.
Looks so easy.
Adding it to the op if u dont mind.
Thanks biftor.
Sent from my GT-I9100 using Tapatalk 2
Click to expand...
Click to collapse
Im cool with that

Nice guide.. very lucid and simple language. easy to learn. Thanks!

awesome it will b very helpful.... such a nice thread you wrote

Related

[CMC-GUI] [DAILY] [PPA] Cyanogenmod Compiler Daily [Depreciated]

Cyanogenmod Compiler (CMC) GUI
Build cyanogenmod with a gui.
{
"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"
}
Known issues:
- Currently no multi-threading, which means when you press sync or compile, there is no loading bar (app looks like its failing, its not.). I am working on that.
(If you want to watch the output of the sync or compile, just open a terminal and type "cmc", I log all to the system.)
- When locking the CMCompiler to the unity launcher you have to logout and log back in refer: ubuntu bug 916098
- Currently there isn't great error logic and dialogs to warn you about everything. Something that is still being working on. Just run from the terminal if you have an issue that you need to report.
- Missing make clean and make installclean. These will be added in the future.
Found bugs to fix v0.1:
- No "/" at the end of custom repo string path.
- Error checking for compile start
*Please any issue that should arise, I apologize in advanced. Please let me know with as much detail as possible to replicate the issue and I will resolve it.
Please read:
I have thought maybe times different ways I was going to go about this. Ads, donate version, paid app, etc. I choose to keep the project open, as that's how I roll. I do ask that if you enjoy the application that you try to donate something. This was my first gui project and took a lot of time and effort to even get it to where it is right now. I hope everyone enjoys the app as much as I enjoy working on it.
Install:
Note: If you are using the old ppa then look at post # 2 on how to remove it before adding this.
Code:
sudo apt-add-repository ppa:lithid/ppa
sudo apt-get update
Install daily dev builds:
Code:
sudo apt-get install cmcompiler-daily
Install beta builds:
Note: Not yet available.
Code:
sudo apt-get install cmcompiler-beta
Install stable builds:
Note: Not yet available.
Code:
sudo apt-get install cmcompiler
Note: You cannot have daily and stable at the same time. You can only use either or.
Source code | Bugs | Answers
Build info:
daily-builds
Enjoy some signatures from SavocaFTW:
You can follow me on google+ I tend to talk about it a bit on there as well.
Cyanogenmod Compiler (CMCompiler) HALP!
Error Codes:
Error: Need to sync first - After choosing compile, the program didn't find the needed .repo folder in your repo path. This assumes you never ran sync, so you never downloaded the code. You could have also renamed the .repo folder to something else, which would cause this error as well.
Error: device not found - Your device was not found in the repo, might be unsupported.
Error: Adb isn't running - First time running compile, you will need to have your phone connected and ADB running in order to pull off needed files from your phone.
Error: Extract-files came back False - This means a script called extract-files.sh failed to pull off those needed files from your phone.
Error: Compile error please check - This indicates that your build failed. You will need to run cmcompiler via terminal to get why.
Error: Repo Script needs setup - You don't have the repo script installed. Install it.
Code:
curl https://dl-ssl.google.com/dl/googlesource/git-repo/repo > ~/repo
chmod a+x ~/repo
sudo mv ~/repo /usr/local/bin/repo
Error: No device configured - Appears there is no device configured, just select one from the setup menu.
Removing old ppa:
Code:
sudo apt-get remove cmcompiler-daily
sudo apt-get install ppa-purge
sudo ppa-purge ppa:long-jeremie/ppa
About Cmcompiler CLI
** If you are still using the CLI version, I have not updated it in sometime. I might get back to that but for right now the gui is my main focus. Please understand. You could always clone and make edits to the CLI here
This changes everything, again.
Great idea. Thanks.
Awesome! Thank you very much
this is neat! good job
Is there any support for pulling propriety files from a new phone or is that too specific?
Sent from my M9300 using xda premium
Jamin13 said:
Is there any support for pulling propriety files from a new phone or is that too specific?
Sent from my M9300 using xda premium
Click to expand...
Click to collapse
Currently there is only support for devices from within the CM repo. There could be a plugin created though for specific devices that are not "supported" by cm. You would still need someone to write that plugin for that device since prop files are different for each device.
lithid-cm said:
Software for compiling on ubuntu:
32 bit:
Code:
git-core gnupg flex bison gperf libsdl1.2-dev libesd0-dev libwxgtk2.6-dev squashfs-tools build-essential zip curl libncurses5-dev zlib1g-dev sun-java6-jdk pngcrush schedtool
64 bit:
Code:
g++-multilib lib32z1-dev lib32ncurses5-dev lib32readline5-dev gcc-4.3-multilib g++-4.3-multilib
Click to expand...
Click to collapse
lib32readline5-dev has been replaced by lib32readline-gplv2-dev on 11.10
And "gcc-4.3-multilib g++-4.3-multilib" aren't used from 11.04 and up - not needed.
Nice work though!
lithid-cm said:
If you are wondering how you can use this software its easy. You can clone my repo for now. and run the CMCompiler script:
Code:
git clone https://[email protected]/lithid/CMC.git
cd CMC
./CMCompiler
Click to expand...
Click to collapse
Hmmmm.
Code:
git clone https://github.com/lithid/CMC.git
cd CMC
./CMCompiler
Now we're talkin'!
Novek said:
lib32readline5-dev has been replaced by lib32readline-gplv2-dev on 11.10
And "gcc-4.3-multilib g++-4.3-multilib" aren't used from 11.04 and up - not needed.
Nice work though!
Click to expand...
Click to collapse
Updated second post. Thanks!
aorth said:
Hmmmm.
Code:
git clone https://github.com/lithid/CMC.git
cd CMC
./CMCompiler
Now we're talkin'!
Click to expand...
Click to collapse
I fixed that. No idea why I put that in their like that. Thanks!
lithid-cm said:
Currently there is only support for devices from within the CM repo. There could be a plugin created though for specific devices that are not "supported" by cm. You would still need someone to write that plugin for that device since prop files are different for each device.
Click to expand...
Click to collapse
Thanks.
If I could just figure out how to do it normally, I'd be fine.
unfortunately I can't seem to find anything about doing that.
Sent from my M9300 using xda premium
TEH KANGENAT0rZ!!!!1on1on1oneone!!
Jamin13 said:
Thanks.
If I could just figure out how to do it normally, I'd be fine.
unfortunately I can't seem to find anything about doing that.
Sent from my M9300 using xda premium
Click to expand...
Click to collapse
If you are looking to build on a new device. Go to cms github and grab a device tree from a similar device. Then you can see how everything is working... gather the stuff you need along with the device specific edits and hours and hours of trial and error. You will eventually get it... Its a learning process.
optedoblivion said:
TEH KANGENAT0rZ!!!!1on1on1oneone!!
Click to expand...
Click to collapse
King Kang?
This looks awesome! Thank you! I'm gonna try this out sometime this week. Thanks again!
This is a really cool project. For those of us who are uninitiated in using Git/Repo, will this make "making changes" to CM easy for us? Obviously, I see "Update Repo" as an option, but it will really take care of the rest for us?
Shidell said:
This is a really cool project. For those of us who are uninitiated in using Git/Repo, will this make "making changes" to CM easy for us? Obviously, I see "Update Repo" as an option, but it will really take care of the rest for us?
Click to expand...
Click to collapse
As of this moment. This doesn't support the needed bits for when you need to commit the code back to cm gerrit. This is something I am working on for my stable release. At this current state you can download the repo, assign a device, compile and update without any work needed done by the end user. When the rom is done downloading it gets placed in your home directory. I am not sure if that answered the question or not...
Soon there will be an option to make changes to the repo. This would enable repo start it would wait until you press enter again once changes are done and then commit them with repo upload. Of course this is still being worked out though.
Awesome--yeah, that answers my question. Thanks!
Nice job. Thank you for it.

[ GUIDE ] How to Configure Ubuntu 13.04 Raring Ringtail for Compiling Android ROMs

--- copied with permission from nathanpfry.com ---​
Initializing a fresh Android Build Environment in Ubuntu 13.04 sucks, right? The instructions at the aosp page are outdated at best, wrong at worst. Near as I can tell, they try to have you install 2 JDKs, the first one not even being the correct link for Raring Ringtail, and the second being OpenJDK. Which might work. But iiiiiiii dunno about all that, I'd rather have Oracle's official stamp when it comes to building for Android.
Currently most of the guides are up to 12.04 LTS, which is fine and dandy, but being on the cutting edge is nice too. Plus, I don't think I've seen anyone aggregate the directions in this order, for the correct official JDK and everything just right for building happiness.
This guide applies to Ubuntu 13.04 Raring Ringtail 64 bit. Do not use 32 Bit. Also, PAY CLOSE ATTENTION when to use "sudo" and when to not. It can make things funky if you do something as root that you shouldn't.
Much thanks goes out to Google, ProTekk, Canonical, and everyone else that I read a random paragraph here and snippet there.
First, let's set up the correct JDK.
Many of you probably have some kind of wrong Java installed. Sad cupcake.
Let's get rid of that. Copy and paste this into a Terminal window:
Code:
sudo apt-get purge openjdk-\* icedtea-\* icedtea6-\*
Banish the OpenJDK! If you must keep it, it's possible. But I'm not going to tell you how to do it here. I don't want any chance of confusion or mistake.
Back to the Terminal. Copypasta the following:
Code:
sudo add-apt-repository ppa:webupd8team/java
This will add the correct PPA to your system for updated builds of Java 6 JDK that are compatible with 13.04. No more unrecognized Java version errors! Yay! And it's self updating, so you don't have to redownload binaries everytime they release a new version.
Next, we actually need to install the package. More copypasta:
Code:
sudo apt-get update && sudo apt-get install oracle-java6-installer
Follow the onscreen instructions. You have to Accept the Licensing Agreement or whatever. Hopefully no human centipede clauses. Once that is completed successfully, you will have to restart any open browsers with Java content for it to display correctly.
To make sure the correct version of Java is activated, run the following at the Terminal prompt:
Code:
java -version
You should see something like the following:
java version "1.6.0_37"
Java(TM) SE Runtime Environment (build 1.6.0_37-b06)
Java HotSpot(TM) 64-Bit Server VM (build 20.12-b01, mixed mode)
Ok, back to a fresh Terminal prompt. Time for installing the guts to build stuff in Ubuntu:
Code:
sudo apt-get install git-core gnupg flex bison gperf build-essential zip curl zlib1g-dev zlib1g-dev:i386 libc6-dev lib32ncurses5-dev ia32-libs x11proto-core-dev libx11-dev:i386 libreadline6-dev:i386 lib32z-dev libgl1-mesa-glx:i386 libgl1-mesa-dev g++-multilib mingw32 tofrodos python-markdown libxml2-utils xsltproc readline-common libreadline6-dev libreadline6 lib32readline-gplv2-dev libncurses5-dev lib32readline5 lib32readline6 libreadline-dev libreadline6-dev:i386 libreadline6:i386 bzip2 libbz2-dev libbz2-1.0 libghc-bzlib-dev lib32bz2-dev libsdl1.2-dev libesd0-dev squashfs-tools pngcrush schedtool libwxgtk2.8-dev python gcc g++ cpp gcc-4.8 g++-4.8 ccache
And we wait. Don't worry, this isn't the crazy downloading part just yet.
When that is done, do this:
Code:
sudo ln -s /usr/lib/i386-linux-gnu/mesa/libGL.so.1 /usr/lib/i386-linux-gnu/libGL.so
That's probably it on the package side of things. Probably.
You guessed it, time for more Terminal. This really is the easiest way, seriously. And it's totally worth it when you're basking in the glory of a bunch of people on XDA.
The binary for repo will let you talk to git servers and download all that precious source code. That second part after the && allows it to be executable:
Code:
mkdir ~/bin && curl http://commondatastorage.googleapis.com/git-repo-downloads/repo > ~/bin/repo && chmod a+x ~/bin/repo
Use your favorite text editor to open ~/.bashrc
I like nano:
Code:
sudo nano ~/.bashrc
At the very bottom, add the following line:
Code:
export PATH=~/bin:$PATH
Save it. In nano that would be Ctrl-O and then Enter. Then Ctrl-X to exit back to a prompt. Restart bash:
Code:
source ~/.bashrc
In the terminal, navigate to where you would like to store the Android source code. The directions below will make it in your home folder, but if you have limited space, you may want to create it somewhere else. Faster is better, i.e. SSD would be best, USB external is basically unusable. Here we go:
Code:
mkdir ~/android
cd ~/android
Now you're going to initialize the repo. Here's where you decide the flavor of Android you want to build for, ie AOKP, CyanogenMod, AOSP etc. The following, for the purposes of this tutorial, will initialize for AOKP:
Code:
repo init -u git://github.com/AOKP/platform_manifest.git -b jb
Almost there. Last step, but it's a doozy. You're going to get the source. Prepare yourself, mere mortal. 10+ GB of downloading await you. Don't worry, it's automated. Go to sleep. Eat something. Perhaps you have heard of this new thing the kids are doing called "going outside"? Yeah, I didn't think so. Me neither. Hey everyone, it's a terminal:
Code:
repo sync
Check back periodically every hour or so. It really all depends on how fast your internet connection is.
That should be everything. Now you're ready to build Android the right way. Luck!
Feel free to buy me a coconut water (donate) if you like my work. It would be greatly appreciated!
Please hit the "Thanks" button if this post helped you out.​
For guides on how to compile ROMs from source and other Android/Ubuntu topics, check out my blog!
oh !
I'll try building on 13.04!!! thx :good:
I did mistype, nvm!
Isn't this just like your 12.10 guide? And this would work on the nexus 7?
Sent from my VS920 4G using Tapatalk 2
azoller1 said:
Isn't this just like your 12.10 guide? And this would work on the nexus 7?
Sent from my VS920 4G using Tapatalk 2
Click to expand...
Click to collapse
There are subtle differences but more or less.
People would be looking for the info eventually so I put it out there.
This setup should let you compile for just about any Android device that's supported or has a github et al repo.
I meant is it possible to build ROMs on the nexus 7 running Ubuntu 13.04 or 12.10
Sent from my VS920 4G using Tapatalk 4 Beta
thanks for sharing this information!! :good:
azoller1 said:
I meant is it possible to build ROMs on the nexus 7 running Ubuntu 13.04 or 12.10
Sent from my VS920 4G using Tapatalk 4 Beta
Click to expand...
Click to collapse
Yes. Google uses Ubuntu 12.04LTS to build AOSP for all of its devices, so the N7 should show up in the lunch menu. 12.10 and 13.04 will operate the same way.
No, using my nexus 7 with Ubuntu desktop running on my nexus 7 and then building a ROM with Ubuntu running on my nexus 7 thats what I meant
Sent from my Nexus 7 using Tapatalk HD
azoller1 said:
No, using my nexus 7 with Ubuntu desktop running on my nexus 7 and then building a ROM with Ubuntu running on my nexus 7 thats what I meant
Sent from my Nexus 7 using Tapatalk HD
Click to expand...
Click to collapse
Oooooh, I see what you mean. In that case, I highly doubt it. I'm not 100% sure what kind of specs the N7 has, but just in terms of RAM, building on it would probably crash the tablet. Not to mention the fact that you may not have enough storage space to even download the repo... It's between 15-30GB,depending on which branch you sync.
You never know though... I'm attempting to compile kernels on a dead laptop. I used an 8GB flash drive to install 12.04 on, and after syncing the source, I still have about 300MB of space left. The computer runs slow as dirt, but it works.
azoller1 said:
No, using my nexus 7 with Ubuntu desktop running on my nexus 7 and then building a ROM with Ubuntu running on my nexus 7 thats what I meant
Sent from my Nexus 7 using Tapatalk HD
Click to expand...
Click to collapse
Don't even try, its not even about whether or not you can download it or even compile it, compile times would be HORRENDOUS. A pentium 4 could beat a tegra 3 in processing power, while arm is AMAZING for power effeciency, you can't really beat the x86 architecture, plus you would lose a lot of toolchain optimizations.It would take you well over 1 day, probably closer to 2 days to compile a single rom, not factoring in any errors you run into.
THEindian said:
Don't even try, its not even about whether or not you can download it or even compile it, compile times would be HORRENDOUS. A pentium 4 could beat a tegra 3 in processing power, while arm is AMAZING for power effeciency, you can't really beat the x86 architecture, plus you would lose a lot of toolchain optimizations.It would take you well over 1 day, probably closer to 2 days to compile a single rom, not factoring in any errors you run into.
Click to expand...
Click to collapse
after following this guide will I be somewhat set up to build touchwiz kernels?
I am reading that older versions are better for kernel compiling.. thanks
Rushing said:
after following this guide will I be somewhat set up to build touchwiz kernels?
I am reading that older versions are better for kernel compiling.. thanks
Click to expand...
Click to collapse
No, go ahead and follow this guide, usually, older versions are recommended because all the necissary drivers are guaranteed but you'll be fine in this case.
Is that a user maintained repo for java or oracle maintained? Since everyone just seems to push for new new things not old stable things.
Sent from my Xperia Play using Tapatalk 2
java 6 jdk oracle is the developer of java ^^
oh and btw, im fine with this guide to compile 2.3, 4.0, 4.1, 4.2 ^^
Thx man
getting this......
handryg555 said:
getting this......
Click to expand...
Click to collapse
Are you sure you've installed the 64 bit version of Ubuntu? It looks like the 32 bit packages are all found fine..
Help?
I'm getting this :
{
"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"
}
sylentprofet said:
Are you sure you've installed the 64 bit version of Ubuntu? It looks like the 32 bit packages are all found fine..
Click to expand...
Click to collapse
yup I'm using ubuntu 13.04 64 bit edition.......
Sent from my One V using xda premium
then pls tell me what i did without changes and all is fine? Oo

[ OS ] Builduntu Install Disc v2 - Android ROM Compiling OS

--- copied with permission from nathanpfry.com ---​
Builduntu is a custom branch of the Ubuntu operating system, based on my guide here for preparing Ubuntu 16.04 to compile Android ROMs from source. It includes everything you need to sync with the repository of your choice (Cyanogenmod, AOKP, AOSP, etc) and start building.
I am not responsible for any damage you may cause to your system/files while trying to install Builduntu. This has been tested and verified working by me, so if you break Windows or your system won't boot, it's your fault.
This thread is not the place to ask how to install Linux or Dual Boot!!! These topics are well documented elsewhere and can be easily found in a few seconds on Google.
Thanks to Canonical, Google and me.
Features:
- Xubuntu 16.04 LTS base system
- Installed all necessary packages for compiling (list available in the guide link above)
- Unnecessary junk removed (media players, games etc.)
All you have to do is download the source!
The only requirement is that your host machine supports a 64 bit OS. 32 bit systems will not work!
Instructions:
1. Use your favorite image burning software to write the builduntu ISO to a blank DVD. Will not fit on a CD
2. Boot the disc. When the graphical installer starts, click "Install Xubuntu"
3. Follow the on-screen instructions to select language, username, etc. * Note * When setting up partitions, I recommend doing it yourself if you know how. If not, that's fine, let Ubuntu decide for you.
4. When the installation finishes, reboot and eject the installation media.
5. Sync the Android source locally:
~ A program called "repo" lets you communicate with git repositories and download source code. The following command will install it:
Code:
mkdir ~/bin && curl http://commondatastorage.googleapis.com/git-repo-downloads/repo > ~/bin/repo && chmod a+x ~/bin/repo
~ Use nano to edit ~/.bashrc
Code:
sudo nano ~/.bashrc
~ At the very bottom (use the Page Down key) paste this code to a new (empty) line:
Code:
export PATH=~/bin:$PATH
~ Save it. In nano that would be Ctrl-O and then Enter. Then Ctrl-X to exit back to a prompt. Restart bash:
Code:
source ~/.bashrc
~ In the terminal, navigate to where you would like to download the Android source code. The command below will make it in your home folder, but if you have limited space you may want to create it somewhere else. Faster is better, i.e. SSD would be best, USB external is basically unusable.
Code:
mkdir ~/android
cd ~/android
~ Now to initialize the repo. Decide the flavor of Android to build, i.e. AOKP, CyanogenMod, AOSP etc.
For the purposes of the tutorial, here's the command for CyanogenMod 13:
Code:
repo init -u https://github.com/CyanogenMod/android.git -b cm-13.0
repo sync
When that is finished downloading, you're ready to start compiling ROMs!
Download Builduntu ISO:
Click here for mirrors!
Let me know how it works for you!
Feel free to buy me a Zico (donate) if you like my work. It would be greatly appreciated!
Please hit the "Thanks" button if this project helps you out!​
Code:
[U][B]Changelog:[/B][/U]
v1.0 - First Release Mar 05 2014
v1.1 - Rebuilt from scratch the hard way
v1.2 - 4/20 Release - Update to 14.04 LTS Official
v2.0 - Update to 16.04 LTS with OpenJDK 8 for Android M builds
This is just awesome +1
This is Xubuntu 13.10...
I burned image on DVD using Brasero (ubuntu program) and run installation process from that DVD.
And before the end of installation I got this error:
{
"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"
}
Of course "buildbuntu" doesn't boot, some errors with reading/writing sda partition.
Luckly I installed it on my test drive so my workspace isn't damaged.
lozohcum said:
This is Xubuntu 13.10...
I burned image on DVD using Brasero (ubuntu program) and run installation process from that DVD.
Click to expand...
Click to collapse
I installed it to a fresh system just fine yesterday, not sure what your issue could be from. Could you post an installation log? Did you verify the md5sum of your downloaded file?
It is in fact Xubuntu 14.04. Canonical hasn't bothered changing the initial splash screen yet because it's still in beta. If you run the Live instance and check the version of ubuntu it correctly identifies as Trusty Tahr.
sylentprofet said:
I installed it to a fresh system just fine yesterday, not sure what your issue could be from. Could you post an installation log? Did you verify the md5sum of your downloaded file?
It is in fact Xubuntu 14.04. Canonical hasn't bothered changing the initial splash screen yet because it's still in beta. If you run the Live instance and check the version of ubuntu it correctly identifies as Trusty Tahr.
Click to expand...
Click to collapse
How to take installation log?
lozohcum said:
How to take installation log?
Click to expand...
Click to collapse
After the error appears it should load you into a live desktop session. The install log will be located there, perhaps in /var/log, /var/log/installer or the guest session home directory. Look around for .log files
edit : delete
I was hoping for a ubuntu base same as your virtual os..xubuntu ui is different and difficult
Ccahe error
Im trying to compile tihe ccache and when i set it up i recieve this error
bash: prebuilts/misc/linux-x86/ccache/ccache: No such file or directory
any ideas on how i can fix this would be appreciated
thanks
perfectpitch said:
Im trying to compile tihe ccache and when i set it up i recieve this error
bash: prebuilts/misc/linux-x86/ccache/ccache: No such file or directory
any ideas on how i can fix this would be appreciated
thanks
Click to expand...
Click to collapse
First, make sure ccache is installed (I'm reasonably sure it is out of the box)
Code:
sudo apt-get install ccache
If that's ok, check this link below and scroll down to Step 4a (optional).
http://forum.xda-developers.com/showthread.php?t=2506695
Ccache is not necessary and not ideal for all systems, so you may just want to disable it in your build process. Hope this helps.
Thanks I'll check it out
Sent from my Nexus 4 using XDA Premium 4 mobile app
so i dual booted ubuntu 13.10 on my laptop... but i couldn't build on it due to some stupidity... anyway, if someone could answer me some questions, maybe I'll uninstall ubuntu and switch to this since it's way easier for me.
1) did anyone successfully dual boot it? even with UEFI on?
2) can we transfer the source codes from an OS to another by packaging them and then extracting them in the new xubuntu? will it work that way?
Sent from my Nexus 4
lozohcum said:
This is Xubuntu 13.10...
I burned image on DVD using Brasero (ubuntu program) and run installation process from that DVD.
And before the end of installation I got this error:
Of course "buildbuntu" doesn't boot, some errors with reading/writing sda partition.
Luckly I installed it on my test drive so my workspace isn't damaged.
Click to expand...
Click to collapse
Hello, have you already solved that problem? Because since hours, even days I try to install builduntu on my notebook, but always got that error too!. I have usb legacy enabled, raid disabled and uefi boot enabled. I have a small ssd and a normal hdd. What am I doing wrong. I cannot get it to work, neither with manual editing the moint points, nor with automatically install through the system.
Many thanks!!
rodman01 said:
Hello, have you already solved that problem? Because since hours, even days I try to install builduntu on my notebook, but always got that error too!. I have usb legacy enabled, raid disabled and uefi boot enabled. I have a small ssd and a normal hdd. What am I doing wrong. I cannot get it to work, neither with manual editing the moint points, nor with automatically install through the system.
Many thanks!!
Click to expand...
Click to collapse
I never received an installation log from anyone so I have no way to start to figure out what went wrong.
It seems like many users have installed successfully, but a few are encountering errors like the one mentioned above.
I don't know how to help you without more information about the problem and your system. It could be a million things with how vague the descriptions are.
rodman01 said:
Hello, have you already solved that problem? Because since hours, even days I try to install builduntu on my notebook, but always got that error too!. I have usb legacy enabled, raid disabled and uefi boot enabled. I have a small ssd and a normal hdd. What am I doing wrong. I cannot get it to work, neither with manual editing the moint points, nor with automatically install through the system.
Many thanks!!
Click to expand...
Click to collapse
I haven't fixed it. I installed xubuntu and ocnfigured it on my own.
I wasted two DVDs for that Builduntu :/
i installed xubuntu today, it boots without a CD (just to confirm it's installed)
inside settings there's a button called "Install RELEASE", should i? i mean... it's already installed :S
Sent from my Nexus 4
sylentprofet said:
I never received an installation log from anyone so I have no way to start to figure out what went wrong.
It seems like many users have installed successfully, but a few are encountering errors like the one mentioned above.
I don't know how to help you without more information about the problem and your system. It could be a million things with how vague the descriptions are.
Click to expand...
Click to collapse
Yes sure can be many things....but here attached are some log files one/two from my try a couple of minutes ago. Problem is, that I already tried so many things and absolutely not sure whether it is my fault, my hardware or perhaps a bad download, in short where I have to look for the solution? Perhaps the log files give some useful information to you :fingers-crossed:
lozohcum said:
I haven't fixed it. I installed xubuntu and ocnfigured it on my own.
I wasted two DVDs for that Builduntu :/
Click to expand...
Click to collapse
Thanks for the info...can you pass me the download link? Haven't found it after a first and quick search ...
Edit: found it in the meantime....
update
In the meantime, I have also downloaded the "pure" Xubuntu and got it installed with the very first try. Exact with the same settings as last tries with builduntu. Dev environment is installed and source codes downloaded. At the moment I am building my first rom with this software. Hopefully it finishes without errors :fingers-crossed: .
i downloaded the sources on a VM, but couldn't make it work on my secondary OS after compression, tranfser, and extraction of the sources...
now redownloading from scratch on a 1Mbps (that's 128KB/s max) speed
Sent from my Nexus 4

[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 6. 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 shamu
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 shamu
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 shamu
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!
u mean Nexus 6.
@The Flash
bit of a typo on the device bro, but thanks for the write up. I've not followed your build guide but I've heard great things about it,
[email protected] said:
u mean Nexus 6.
Click to expand...
Click to collapse
Lawlrus said:
@The Flash
bit of a typo on the device bro, but thanks for the write up. I've not followed your build guide but I've heard great things about it,
Click to expand...
Click to collapse
{
"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"
}
This is genius! Thanks for the write-up!
Sent from my Nexus 6 using XDA-Developers mobile app
giving this a try today! I resized my partitions to give linux as much room as possible, but idk if that will still be enough considering i have a SSD. I have a 130gb home partition right now. Wish I could give up more of my 256GB, but I'm triple booting windows 10, ubuntu, and the new cm13 androidx86.
I def want to be able to do this though, I may have to go out today and pickup an externel hdd
slothdabski said:
giving this a try today! I resized my partitions to give linux as much room as possible, but idk if that will still be enough considering i have a SSD. I have a 130gb home partition right now. Wish I could give up more of my 256GB, but I'm triple booting windows 10, ubuntu, and the new cm13 androidx86.
I def want to be able to do this though, I may have to go out today and pickup an externel hdd
Click to expand...
Click to collapse
Source is usually about 30-50 gigs the first time you synch
Lawlrus said:
Source is usually about 30-50 gigs the first time you synch
Click to expand...
Click to collapse
I see that lol, I'm at 13gb so far. I've been reading the building how to in the 6p forum since it has a lot more comments and info. I know I'm really going to be cutting it close and theres a good chance I'll run out of space. Depending on how close I get, I may try to shave another 10gb off my windows partition to get 1 actual build done before I drop money on an external hdd. Although that may not be worth the trouble since it looks like I can pick up a 1tb external for around $55. And I would really like to have a large enough ccache to keep build times down
Sent from my NuttyNexus using Tapatalk
slothdabski said:
I see that lol, I'm at 13gb so far. I've been reading the building how to in the 6p forum since it has a lot more comments and info. I know I'm really going to be cutting it close and theres a good chance I'll run out of space. Depending on how close I get, I may try to shave another 10gb off my windows partition to get 1 actual build done before I drop money on an external hdd. Although that may not be worth the trouble since it looks like I can pick up a 1tb external for around $55. And I would really like to have a large enough ccache to keep build times down
Sent from my NuttyNexus using Tapatalk
Click to expand...
Click to collapse
Yeah, plus I'm not sure if building on a ssd would burn it out fast or not. I always wondered that myself, but the price of ssd is getting so low anymore, I guess its not that big of an issue.
After the first synch, it gets much easier on the downloads lol. First is always the most intensive, any time you synch after its just the small updates.
Lawlrus said:
Yeah, plus I'm not sure if building on a ssd would burn it out fast or not. I always wondered that myself, but the price of ssd is getting so low anymore, I guess its not that big of an issue.
After the first synch, it gets much easier on the downloads lol. First is always the most intensive, any time you synch after its just the small updates.
Click to expand...
Click to collapse
I didn't realise that was that much of an issue with ssd's! S***, I may have to get the external anyways BC I'm using a 2in1 tablet style laptop that doesn't have a user serviceable drive! I don't want a $750 machine to go bust, I'd rather drop $55 on the external lol.
Is it syncing or building that is the most taxing on the drive, or both?
Sent from my NuttyNexus using Tapatalk
slothdabski said:
I didn't realise that was that much of an issue with ssd's! S***, I may have to get the external anyways BC I'm using a 2in1 tablet style laptop that doesn't have a user serviceable drive! I don't want a $750 machine to go bust, I'd rather drop $55 on the external lol.
Is it syncing or building that is the most taxing on the drive, or both?
Sent from my NuttyNexus using Tapatalk
Click to expand...
Click to collapse
I honestly don't even know if it is, might want to wait for Nathan or someone else to chime in, I would think it would be the act of building. But as I've never actually gotten a build to work properly, I'd take what I said with a grain of salt
Lawlrus said:
I honestly don't even know if it is, might want to wait for Nathan or someone else to chime in, I would think it would be the act of building. But as I've never actually gotten a build to work properly, I'd take what I said with a grain of salt
Click to expand...
Click to collapse
Hmm so it sounds likes a lot can go wrong with building. Well, if I can do one build successfully, I can justify buying a drive to build more. One build shouldn't kill my drive since I usually don't usually do r/w intensive tasks on this computer
Sent from my NuttyNexus using Tapatalk
slothdabski said:
I didn't realise that was that much of an issue with ssd's! S***, I may have to get the external anyways BC I'm using a 2in1 tablet style laptop that doesn't have a user serviceable drive! I don't want a $750 machine to go bust, I'd rather drop $55 on the external lol.
Is it syncing or building that is the most taxing on the drive, or both?
Sent from my NuttyNexus using Tapatalk
Click to expand...
Click to collapse
It's probably the repeated compilitations.
While modern SSDs do a good job of balancing wear and tear... SSDs by the simple nature of Solid State storage have a finite number of write cycles. During normal usage you should really never max this out. However, when compiling you're performing ALOT of write cycles.
There are ways to optimize this. But if you're looking at getting an external harddrive it might be an easier option.
The Flash said:
Introduction
Click to expand...
Click to collapse
Wonderful guide The Flash. Followed everything to the T. Keeps failing with the out of memory issues as documented in your FAQ. I tried the FAQ suggestion and it still fails with same issue. Any suggestion?
GC overhead limit exceeded.
Try increasing heap size with java option '-Xmx<size>'.
Warning: This may have produced partial or corrupted output.
ninja: build stopped: subcommand failed.
build/core/ninja.mk:148: recipe for target 'ninja_wrapper' failed
make: *** [ninja_wrapper] Error 1
DreamFX said:
Wonderful guide The Flash. Followed everything to the T. Keeps failing with the out of memory issues as documented in your FAQ. I tried the FAQ suggestion and it still fails with same issue. Any suggestion?
GC overhead limit exceeded.
Try increasing heap size with java option '-Xmx<size>'.
Warning: This may have produced partial or corrupted output.
ninja: build stopped: subcommand failed.
build/core/ninja.mk:148: recipe for target 'ninja_wrapper' failed
make: *** [ninja_wrapper] Error 1
Click to expand...
Click to collapse
How much RAM do you have?
The Flash said:
How much RAM do you have?
Click to expand...
Click to collapse
It's an older machine I use for just building and running Linux. Only 4gig. So left kill jack at 4g.
Sent from my Nexus 6 using XDA-Developers mobile app
DreamFX said:
It's an older machine I use for just building and running Linux. Only 4gig. So left kill jack at 4g.
Sent from my Nexus 6 using XDA-Developers mobile app
Click to expand...
Click to collapse
Hmmm to be honest, you may not be able to compile Nougat. I have heard quite a few people having issues with 8GB, not sure anyone has done it with less than that.
The Flash said:
Hmmm to be honest, you may not be able to compile Nougat. I have heard quite a few people having issues with 8GB, not sure anyone has done it with less than that.
Click to expand...
Click to collapse
Going to throw some more ram in her and give her another go. Thanks for the quick responses [emoji3]
Sent from my Nexus 6 using XDA-Developers mobile app
The Flash said:
Hmmm to be honest, you may not be able to compile Nougat. I have heard quite a few people having issues with 8GB, not sure anyone has done it with less than that.
Click to expand...
Click to collapse
Will a large swap help with this? Or is it purely a hardware restriction?
Sent from my NuttyNexus using Tapatalk
DreamFX said:
Going to throw some more ram in her and give her another go. Thanks for the quick responses [emoji3]
Sent from my Nexus 6 using XDA-Developers mobile app
Click to expand...
Click to collapse
Let me know how it goes!
slothdabski said:
Will a large swap help with this? Or is it purely a hardware restriction?
Sent from my NuttyNexus using Tapatalk
Click to expand...
Click to collapse
I think someone said that swap doesn't help all that much but it is worth a shot.

[GUIDE]How To Build A ROM Using A Phone

I am writing this tutorial together in an attempt to help beginners which are trying to build a ROM from source for the first time.I faced many problems when I started building roms, so I thought it will be better to help someone who is trying the same thing.I have tried to make this guide easy to understand.Please feel free to PM if you have any doubts!!
And if you built a rom by following this guide then please press the thanks button, it will motivate me.
For Whom This Guide Is For​
1. Who do not have a PC which meets required requiements for building a rom
2. Who cannot download the sources which might be upto 10GB
3. Who is building a rom for the first time
Prerequisites
1. Android Phone
2. A decent internet connection
3. A debit/credit card
4. Brain
Contents
1. Making a Google Cloud Account
2. Setting up the VM (Virtual Machine) on your phone
3. Setting up the build environment
4. Initializing and syncing the repo
5. Cloning the device,kernel and vendor tree
6. Building the rom
7. Uploading the ROM in Google Drive
1. Making A Google Cloud Account​
NOTE:You will need a credit/debit card for making an account and it is free to use Google Cloud for one year only.
STEP 1:Open Google Cloud from here.
STEP 2:Click on Free Trial
{
"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"
}
STEP 3:Login with your Google account username and password.
2. Setting up the VM (Virtual Machine) on your phone
STEP 1:Download Juice SSH app from here.
STEP 2:Open Juice SSH app and click on "Connections".
STEP 3:Navigate to "Identities" and create a new identity by pressing the "+" button.
STEP 4:Input the "Nickname","Username" (You can enter your name also in both places) and then click on "Private Key"(Set (Optional) button). Navigate to "Generate" and press OK and click on the tick icon.
STEP 5:Now long press the identity you just created and click on "Export Public Key" and click on ES Note Editor or Keep (You need any one of them) and replace the "JuiceSSH" written at the end with your username you entered in the identity and now copy the whole text.
STEP 6:Open Google Cloud and navigate to Computer Engine->Metadata->SSH Keys. Click on edit and then add item.Paste the text you just copied and save it.
STEP 7:Navigate to Computer Engine->VM Instances. Click on "Create Instance".Enter the name(Any name).Select Machine Type as "4vCPU". Select Boot Disk as "Ubuntu 16.04 LTS" and set the size to 1000GB.Tick both "Allow HTTP traffic" and
"Allow HTTPS traffic" and click on create.
STEP 8:Now it will take a minute.After it is created copy the External IP.
STEP 9:Now open Juice SSH app and navigate to "Connections" and create a connection by clicking on the "+" icon.Input the nickcname you entered while creating the identity.Paste the External IP in the "Address" column and click on the tick icon.
STEP 10:Now click on the connection you just created. This will open the terminal on which you need to work.
3. Setting up the build environment
NOTE:You just need to copy and paste the below codes one by one.
1. sudo apt update
2. sudo apt upgrade
3. sudo apt-get install git-core
4. git clone https://github.com/akhilnarang/scripts
5. cd scripts
6. bash setup/ubuntu1604linuxmint18.sh
7. mkdir -p ~/bin
8. mkdir -p ~/android/lineage (Replace lineage with your rom name or you can also use lineage for any rom for easy to understand))
9. curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
10. chmod a+x ~/bin/repo
11. cd ~/android/lineage
4. Initializing and syncing the repo
1. repo init -u https://github.com/LineageOS/android.git -b cm-14.1
NOTE:Here I am compiling lineage os 14.1 therefore I am using it's repo initializing command.
You can find repo initialization command for your rom by the following method:
(i) Google search "rom_name github" (Replace rom_name with your rom name)
(ii) Open the rom github in dextop mode.(Use Google Chrome)
(iii)Click on the "manifest" or "android_manifest"
(iv) Select the branch which you want to build and copy the repo initialization command given at bottom.
Some repo initialization commands:
(i). repo init -u https://github.com/ResurrectionRemix/platform_manifest.git -b nougat
(ii). repo init -u https://github.com/AICP/platform_manifest.git -b n7.1
(iii). repo init -u git://github.com/CandyRoms/candy.git -b c7.1.2
(iv). repo init -u https://github.com/BlissRoms/platform_manifest.git -b n7.1
2. repo sync -j8
Go get a coffee till the source is syncinc. It will take time depending on your internet speed.
5. Cloning the device,kernel and vendor tree
1. git clone device_tree_link_here -b branch_name_here device/manufacturer_name_here/device_name_here
Eg: git clone https://github.com/LineageOS/android_device_xiaomi_mido.git -b cm-14.1 device/xiaomi/mido
2. git clone kernel_tree_link_here -b branch_name_here kernel/manufacturer_name_here/chipset_name_here
Eg: git clone https://github.com/LineageOS/android_kernel_xiaomi_msm8953.git -b cm-14.1 kernel/xiaomi/msm8953
3. git clone vendor_tree_link_here vendor/manufacturer_name_here
Eg: git clone https://github.com/TheMuppets/proprietary_vendor_xiaomi.git vendor/xiaomi
NOTE:1.To find device tree link follow the following steps:
(i)Google search "Device_name device tree github"
(ii)Select the branch and copy the device tree link.
2.To find the kernel tree link follow the below steps:
(i)Google search "lineage os github".
(ii)Input your chipset name in the search box and select the repository for your device.
(iii)Copy the link.
3.To find the vendor tree link follow the below steps:
(i)Google search "The Muppets Github".
(ii)Find the repository for your device and copy the link.
If you can't find any tree with the above methods, then simply google search that tree for your device!!!!
6. Building the rom
1. export USE_CCACHE=1
2. prebuilts/misc/linux-x86/ccache/ccache -M 50G
3. export CCACHE_COMPRESS=1
4. . build/envsetup.sh
5. brunch device_name_here
or
5. make bacon -j8
Now it will take approx 7-8 hrs or more depending upon your internet speed.Go get a sleep till then.
7. Uploading the ROM in Google Drive
1. cd ~
2. wget https://docs.google.com/uc?id=0B3X9GlR6EmbnWksyTEtCM0VfaFE&export=download
3. mv uc\?id\=0B3X9GlR6EmbnWksyTEtCM0VfaFE gdrive
4. chmod +x gdrive
5. sudo install gdrive /usr/local/bin/gdrive
6. gdrive list
7. cd out/target/product
8. ls
Check your ROM name.
9. gdrive upload same_rom_name_here
Now it will show a link. Click on it and copy the code and paste it in the terminal.
Now your rom will start uploading in your Google Drive.
Congratulations You Built Your First ROM!!​
Don't forget to press the thanks button​
Donate Me​If I helped you a little bit then buy me coffee
Here
Or
​
Credits​SaurabhCR7(Me:fingers-crossed
@nitin.chobhe (For his images and guide for google cloud)
Akhil Narang(For his Scripts)
Google
XDA​
Give credit in OP to @nitin.chobhe for the first part of your guide.
P.S: Thanks for the efforts in making this guide.
@Saurabhcr7 by any chance did you refer this thread (and screenshots there in) of mine?
Thanks @antariksh :good:
Nitin
I want to try
nitin.chobhe said:
@Saurabhcr7 by any chance did you refer this thread (and screenshots there in) of mine?
Thanks @antariksh :good:
Nitin
Click to expand...
Click to collapse
Why i get this? I dont set any password
Diki Saputra said:
Why i get this? I dont set any password
Click to expand...
Click to collapse
You are performing this step wrongly.
STEP 5:Now long press the identity you just created and click on "Export Public Key" and click on ES Note Editor or Keep (You need any one of them) and replace the "JuiceSSH" written at the end with your username you entered in the identity and now copy the whole text.
Saurabhcr7 said:
You are performing this step wrongly.
STEP 5:Now long press the identity you just created and click on "Export Public Key" and click on ES Note Editor or Keep (You need any one of them) and replace the "JuiceSSH" written at the end with your username you entered in the identity and now copy the whole text.
Click to expand...
Click to collapse
Ok,i try make du 8.1.0,i cant see source at du github
Diki Saputra said:
Ok,i try make du 8.1.0,i cant see source at du github
Click to expand...
Click to collapse
https://github.com/DirtyUnicorns/android_manifest
Saurabhcr7 said:
https://github.com/DirtyUnicorns/android_manifest
Click to expand...
Click to collapse
I want to try git clone https://github.com/LineageOS/android_device_xiaomi_kenzo.git -b cm-14.1 device/xiaomi/kenzo
But have problem
@Saurabhcr7 bro,when compiling the rom does it consumes data?
Huge amount or small
dean [email protected]# said:
@Saurabhcr7 bro,when compiling the rom does it consumes data?
Huge amount or small
Click to expand...
Click to collapse
It requires a small amount of data
Diki Saputra said:
I want to try git clone https://github.com/LineageOS/android_device_xiaomi_kenzo.git -b cm-14.1 device/xiaomi/kenzo
But have problem
Click to expand...
Click to collapse
You missed writing cm-14.1 after -b
Saurabhcr7 said:
It requires a small amount of data
Click to expand...
Click to collapse
Thanks bro.
Any help For this, I tried changing that "bacon" with "santoni" (device name which i am compiling'buildbot' for)
Saurabhcr7 said:
You missed writing cm-14.1 after -b
Click to expand...
Click to collapse
Always get this error.
Hey bro, in other forums it is given that it consumes a lot of data to download repo files(or something like that). By doing this in cloud won't it take data to do that??? If it doesn't make sense then sorry... I am a real noob
alnasnasu said:
Hey bro, in other forums it is given that it consumes a lot of data to download repo files(or something like that). By doing this in cloud won't it take data to do that??? If it doesn't make sense then sorry... I am a real noob
Click to expand...
Click to collapse
Actually it downloads repo and all data virtually that's why it doesn't take much data
So downloading directly to cloud means that google is downloading the data to cloud by our command and without our intervention
while downloading repo, if i turn off the internet connection it will still dowload in the cloud, Right???
What if I've to edit my device tree? How can i edit it if files are virtual
What if I've to edit my device tree? How can i edit it if files are virtual??

Categories

Resources