Guide: How To Build Your Own Stock AOSP For Your Nexus 7 (2013) KVT49L - Nexus 7 (2013) General

PHP:
Guide: How To Build AOSP From Source With Linux Mint 16 - Nexus 7 (2013) KVT49L
Important Note: Do NOT use Linux Mint 16 KDE to do this guide, it will seriously mess up your programs menu when you remove the old Java. This guide has been tested and is working on Linux Mint 16 Cinnamon and Linux Mint 16 MATE
Got the KVT49L repos working and guide is updated to reflect this. This build includes several bug fixes from the KOT49H build but it is NOT 4.4.3, just an updated version of 4.4.2.
I started this guide as I could not find a step by step detailed guide to build a stock AOSP from source with Linux Mint 16.
All the steps should work in Ubuntu but I haven't tried so not 100% sure of that.
All this assumes your tablet is already unlocked.
Here goes:
Important note: Anything that is bolded text other then section titles are command line entries that are done in Terminal in Linux Mint. I thought it would be simpler to do it this way then say 'in Terminal' for every entry.
First we need to remove Icedtea Java or OpenJDK.
In Terminal: sudo apt-get purge openjdk-\* icedtea-\* icedtea6-\*
Then in Terminal: sudo add-apt-repository ppa:webupd8team/java
Next: sudo apt-get update && sudo apt-get install oracle-java6-installer
Be sure to accept the licence agreement to install java when it prompts you.
Next: 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
Follow this with: sudo apt-get install -f
This should fix any dependency errors.
Now: sudo ln -s /usr/lib/i386-linux-gnu/mesa/libGL.so.1 /usr/lib/i386-linux-gnu/libGL.so
Next download the SDK Tools For Linux x64 from this link. https://developer.android.com/sdk/index.html
Then: cd ~/Downloads
And: tar -xvf android-sdk_r22.6.2-linux.tgz
or tab the latest 'android-sdk_xxx.tgz file it they update it and it is a newer version then the one I downloaded to do this.
You can rename the android.sdk_xxx.tgz folder you extracted to SDK.
Then: cd ~/Downloads/SDK/tools
Next: ./android sdk
It will show you the tools that can be installed, just install the highest version API of 'Platform Tools' and 'Tools' for the latest android version '4.4.x' it shows.
Make sure you install the repo tool, in Terminal:
With: mkdir ~/bin
Then: curl https://dl-ssl.google.com/dl/googlesource/git-repo/repo > ~/bin/repo
And: curl http://commondatastorage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
Now: sudo chmod a+x ~/bin/repo
Now sudo nano ~/.bashrc
Add this to the bottom of the text: export PATH=~/bin:$PATH
Then hit Ctrl-O and enter, it should say it saved the file followed by Ctrl-X to exit.
Then restart bash: source ~/.bashrc
Now lets Initialize the Repository for GIT configuration
First : git config --global user.name {Your Name}
Then: git config --global user.email {[email protected]}
If you have not registered with the GitHub website just doing these two steps works fine.
If you have registered with the GitHub website create a file called .netrc in your home directory, add your GitHub password to it with no spaces on the first line and change the permissions to '600' or you will have to continually authenticate when building the source.
In Terminal:nano ~/.netrc
Then add just your GitHub password (like I said you only need to do this if you have registered with GitHub).
Then 'Ctrl-O' and enter and it'll say it saved it, then 'Ctrl-X' to exit nano.
And then: chmod 0600 ~/.netrc
Now: mkdir ~/AOSP
Then: cd ~/AOSP
Now you get the source code etc: repo init -u https://android.googlesource.com/platform/manifest -b android-4.4.2_r2
Then do in Terminal : repo sync -j12
Use repo sync -j12 for a quad core CPU or Intel I5 or if you have say an quad core I7 with 8 threads you can use repo sync -j24 to speed things up etc.
I have a I7 3930k with 12 threads so I used repo sync -j36. This gives you three threads per logical CPU and speeds things along quite well.
It may take several hours for the sync to finish.
After the sync finishes go to https://developers.google.com/android/nexus/drivers#razorkot49h and download the drivers (binaries) for the Nexus 7 (Wi-fi). You do need to use the KOT49H binaries and they work fine with the KVT49L build.
In Terminal: cp ~/Downloads/asus-flo-kot49h-a9532596.tgz ~/AOSP
Then: cp ~/Downloads/broadcom-flo-kot49h-c33beb3d.tgz ~/AOSP
And: cp ~/Downloads/qcom-flo-kot49h-f92d75b1.tgz ~/AOSP
In Terminal: tar -xvf asus-flo-kot49h-a9532596.tgz
And: tar -xvf broadcom-flo-kot49h-c33beb3d.tgz
Then: tar -xvf qcom-flo-kot49h-f92d75b1.tgz
If you have closed the Terminal after the sync remember to do: cd ~/AOSP
when you open Terminal again before doing the tar commands.
They should be the file names of the binaries for KOT49H that you are extracting but if for any reason the file names are different use the Tab key and tab the correct names in after 'tar -xvf'.
If the names ARE different I'd really check to make sure you downloaded the correct flo binaries.
Then: ./extract-asus-flo.sh
Now also in Terminal: ./extract-broadcom-flo.sh
And: ./extract-qcom-flo.sh
Hint: It will show you a really long licence agreement for each binary that you scroll by hitting the Enter key that takes forever to scroll one line at a time, it has 8 sections and several subsections. Hold the Enter key until you just get past Part 8, section D of the licence and stop there. Now hit enter a few more time one key stroke at a time until you finish Part 8 section E and see the 'Type 'I ACCEPT' to agree to the licence.' and type I ACCEPT If you just scroll by holding the Enter key all the way to the bottom of the licence you'll get an error you never accepted the licence. Then close Terminal.
Building the Sources
Now open Terminal: cd ~/AOSP
Then: . ./build/envsetup.sh
Now to select the type of device we give the following command: lunch
Choose: 11. aosp_flo-userdebug
by entering '11' or whatever number aosp_flo is after your enter the 'lunch' command (it was number 11 on mine).
Now: make -j12 for a quad core cpu or I5 or make -j24 for an I7 etc.
With your tablet connected to your USB cable and the PC: adb root
Then: adb reboot bootloader
And: cd out/target/product/flo
Lastly: fastboot -w flashall
If you get an error on the 'adb' and 'fastboot' commands do these first:
sudo apt-get install android-tools-adb
and: sudo apt-get install android-tools-fastboot
If you get an error when you fastboot -w flashall to do with a '-p' flag needed or 'android-info.txt' is missing it means you forgot to to the 'lunch' command before building the source. Go back to the 'Building The Sources' section.
If you already have a custom recovery installed like TWRP and would rather build a zip file to install with the recovery rather then flash it in adb instead of make -j12 do: make -j12 otapackage
In the /home/"yourusername"/AOSP/out/target/product/flo you have an aosp_flo-ota-eng.___.zip file to flash in your custom recovery.
You will need to wipe/reset data your in recovery before flashing it and re-install all your apps etc.
Installing Custom Recovery, Rooting and Google Apps
If you want to install a custom recovery download TWRP http://techerrata.com/browse/twrp2/flo
Rename the file in Downloads to recovery.img
Then in Terminal with your tablet connected by USB to your PC: adb root
And: adb reboot bootloader
Then: cd ~/Downloads
And: fastboot flash recovery recovery.img
Use the volume buttons on your phone to scroll onto "Restart Bootloader" and hit the powerbutton to select it. After the bootloader reloads, use the volume buttons to scroll to "Recovery Mode" and hit power button again to select it. You should then be in your custom recovery.
If for any reason you get a red android and no recovery just boot into fastboot mode again and reinstall the recovery.img.
And finally, to root your tablet download SuperSu http://download.chainfire.eu/supersu and install the supersu.zip in recovery mode.
Download PA GAPPS from here http://forum.xda-developers.com/showthread.php?t=2397942 if you want the zip to install Google Apps in recovery.
You now have your own rooted vanilla AOSP you compiled yourself, congrats!
P.S. Very likely a good idea wipe/reset data in recovery and start with a clean install, you'll need to install all your programs and stuff anyways I'm sure.
P.P.S.I did download and install the XPOSED Framework apk http://forum.xda-developers.com/showthread.php?t=1574401 after I put AOSP on my tablet so I could install Advanced Power Menu and some other add-ons like Boot Manager and Greenify. As well I installed a custom kernel with Faux Sound and Faux Kernel enhancements.

I think for the download repo tool section you only need the second (commondatastorage) one. The first one no longer works.
Other than that, it looks pretty good.

Awesome thanks!!!
Sent from my Nexus 7 using Tapatalk

meekrawb said:
I think for the download repo tool section you only need the second (commondatastorage) one. The first one no longer works.
Other than that, it looks pretty good.
Click to expand...
Click to collapse
Yeah, you're right, I checked into it.
Thanks!!
I updated the guide and removed that.

meekrawb said:
I think for the download repo tool section you only need the second (commondatastorage) one. The first one no longer works.
Other than that, it looks pretty good.
Click to expand...
Click to collapse
Edit: I see the problem with the second curl command, when I save the post it shortens the url in the command with dots and when you copy and paste it it is incorrect and does not download, I'm trying to figure out how to fix it, every time I save the post no matter if I take the url code out or not it shortens it.
Second edit: I figured out a work-around and added it to the guide. It's half baked how I had to do it but at least it's working now.

hey all, sorry if this is off topic, but ive been looking for help everywhere and im about ready to give up, im trying to build evervolv for flo, i've got the source downloaded and im ready to build, the only thing im having trouble with is getting all the propratairy blobs and device spacific files from the n7. is there a way i can just sync up with cyanogenmods device repo or over right the repo that is build into evervolvs source? thanks for any help.

Andromendous said:
hey all, sorry if this is off topic, but ive been looking for help everywhere and im about ready to give up, im trying to build evervolv for flo, i've got the source downloaded and im ready to build, the only thing im having trouble with is getting all the propratairy blobs and device spacific files from the n7. is there a way i can just sync up with cyanogenmods device repo or over right the repo that is build into evervolvs source? thanks for any help.
Click to expand...
Click to collapse
download the binaries and extract them as was shown in the OP.
Then do
make clobber
. build/envsetup.sh
lunch
make (whatever option you decide, otapackage etc)
Make clobber is important because it ensures you start clean and that the binaries will be properly implemented in your rom.

oldsoldier2003 said:
download the binaries and extract them as was shown in the OP.
Then do
make clobber
. build/envsetup.sh
lunch
make (whatever option you decide, otapackage etc)
Make clobber is important because it ensures you start clean and that the binaries will be properly implemented in your rom.
Click to expand...
Click to collapse
ok, i did all that and still get the same error like below. dunno if i mentioned it, but i am trying to build evervolv
EDIT: the option (5) was "aosp_flo-userdebug

KedarWolf said:
Edit: I see the problem with the second curl command, when I save the post it shortens the url in the command with dots and when you copy and paste it it is incorrect and does not download, I'm trying to figure out how to fix it, every time I save the post no matter if I take the url code out or not it shortens it.
Second edit: I figured out a work-around and added it to the guide. It's half baked how I had to do it but at least it's working now.
Click to expand...
Click to collapse
I think you had the "commondatastorage" one right before. It is the "curl https://dl-ssl.google.com/dl/googlesource/git-repo/repo > ~/bin/repo" that doesn't work anymore.
So instead of those two steps, it should be just this one:
Download the Repo tool and ensure that it is executable:
$ curl http://commondatastorage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
$ chmod a+x ~/bin/repo
I hope that makes more sense.

Great post! Thanks for this!

meekrawb said:
I think you had the "commondatastorage" one right before. It is the "curl https://dl-ssl.google.com/dl/googlesource/git-repo/repo > ~/bin/repo" that doesn't work anymore.
So instead of those two steps, it should be just this one:
Download the Repo tool and ensure that it is executable:
$ curl http://commondatastorage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
$ chmod a+x ~/bin/repo
I hope that makes more sense.
Click to expand...
Click to collapse
I fixed the second curl command so it works. Not 100% sure you need the first curl command but it does work in Linux Mint 16 and doesn't mess anything up so I left it in.

Related

[GUIDE] Setting up a build environment for CDMA Hero

this is a guide for setting up a build environment on ubuntu 10.10. there has been similar guides but i did not have any luck with them. i'll just post step by step what i did to get a good build environment set up and compile jaybob's source.
install ubuntu 10.10
install ubuntu, install all the latest updates, DO NOT INSTALL UBUNTU 11.04 I MADE THIS FOR 10.10!!!
restart ubuntu
go to system, administration, update manager
go to settings
go to other software
check both canonical partners and click close
download python
sudo add-apt-repository ppa:fkrull/deadsnakes
sudo apt-get update
sudo apt-get install python2.5
download jdk 6
sudo add-apt-repository "deb http://archive.canonical.com/ maverick partner"
sudo add-apt-repository "deb http://archive.canonical.com/ubuntu maverick partner"
sudo apt-get update
sudo apt-get install sun-java6-jdk
download sdk
download link: http://dl.google.com/android/android-sdk_r15-linux.tgz
take android-sdk-linux folder and move it inside your home folder
open terminal
cd android-sdk-linux
cd tools
./android
the sdk manager will open. download the platform tools and any sdk versions you wish to have
download git
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install git-core
install required build packages
sudo apt-get install 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
configure your usb
gksudo gedit /etc/udev/rules.d/51-android.rules
in the blank file that opens, paste this next line in the file:
SUBSYSTEM=="usb", SYSFS{idVendor}=="0bb4", MODE="0666"
save and close the file.
then run in terminal:
sudo chmod a+r /etc/udev/rules.d/51-android.rules
cd
gedit .bashrc
in the file that opens, add these next lines to the top of the file:
#AndroidDev PATH
export PATH=${PATH}:${HOME}/android-sdk-linux/platform-tools/
save and close the file, then in terminal, type:
source ~/.bashrc
then in terminal type:
which adb
which adb will show you your adb path. if it says "/home/YOURLINUXNAME/android-sdk-linux/platform-tools//adb" your path is good.
connect your phone, do not mount usb, make sure debugging is checked, then in terminal type:
adb devices
my device showed up as "0123456789ABCDEF device", as long as it says device at the end its good.
create directories
mkdir -p ~/bin
mkdir -p ~/android/system
download repo and make executable
curl https://dl-ssl.google.com/dl/googlesource/git-repo/repo > ~/bin/repo
chmod a+x ~/bin/repo
initialize the repository
cd ~/android/system/
repo init -u git://github.com/TeamHeroC/manifest_aosp_heroc.git
(the repo above is jaybob's repo, there are a couple different repos you can choose from, you can download the AOSP repo, or cyanogenmod's repo aswell from the wiki)
repo sync
copy proprietary files
(must have jaybob's or a cm based rom already flashed to phone)
cd ~/android/system/device/htc/heroc/
./extract-files.sh
build the source
. build/envsetup.sh
lunch aosp_heroc-eng
mka bacon
if all goes well, your rom zip will be in ~/android/system/out/target/product/heroc/
*** when youre initializing the repository, if youre are compiling cyanogenmod's, follow the instructions in the wiki when you get to that section. if you are compiling aosp, follow the instructions on the aosp website. everything before that step should give you a good build environment to decide which source you want to build.***
Thank you:
dastin1015 - i used some of his guide and he is a great developer.
jaybob413 - for being a great developer and for his repo.
cyanogenmod - for the source and some of their guide.
sykopompos - i used some of his guide.
mTeryk - for helping me figure out my adb issue.
youdug - for finding some of the sources and helping me figure everything out.
*reserved*
*second reserved*
glenny buster said:
copy proprietary files
(must have jaybob's or a cm based rom already flashed to phone)
cd ~/android/system/device/htc/heroc/
./extract-files.sh
Click to expand...
Click to collapse
This step should no longer be needed when building from the TeamHeroC repos. I added the proprietary files some time ago to set up one-stop shopping and eliminate the need to do anything other than init, sync, lunch, and build (yes, I am just that lazy). The vendor device makefiles and proprietary files should already be pulled from the vendor_htc_heroc repo into vendor/htc/heroc. If something got trashed, the proprietary files can also be copied from the device/htc/heroc/prebuilt/proprietary folder, and the vendor device makefiles can be regenerated by running setup-makefiles.sh in the device/htc/heroc folder.
It is true that if building from CM7 or other repos, you will probably need to populate the proprietary files into the vendor/htc/heroc/... directories by running extract-files.sh or pulling them from koush's proprietary_vendor_htc repo (where vendor files for all CM7 supported htc devices are stored). You can clone his repo by running (in some other folder/location):
Code:
git clone git://github.com/koush/proprietary_vendor_htc.git
Then copying the heroc folder to vendor/htc/heroc.
This can come in handy if your mobile doesn't have a TeamHeroC or CM7 based ROM loaded, you can't connect to the machine you are building on, or your device is experiencing technical difficulties.
After an initial successful build you should be able to generate an update by another repo sync, lunch, mka bacon.
I would generally recommend doing a make clobber to wipe out the previous build artifacts and ensure a clean build when you generate the update. This does mean that you will recompile everything, so if you are working with a machine that takes a long time to build you may only want to do this if you are having problems or seeing unexpected results. My current build system can do a complete build from scratch in about 15 minutes, so I am now in the habit of doing this every time I build. The machine I originally used to build took over 90 minutes, so I was less likely to invoke clobbering time unless I had issues or was ready to post a release.
awesome guide!!! you the man!

[TUTORIAL ] Beginning development-the easy way

Ok so this is a guide that me and my friend made for compiling ROMs for our LG-P350 Now, this is pretty much universal and can be used for general development
This is the stuff you will need :
Ubuntu-can be found on the Ubuntu website http://www.ubuntu.com/start-download?distro=desktop&bits=64&release=lts (this is a direct link to the Ubuntu 12.04 64-bit version)
Python (included)
GNU Make
Java Development Kit (JDK) 6
Git
Before you can do anything you need to install Ubuntu. You can go with newer versions but i still think that 10.10 is best and this guide is adapted to it. You can install it like dual boot or use Wubi (Windows Ubuntu Installer). However if you choose Wubi there is a good chance that you won't have enough storage, so that's not recommended.Those who want to dual-boot check out this post http://forum.xda-developers.com/showpost.php?p=34669858&postcount=26
NOTE: You can do this in a virtual machine (for example VM Ware and Virtual box) but it will be a lot slower unless you have a VERY strong CPU and a LOT of RAM.
Generally Python is not needed since it's already in Ubuntu. However if you want to install it separately here's how:
First of all open the terminal. Now copy/paste these codes (one by one) and execute them:
Code:
sudo apt-get install build-essential gcc
cd Downloads
wget http://www.python.org/ftp/python/2.5.6/Python-2.5.6.tgz
tar -xvzf Python-2.5.6.tgz
cd Python-2.5.6
./configure --prefix=/usr/local/python2.5
make
make test
sudo make install ([B]NOTE[/B]: [I]You will be asked for your password, enter it and press enter[/I])
sudo ln -s /usr/local/python2.5/bin/python /usr/bin/python2.5
Now you need Sun JDK 6. Same procedure as with Python:
Code:
sudo add-apt-repository "deb http://archive.canonical.com/ lucid partner"
sudo apt-get update
sudo apt-get install sun-java6-jdk
For those who get package error try these:
Code:
sudo add-apt-repository ppa:sun-java-community-team/sun-java6
sudo apt-get update
sudo apt-get install sun-java6-jdk
sudo update-java-alternatives -s java6-jdk
Now that JDK is installed it's time for GNU Make:
First of all download GNU Make from link given. Download version 3.82
Now extract the downloaded file to your Home directory.
Go to Home directory and change the name of GNU Make To make
Now open the Terminal and type the following codes
Link: http://ftp.gnu.org/gnu/make/
Code:
cd make
./configure
sudo make install
Now make is installed.
Next, we are going to install the dependencies:
FOR UBUNTU 10.10
Codes to type in terminal :
Code:
sudo apt-get install git-core gnupg flex bison gperf build-essential \ zip curl zlib1g-dev libc6-dev lib32ncurses5-dev ia32-libs \ x11proto-core-dev libx11-dev lib32readline5-dev lib32z-dev \ libgl1-mesa-dev g++-multilib mingw32 tofrodos python-markdown \ libxml2-utils xsltproc
export USE_CCACHE=1
If that method didn't work then try this:
You use the same commands BUT the first one is:
sudo apt-get install git-core gnupg flex bison gperf build-essential
Now it should download some stuff. When its done you need to do the same for the rest in the right order.
NOTE: Since I don't remember the right order i will just put the commands how they should be written if you get error read what's missing and put that in first.
Here are the rest of the lines:
Code:
sudo apt-get install zip curl
sudo apt-get install zlib1g-dev
sudo apt-get install libc6-dev
sudo apt-get install lib32ncurses5-dev
sudo apt-get install ia32-libs
sudo apt-get install x11proto-core-dev
sudo apt-get install libx11-dev
sudo apt-get install lib32readline5-dev
sudo apt-get install lib32z-dev
sudo apt-get install libgl1-mesa-dev g++-multilib
sudo apt-get install mingw32
sudo apt-get install tofrodos python-markdown
sudo apt-get install libxml2-utils
sudo apt-get install xsltproc
FOR UBUNTU 12.04
Code:
sudo 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-glx:i386 \
libgl1-mesa-dev g++-multilib mingw32 openjdk-6-jdk tofrodos \
python-markdown libxml2-utils xsltproc zlib1g-dev:i386
sudo ln -s /usr/lib/i386-linux-gnu/mesa/libGL.so.1 /usr/lib/i386-linux-gnu/libGL.so
Now for the Android SDK, ADB and ADB path:
1. SDK (Software-Development-Kit) :
Go to this link and download the Android SDK for Linux:
http://developer.android.com/sdk/index.html
After downloading it, extract it to the Home folder. You can probably extract where you want and change all the steps below to to fit your set up, but I like putting it in Home folder.
When you have extracted it in the Home folder change the name of the folder of android-sdk-linux to sdk.
Then open the Terminal and run these codes:
Code:
cd ~/sdk/tools/
./android sdk
When you run this, a window will pop up. For this you only need "Android SDK Tools" and "Android SDK Platform-tools". Just check these two and install them.
2. ADB (Android-Debug-Bridge):
Run this command to see if your ADB works. You have to have your android device connected in debugging mode.
Run these codes in the Terminal :
Code:
cd ~/sdk/platform-tools ./adb devices
When you entered the codes above, you should see something similar to this:
List of devices attached 0123456789ABCDEF device
NOTE: If you see output like given bellow we need to give the device permissions. Don't worry I had this too when I set my computer up for the first time.
List of devices attached ???????????? no permissions
Here is how we fix it:
Open the Terminal and type this:
Code:
gksudo gedit /etc/udev/rules.d/51-android.rules
After you've entered it, a window will pop up that will be blank. Now add the following commands and save it.
Code:
SUBSYSTEM=="usb", ATTRS{idVendor}=="1004", MODE="0666"
Now save this File And follow the given codes
After you've entered those codes type these codes in too.
Code:
sudo service udev restart
sudo adb kill-server
sudo adb start-server
After you've entered those codes, restart Ubuntu.
Now to see if the problem is solved type these codes in:
Code:
cd ~/sdk/platform-tools ./adb devices
If everything is ok a output similar to this will be shown:
List of devices attached 0123456789ABCDEF device
Now to add the ADB path to system, so you don't have to cd to the SDK folder every time you want to use ADB:
So, first open up .bashrc with these codes:
Code:
sudo gedit ~/.bashrc
A window will pop up and there will be some text there. Scroll down to the bottom and add these lines:
Code:
export PATH=${PATH}:~/sdk/tools
export PATH=${PATH}:~/sdk/platform-tools
After you've done that, save it and reboot Ubuntu.
If everything is ok, you will get some output when you type the following codes in the terminal.
Code:
./adb devices
OR
Code:
adb shell
If you see:
Code:
adb not found[CODE]
Then it means you've done something wrong and ADB is not configured.
Next is GIT:
Open the browser and download git from given link
[URL]http://git-core.googlecode.com/files/git-1.7.9.6.tar.gz[/URL]
Extract GIT-1.7.9.6.tar.gz to your home directory
Rename the folder you extracted to from GIT-1.7.9.6.tar.gz to git
After you've done that, enter the following codes in the Terminal
[CODE]sudo aptitude build-dep git-core
sudo apt-get install zlib1g-dev
cd git
./configure
make
sudo make install
NOTE: If it doesn't work then install from this link:
http://kibyegon.wordpress.com/2010/0...u-lucid-10-04/
If the commands from above are not working then try this:
Code:
sudo apt-get install git-core
sudo apt-get install git
git
If it worked it should show this:
Code:
usage: git [--version] [--exec-path[=GIT_EXEC_PATH]] [--html-path]
[-p|--paginate|--no-pager] [--no-replace-objects]
[--bare] [--git-dir=GIT_DIR] [--work-tree=GIT_WORK_TREE]
[--help] COMMAND [ARGS]
The most commonly used git commands are:
add Add file contents to the index
bisect Find by binary search the change that introduced a bug
branch List, create, or delete branches
checkout Checkout a branch or paths to the working tree
clone Clone a repository into a new directory
commit Record changes to the repository
diff Show changes between commits, commit and working tree, etc
fetch Download objects and refs from another repository
grep Print lines matching a pattern
init Create an empty git repository or reinitialize an existing one
log Show commit logs
merge Join two or more development histories together
mv Move or rename a file, a directory, or a symlink
pull Fetch from and merge with another repository or a local branch
push Update remote refs along with associated objects
rebase Forward-port local commits to the updated upstream head
reset Reset current HEAD to the specified state
rm Remove files from the working tree and from the index
show Show various types of objects
status Show the working tree status
tag Create, list, delete or verify a tag object signed with GPG
See 'git help COMMAND' for more information on a specific command.
Now we will download the Repo and get the source code:
Codes to type in the Terminal :
Code:
mkdir ~/bin
PATH=~/bin:$PATH
sudo apt-get install curl
curl https://dl-ssl.google.com/dl/googlesource/git-repo/repo > ~/bin/repo
chmod a+x ~/bin/repo
mkdir source
cd source
Ok so up to this part its mostly universal. However after this you need to sync up sources for your device. This will probably take a long time depending on your internet speed since the source is very big (also it will take up a lot of drive space: 14-30GB). After that you should build.
How to build
First you will need to get proprietary drivers from your device.
Connect your device via USB and enter the following commands (from the root of your source repository):
Code:
cd device/xxx/xxx where x is the path to your device
./extract-files.sh
cd ../../..
NOTE: Some developers can include these files in the source itself or can make them available for download from their Github page. Check that out with your developer for more info.
And start the build:
Code:
. build/envsetup.sh xxx
NOTE:Here x also varies since its unique for every device model
Now Android is building. You may need to wait a long time (depending on your hardware-mainly CPU and RAM for example I have a quad core 2.92Ghz CPU and 6GB of HyperX DDR3 ram and it took me about 10min for CM7 and about 20-30 min for CM9).Once it's done you should get this message:
Code:
Package complete:xxx.zip
That is your flashable .zip file you install from recovery.
Credits: Many thanks go to Keyur Maru who helped me learn how to develop and for making the base of this guide.
Reference: http://source.android.com/source/downloading.html
Very good tutorial for beginner
sangosnip69 said:
Very good tutorial for beginner
Click to expand...
Click to collapse
Thanks we tried our best since this is supposed to boost our dev base for our LG
Definitely one to try at home!
Sent from my GT-I9100 using xda premium
Wow 10min is real fast!! I recently tried CM9 directly from one of the Dev's forked repo and after about 4hours of build I got some build error! I need to get a better computer soon if I plan to get my hands real dirty! And if I may I have few suggestions - please mention that it will take a while to download the full repo from google sources else beginners may end up thinking something is wrong(which I did since it took me one full day to sync everything) and that it needs atleast 20-30GB disk space too..(Coz not everyone has Ubuntu as the only OS, I have three in my lapi!!)
A very good guide on the whole for a beginner!!!
pranks1989 said:
Wow 10min is real fast!! I recently tried CM9 directly from one of the Dev's forked repo and after about 4hours of build I got some build error! I need to get a better computer soon if I plan to get my hands real dirty! And if I may I have few suggestions - please mention that it will take a while to download the full repo from google sources else beginners may end up thinking something is wrong(which I did since it took me one full day to sync everything) and that it needs atleast 20-30GB disk space too..(Coz not everyone has Ubuntu as the only OS, I have three in my lapi!!)
A very good guide on the whole for a beginner!!!
Click to expand...
Click to collapse
Very true a great in depth and very informative tutorial for noobs like i was this would have helped me a lot.... Great work
btw pranks1989 i can help you with compiling for defy.... I used to compile roms from eppy's and quarx2k github and never got a error once it else onece eppy pinted out the mistake i was doing.... just send me a pm of your errors and i will try help
Great start for me!
You have been thanked!
Great start for me!
What would the procedure be if you want to create a rom that you can flash via Odin or Heimdall on a Mac client?
The guide I've been looking for ever since I had my first Android device (actually, my Optimus Me is my first Android device)...
Thanks for this great guide. I will try it today.
I already compiled a Rom, it took me 40 min. AMD 8 Core 3,1 MHz and 16 GB DDR3
But when i try a different device i always get errors, i hope your Guide will get me in to it.
serendipityguy said:
You have been thanked!
Great start for me!
What would the procedure be if you want to create a rom that you can flash via Odin or Heimdall on a Mac client?
Click to expand...
Click to collapse
I don't know but it's surely different for odin(I'm not sure that you can).And I don't know on mac either since I use ubuntu and windows. You can look up info on this on the official Android dev website.
Sent from my Optimus Me using xda premium
nerot said:
I don't know but it's surely different for odin(I'm not sure that you can).And I don't know on mac either since I use ubuntu and windows. You can look up info on this on the official Android dev website.
Sent from my Optimus Me using xda premium
Click to expand...
Click to collapse
Odlicno objasnjeno za pocetnike. Svaka cast
Good Beginners Guide. Thank you.
But 90% of it can also be found here:
http://source.android.com/source/initializing.html
This is what i used to build android for the pandaboard a few weeks ago.
And then I have a few questions.
1.
Why do you compile git when you can also download it from apt-sources? Imho this is just confusing for beginners.
2.
Where do you use git in your tutorial?
3.
Didn't you forget lunch and make at the very end of your tutorial?
". build/envsetup.sh" only sets up the environment, imho
(see also here: http://source.android.com/source/building.html)
nerot said:
First you will need to get proprietary drivers from your device.
Connect your device via USB and enter the following commands (from the root of your source repository):
Code:
cd device/xxx/xxx where x is the path to your device
./extract-files.sh
cd ../../..
Click to expand...
Click to collapse
How do I find out what the path is from my device?
I would add the option to install Ubuntu in a VM. Both VMWare player and VirtualBox are free and well supported. This way one can actually create some pre-packaged images with which one can start development right away. In fact I've already made two of them a year ago (one for Froyo and one for Gingerbread):
http://forum.xda-developers.com/showthread.php?t=881845
http://forum.xda-developers.com/showthread.php?t=1022407
One might also make on for ICS (for that Ubuntu 12.04 is also good, and since VMWare Player is free one could use that instead of VirtualBox, as VMWP has more user-friendly features)
If I had a nickle for every time I've seen a thread like this, I would have... a nickle.
Thank you from the bottom of my /dev/hda1
sztupy said:
I would add the option to install Ubuntu in a VM. Both VMWare player and VirtualBox are free and well supported. This way one can actually create some pre-packaged images with which one can start development right away. In fact I've already made two of them a year ago (one for Froyo and one for Gingerbread):
http://forum.xda-developers.com/showthread.php?t=881845
http://forum.xda-developers.com/showthread.php?t=1022407
One might also make on for ICS (for that Ubuntu 12.04 is also good, and since VMWare Player is free one could use that instead of VirtualBox, as VMWP has more user-friendly features)
Click to expand...
Click to collapse
True however unless you have a LOT of ram and a hexa-core CPU compilation under a vm is significantly slower and that's why I didn't add it.But the procedure is the same anyway.
Sent from my Optimus Me using xda premium
Gigadroid said:
How do I find out what the path is from my device?
Click to expand...
Click to collapse
Google is your friend
Sent from my Optimus Me using xda premium
TheBadFish said:
Good Beginners Guide. Thank you.
But 90% of it can also be found here:
http://source.android.com/source/initializing.html
This is what i used to build android for the pandaboard a few weeks ago.
And then I have a few questions.
1.
Why do you compile git when you can also download it from apt-sources? Imho this is just confusing for beginners.
2.
Where do you use git in your tutorial?
3.
Didn't you forget lunch and make at the very end of your tutorial?
". build/envsetup.sh" only sets up the environment, imho
(see also here: http://source.android.com/source/building.html)
Click to expand...
Click to collapse
1.Idk I found this thing simple as well
2.I will review it later since I'm on my phone now and its 00:13 here
3.I don't think it's necessary since I use the same procedure for my rom compilation. I will add it tough just in case someone gets an error.Thanks for the tip.
Sent from my Optimus Me using xda premium
I'll try this on my six core seeing as it would make a perfect devving machine.
just following
Just posting here to follow. I will have to try this tonight. This looks awesome!

[Tutorial] Compile JB on Ubuntu for SII [Originaly By Dastin1015]

Please not that i don't take credits for this tutorial its dastin1015 who made this! but as many people don't look in other forums except the forum for their devices i would like to give you the info here about how to build JB from source​
Original Thread;Here=)
dastin1015 said:
To compile Jellybean on Ubuntu I'm going to first give you steps to set up your computer to get this thing rolling. Also note that this appears to be a development preview source code.
This will NOT make a fully functional ROM, but will give you a place to start. Also I CANNOT fix every error you run into.
Note: The source download is approximately 6GB in size. You will need 25GB free to complete a single build, and up to 80GB (or more) for a full set of builds.
1) You need the following:
-JDK 6 if you wish to build Jellybean. You can download it from java.sun.com. Or:
Code:
$ sudo add-apt-repository "deb http://archive.canonical.com/ lucid partner"
$ sudo apt-get update
$ sudo apt-get install sun-java6-jdk
-Python 2.4 -- 2.7, which you can download from python.org. Or:
Code:
$ sudo apt-get install python
-Git 1.7 or newer. You can find it at git-scm.com. Or:
Code:
$ sudo apt-get install git-core
-Android SDK:
Download the SDK here: http://developer.android.com/sdk/index.html
Extract the SDK and place it in your home directory.
I renamed my SDK to android-sdk to make it easier to navigate to.
Go to your home folder, press Ctrl+H to show hidden files, and open up your .bashrc file.
Add these lines at the bottom of the file:
Code:
# Android tools
export PATH=${PATH}:~/android-sdk/tools
export PATH=${PATH}:~/android-sdk/platform-tools
export PATH=${PATH}:~/bin
Find your .profile file and add this at the bottom of the file:
Code:
PATH="$HOME/android-sdk/tools:$HOME/android-sdk/platform-tools:$PATH"
You have now successfully installed the Android SDK.
To check for updates issue this into your terminal:
Code:
$ android
2) Install required packages. 64-bit (recommended)
Code:
$ sudo apt-get install git-core gnupg flex bison gperf build-essential \
zip curl zlib1g-dev libc6-dev lib32ncurses5-dev ia32-libs \
x11proto-core-dev libx11-dev lib32readline5-dev lib32z-dev \
libgl1-mesa-dev g++-multilib mingw32 tofrodos python-markdown \
libxml2-utils
On newer versions of Ubuntu such as 11.10 you may need to do the following:
Code:
$ sudo ln -s /usr/lib/i386-linux-gnu/libX11.so.6 /usr/lib/i386-linux-gnu/libX11.so
Building on Ubuntu 12.04 is currently only experimentally supported and is not guaranteed to work on branches other than master.
Code:
$ sudo 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-glx:i386 \
libgl1-mesa-dev g++-multilib mingw32 openjdk-6-jdk tofrodos \
python-markdown libxml2-utils xsltproc zlib1g-dev:i386
$ sudo ln -s /usr/lib/i386-linux-gnu/mesa/libGL.so.1 /usr/lib/i386-linux-gnu/libGL.so
3) Configure your USB.
Code:
$ gksudo gedit /etc/udev/rules.d/51-android.rules
Inside of this blank text file insert:
Code:
#Acer
SUBSYSTEM=="usb", ATTR{idVendor}=="0502", MODE="0666"
#Samsung
SUBSYSTEM=="usb", ATTR{idVendor}=="04e8", MODE="0666"
4) Save the file and close it and then issue this command: [CODE]$ sudo chmod a+r /etc/udev/rules.d/51-android.rules
5) Install the repo:
Code:
$ mkdir ~/bin
$ PATH=~/bin:$PATH
$ curl https://dl-ssl.google.com/dl/googlesource/git-repo/repo > ~/bin/repo
$ chmod a+x ~/bin/repo
6) Initialize the repo:
Code:
$ mkdir WORKING_DIRECTORY
$ cd WORKING_DIRECTORY
$ repo init -u https://android.googlesource.com/platform/manifest -b android-4.1.1_r1
6.1) For people who have already done a repo init:
Code:
$ cd WORKING_DIRECTORY
$ repo init -b android-4.1.1_r1
$ repo sync
7) When prompted, enter your real name and email address.
8) Gather the files: [CODE]$ repo sync
9) Compiling:
Code:
$ source build/envsetup.sh
Or:
Code:
$ . build/envsetup.sh
10) Issue:
Code:
$ lunch
11) Pick your poison.
12) Now issue (The '#' is the number of cores your processor has plus 1, ex. I have a dual core processor so I type 'make -j3':
Code:
$ make -j#
~How To Add A Device To The List~
1) Find the github for your device you wish to add. (For me it is the HTC Evo 3D CDMA)
2) Now navigate to the location you are going clone the device tree to:
Code:
$ cd WORKING_DIRECTORY/device
$ mkdir samsung
3) Clone the github device tree from remote to local: (The shooter would be whatever you want that folder to be named so make sure it is whatever standard name would be for your device, example: Nexus One [passion], Nexus S [crespo], Motorola Droid [sholes], HTC Incredible [inc], etc.)
Code:
$ git clone git://github.com/CyanogenMod/android_device_htc_shooter.git shooter
4) Now navigate into the folder:
Code:
$ cd shooter
5) Connect phone to computer and make sure USB debugging is enabled and you have adb set up.
6) Extract Device Proprietary Files:
Code:
$ ./extract-files.sh
7) Navigate back to your home directory for building:
Code:
$ cd ~/WORKING_DIRECTORY
8) Prepare To Compile:
Code:
$ source build/envsetup.sh
Or:
Code:
$ . build/envsetup.sh
9) Get your list of devices:
Code:
$ lunch
10) Pick your poison.
11) Now compile:
Code:
$ make -j#
Or for a flashable zip:
Code:
$ make -j# otapackage
~NOTE~
If you are running into issues such as:
Code:
Which would you like? [full-eng] 5
build/core/product_config.mk:209: *** No matches for product "full_shooter". Stop.
Device shooter not found. Attempting to retrieve device repository from CyanogenMod Github (http://github.com/CyanogenMod).
Repository for shooter not found in the CyanogenMod Github repository list. If this is in error, you may need to manually add it to your local_manifest.xml.
build/core/product_config.mk:209: *** No matches for product "full_shooter". Stop.
** Don't have a product spec for: 'full_shooter'
** Do you have the right repo manifest?
What you need to do is to edit your blob to match the PRODUCT_NAME to the file name. For example with mine I have full_shooter.mk therefore in this file I need to have PRODUCT_NAME to match it. Whatever error it is looking for you just need to change the PRODUCT_NAME line to match what the error shows.
Click to expand...
Click to collapse
reserved for Q/A
It's frowned upon to re-distribute threads across multiple forums, trust me it wasn't allowed for a thread compiled by RC's so the same will go for this and any other thread especially one that was published on the portal as has been made aware to alot of people. Regardless of them reading other forums its clear to see thanks to the new 2013 theme having the new sidebar with top stories where I saw it earlier today. Just a heads up
AvRS said:
It's frowned upon to re-distribute threads across multiple forums, trust me it wasn't allowed for a thread compiled by RC's so the same will go for this and any other thread especially one that was published on the portal as has been made aware to alot of people. Regardless of them reading other forums its clear to see thanks to the new 2013 theme having the new sidebar with top stories where I saw it earlier today. Just a heads up
Click to expand...
Click to collapse
theres alot of people like me who never goes to the porta, dunno why tough
LastStandingDroid said:
theres alot of people like me who never goes to the porta, dunno why tough
Click to expand...
Click to collapse
Either way if it's already posted somewhere it's not advised to repeat the information in device specific forums as it's not device specific and why it's been put in a general section.
Yeah, listen to AvRS, you can face some warnings because it counts as duplicate thread spam. Calling a mod here to decide. Thanks! :good:
protomanez said:
Yeah, listen to AvRS, you can face some warnings because it counts as duplicate thread spam. Calling a mod here to decide. Thanks! :good:
Click to expand...
Click to collapse
thats amazing i never heard of it,
ill make this as much as possible for the SII
Thread closed
AvRS said:
Either way if it's already posted somewhere it's not advised to repeat the information in device specific forums as it's not device specific and why it's been put in a general section.
Click to expand...
Click to collapse
protomanez said:
Yeah, listen to AvRS, you can face some warnings because it counts as duplicate thread spam. Calling a mod here to decide. Thanks! :good:
Click to expand...
Click to collapse
LastStandingDroid said:
thats amazing i never heard of it,
ill make this as much as possible for the SII
Click to expand...
Click to collapse
And the mod has decided, as stated above, the thread is in General for a reason, it's applicable across phones.

[GUIDE] Build CM13 from source for the Z5/Z5C/Z5P

The Sony-Kitakami dev team is glad to announce a guide on how to build CM13 or any CM13 based ROM for the entire Z5- series
Note: If you plan to release a ROM using our sources then credits aren't required, however we would deffinately appriciate it very much!
Before we get started
What you need
Any of our supported devices
A PC that is capable of running linux
An Internet connection
And lots of lots of patience
Getting started
Setting up Linux
To be able to build a ROM fully from source a Linux based operating system is required. This is due to the fact that windows is unable to compile the android source code due to lacking tools/libaries. After all you're compiling Linux on Linux (Because android is Linux). We strongly recommend to have AT LEAST 50 GB of space for Ubuntu!!!
Please be aware that this guide is target audiences with Ubuntu specifically and so may not work on other distros. Because of this we prefer ubuntu for everyone that is coming from windows.
Because this guide isn't about how to install ubuntu, I'll let this guide explain all for you : http://www.linuxtechi.com/ubuntu-15-10-desktop-installation-guide/
Installing the required packages
We will start off by downloading openjdk 7 (Note: Open JDK 8 isn't supported by CM yet).
Please open the terminal and enter or copy paste the following :
Code:
sudo apt-get update && sudo apt-get install openjdk-7-jdk
After entering the password (Note: you won't be able to see any output when typing the password) hit enter and then type "y" and hit enter again.
Once this is completed we will download the required packages. Please copy paste the following into your terminal :
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 maven schedtool
You may have to enter your password again after hitting enter. Once that is done enter "y" again and hit enter again.
Additionally you can set up ccache by entering the following into the terminal :
Code:
echo 'export USE_CCACHE=1' >> ~/.bashrc
after this has been done, restart your PC.
Then we will set up git. Replace "Your name" with your name and "[email protected]" with your email :
Code:
git config --global user.name "Your Name"
git config --global user.email "[email protected]"
Now we will need to set up the repo tool. Copy the following into the terminal:
Code:
mkdir ~/bin && PATH=~/bin:$PATH && echo 'PATH=~/bin:$PATH' >> ~/.bashrc && curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo && chmod a+x ~/bin/repo
Guides
CyanogenMod 13
Getting the CM13 source
Start out by making a directory called cm13 in your home dir by running the following command :
Code:
mkdir ~/cm13/
Now we will initialize the CM13 repository by entering the following in your terminal :
Code:
cd ~/cm13/ && repo init -u https://github.com/CyanogenMod/android.git -b cm-13.0
We are now coming to the worst part and that is downloading the entire 20GB big CM13 source code. To sync the source code, run the following command :
Code:
repo sync
And now wait.... and wait..... and wait....... until it's done
Getting the Z5/Z5C/Z5P source
To clone the device specific source code we'll have to introduce you to some of the codenames as those are used for simplifying reasons when building from source
Code:
NAME CODENAME
Sony Xperia Z5 sumire
Sony Xperia Z5 Compact suzuran
Sony Xperia Z5 Premium satsuki
We will start off by cloning the appropriate manifests for your device. Please enter the following and make sure to replace yourdevicecodename with your device codename :
Code:
cd ~/cm13/ && git clone https://github.com/Sony-Kitakami/android_.repo_local_manifests.git -b cm-13.0-yourdevicecodename .repo/local_manifests
Now we will sync our device specific source like this :
Code:
repo sync --force-sync
This could again take some time depending on your connection as the kernel source is quite heavy.
Building the ROM
We will now get to the big part, which is compiling. Note this could take from 1 hour to more than 10 hours depending on how good your PC is. Replace yourdevicecodename with your targeted device codename.
Please copy the following to your terminal line by line
Code:
cd ~/cm13/
cd .repo/local_manifests/ && git pull && cd ../.. && repo sync --force-sync
. build/envsetup.sh
lunch
cm_yourdevicecodename-userdebug
mka clobber
mka bacon
After a long time of waiting you should be done and your CyanogenMod package should be located in home/cm13/out/target/product/yourdevicecodename/
Congratulations! You have now build your very own CM13 ROM from source!
CyanogenMod 13 based ROMs
If you are planning to build a CM13 based or similar ROM (Bliss Pop, RR, Slim etc.), we're expecting you to be a more advanced user. As much as we would like to give a strict guide, we simply can't cover all as there are always differences between each and every ROM.
You will have to start off by downloading the ROM source. Again this should be similar to CM but the git links are different.
Ex:
Code:
RR = repo init -u [url]https://github.com/ResurrectionRemix/platform_manifest.git[/url] -b marshmallow
Bliss = repo init -u [url]https://github.com/BlissRoms/platform_manifest.git[/url] -b mm6.0
and much more. Most of them can be found on the ROMs official git team under the platform_manifest repo.
Here is where things get hard. You will have to edit our manifests and adjust them to work with your target ROM. This is nearly impossible to explain as each ROM contains different repos that may overlap with the CM ones or it may lack repos that you're trying to remove. In other words, you will need to learn how to use the local manifests. A nice guide exists here https://wiki.cyanogenmod.org/w/Doc:_Using_manifests
Once this is done you will have to adjust your device tree to work with your specific ROM. Again this is always different. The best way to learn is to compare a CM tree with a tree from a different ROM
Ex:
Samsung Galaxy S5 mini tree for CyanogenMod : https://github.com/cm-3470/android_device_samsung_kminilte
Samsugn Galaxy S5 mini tree for BlissPop : https://github.com/cm-3470/android_device_samsung_kminilte/tree/bosp-6
The main differences are the cm.mk or device.mk files etc.
Here is a commit that show the transfer from CM to Bliss Pop which usually isn't very hard
https://github.com/cm-3470/android_...mmit/5e902e7dd228c6804b2735af9a96ea02969aa2cf
Once this is completed you can run your build and release it!
XDA:DevDB Information
How to build CM13 from source for the Z5, ROM for the Sony Xperia Z5
Contributors
CTXz, zacharias.maladroit, Moonbutt74
Source Code: https://github.com/Sony-Kitakami
ROM OS Version: 6.0.x Marshmallow
ROM Firmware Required: Stock Marshmalllow
Based On: CyanogenMod
Version Information
Status: Alpha
Created 2016-04-12
Last Updated 2016-04-15
Reserved
Reserved
Thanks for posting the guide
I followed the steps, but got stuck at the command: "cd ~/cm13/ && git clone [email protected]:Sony-Kitakami/android_.repo_local_manifests.git -b cm-13.0-sumire"
It returned this to me:
Cloning into 'android_.repo_local_manifests'...
Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
EDIT: Never mind, I investigated, and found out that I had to generate an SSH key and link that to my GitHub account. If anyone needs help with this, I used this guide: https://help.github.com/articles/generating-an-ssh-key/
Uclydde said:
Thanks for posting the guide
I followed the steps, but got stuck at the command: "cd ~/cm13/ && git clone [email protected]:Sony-Kitakami/android_.repo_local_manifests.git -b cm-13.0-sumire"
It returned this to me:
Cloning into 'android_.repo_local_manifests'...
Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
EDIT: Never mind, I investigated, and found out that I had to generate an SSH key and link that to my GitHub account. If anyone needs help with this, I used this guide: https://help.github.com/articles/generating-an-ssh-key/
Click to expand...
Click to collapse
Hey, sorry for that. I had git set to ssh like and forgot that they require a keygen. I've changed it to https://github.com/Sony-Kitakami/android_.repo_local_manifests.git -b cm-13.0-yourdevicecodename so it no longer needs a key
Actually, is you are building CM13 and using Ubuntu 14.04 or up, you just need to type:
Code:
sudo apt-get install bison g++-multilib git gperf libxml2-utils make zlib1g-dev:i386 zip
Okay, I hit another bump. When I type: "cd .repo/local_manifests/ && git pull && cd ../.. && repo sync --force-sync"
It returns:
bash: cd: .repo/local_manifests/: No such file or directory
zhangyang_haha said:
Actually, is you are building CM13 and using Ubuntu 14.04 or up, you just need to type:
Code:
sudo apt-get install bison g++-multilib git gperf libxml2-utils make zlib1g-dev:i386 zip
Click to expand...
Click to collapse
No, you'll be missing quite some packages
Sent from my E5823 using XDA-Developers mobile app
Uclydde said:
Okay, I hit another bump. When I type: "cd .repo/local_manifests/ && git pull && cd ../.. && repo sync --force-sync"
It returns:
bash: cd: .repo/local_manifests/: No such file or directory
Click to expand...
Click to collapse
Ok updated again. Please run this.
cd ~/cm13/ && git clone https://github.com/Sony-Kitakami/android_.repo_local_manifests.git -b cm-13.0-yourdevicecodename .repo/local_manifests
CTXz said:
Ok updated again. Please run this.
cd ~/cm13/ && git clone https://github.com/Sony-Kitakami/android_.repo_local_manifests.git -b cm-13.0-yourdevicecodename .repo/local_manifests
Click to expand...
Click to collapse
Yay, that worked! However, I got to the "cm_yourdevicecodename-userdebug" line, so I entered "cm_sumire-userdebug", but that returned: "cm_sumire-userdebug: command not found"
Uclydde said:
Yay, that worked! However, I got to the "cm_yourdevicecodename-userdebug" line, so I entered "cm_sumire-userdebug", but that returned: "cm_sumire-userdebug: command not found"
Click to expand...
Click to collapse
This needs a
Code:
repo --sync
in between
Uclydde said:
Yay, that worked! However, I got to the "cm_yourdevicecodename-userdebug" line, so I entered "cm_sumire-userdebug", but that returned: "cm_sumire-userdebug: command not found"
Click to expand...
Click to collapse
When you type lunch it will show a big list of devices and prompt for an input. Enter cm_sumire-userdebug. You can also however run
Code:
lunch cm_sumire-userdebug
Sent from my E5823 using XDA-Developers mobile app
Nice guide, buddy
Binaries have been updated to v5a,
v4 is included in this, can you update please? I did it manually and got it to boot
I'm not able to push them to github.
http://developer.sonymobile.com/downloads/tool/software-binaries-for-aosp-m-android-6-0/
celderic said:
Binaries have been updated to v5a,
v4 is included in this, can you update please? I did it manually and got it to boot
I'm not able to push them to github.
http://developer.sonymobile.com/downloads/tool/software-binaries-for-aosp-m-android-6-0/
Click to expand...
Click to collapse
Is the camera working for you ?
Did the focus improve ? or are still changes needed ?
zacharias.maladroit said:
Is the camera working for you ?
Did the focus improve ? or are still changes needed ?
Click to expand...
Click to collapse
It doesn't work for me with v4, or v5a
Using the guide posted here, nothing changed only updated to v5a manually.
I haven't bothered to look through the log yet, bur it says camera hardware inaccessible or something like that I forget the exact wording. With v4 and v5a, I even downloaded the source again to make sure it wasn't a problem on my end.
I'll try and have a proper look tomorrow
celderic said:
It doesn't work for me with v4, or v5a
Using the guide posted here, nothing changed only updated to v5a manually.
I haven't bothered to look through the log yet, bur it says camera hardware inaccessible or something like that I forget the exact wording. With v4 and v5a, I even downloaded the source again to make sure it wasn't a problem on my end.
I'll try and have a proper look tomorrow
Click to expand...
Click to collapse
Yeah, we kinda apologize for that. My linux environment has broken hard after upgrading to ubloatu, i mean Ubuntu 16.04... I'm busy updating to debian now, and will most likely stick with debian jessie as sid and stretch ended in an huge catastrophy. Thanks to @moonbutt74 for not warning me. (<- Only a joke, he actually predictied that sid will be a catastrophy but I didn't listen cuz that's me). I'll also most likely need to update the guide too as we no longer prefer/recommend ubuntu 16.04
Sent from my E5823 using XDA-Developers mobile app
celderic said:
It doesn't work for me with v4, or v5a
Using the guide posted here, nothing changed only updated to v5a manually.
I haven't bothered to look through the log yet, bur it says camera hardware inaccessible or something like that I forget the exact wording. With v4 and v5a, I even downloaded the source again to make sure it wasn't a problem on my end.
I'll try and have a proper look tomorrow
Click to expand...
Click to collapse
@celderic
did you do any modifications to the repos ?
If not did the kernel built with the ROM work for you ?
Thanks
edit:
v04 and v05a binary blobs are the same for us (Kitakami)
Changes in v05a was for kanuti, rhine, shinano and yukon
zacharias.maladroit said:
@celderic
did you do any modifications to the repos ?
If not did the kernel built with the ROM work for you ?
Thanks
edit:
v04 and v05a binary blobs are the same for us (Kitakami)
Changes in v05a was for kanuti, rhine, shinano and yukon
Click to expand...
Click to collapse
Sorry been on holiday not had time to reply on here, oh I didn't realise they where the same for our device.
I didn't modify the repos, and yes the stock cm kernel booted fine.
openjdk-7 isnt available under ubuntu 16.04. Is 8 or 9 supported yet or do I have to manually install v7?

[GUIDE] How to Build AOSP Pie Custom ROM for Xperia Devices

WARNING: This guide is only for experienced users only. I will not responsible for any damages that you had been done during modifying your android device!
Prerequisite before setup for custom ROM building:
1. An unlocked Xperia device, which have its support for Pie ROM. See the list of device here
2. Ubuntu 18.04 OS (either on actual installation on HDD or installed on virtualbox only)
3. A powerful PC/laptop
4. 100Mbps internet connection
5. A brain
NOTE: If your device is not unlocked yet, please follow the official guide given by Sony here.
Steps for building the custom ROM:
1. Install OpenJDK JDK version
Code:
sudo apt-get install openjdk-8-jdk
2. Install all of these stuffs (you might need to copy these into text editor and save it as script file:
Code:
sudo apt install -y bc build-essential ccache curl g++-multilib gcc-multilib git gnupg gperf imagemagick lib32ncurses5-dev lib32readline-dev lib32z1-dev liblz4-tool libncurses5-dev libsdl1.2-dev libssl-dev libwxgtk3.0-dev libxml2 libxml2-utils lzop m4 openjdk-8-jdk pngcrush repo rsync schedtool squashfs-tools xsltproc zip zlib1g-dev bison gperf libxml2-utils make zlib1g-dev:i386 liblz4-tool libncurses5 lunch unzip clang
3. Download repo tool (you might be prompted to set up git account access when running curl command):
Code:
mkdir ~/bin
curl http://commondatastorage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
chmod a+x ~/bin/repo
4. Open up .bashrc file:
Code:
nano ~/.bashrc
5. Put these line at the end of the file and save:
Code:
export PATH=~/bin:$PATH
export LC_ALL=C
export USE_CCACHE=1
Then, configure cache limit to 20GB (you have to declare very specific because running ccache -M 20G only straight from the terminal won't work)
Code:
prebuilts/misc/linux-x86/ccache/ccache -M 20G
6. Reload bash variables:
Code:
source ~/.bashrc
7. Initialize repo tree:
Code:
mkdir ~/android
cd ~/android
repo init -u https://android.googlesource.com/platform/manifest -b android-9.0.0_r35
8. Clone the local manifests from GitHub:
Code:
cd .repo
git clone https://github.com/sonyxperiadev/local_manifests
cd local_manifests
git checkout android-9.0.0_r35
cd ../..
9. Downloading the 30-40GB of source codes!:
Code:
repo sync
10. Cherry-pick the upstream patches:
Code:
./repo_update.sh
11. Initializing device type for ROM building:
Code:
source build/envsetup.sh && lunch
or
Code:
source build/envsetup.sh && lunch aosp_[device_model]-userdebug
12. Building the custom ROM ( it will take at about 4-5 hours):
Code:
make -j[number of CPU cores]
13. Flashing your AOSP images (ROM images can be found at android/out/target/product/<device>/ directory):
Code:
fastboot erase cache
fastboot erase userdata
fastboot flash boot boot.img
fastboot flash system system.img
fastboot flash cache cache.img
fastboot flash userdata userdata.img
14. Flashing OEM images (Download the vendor image corresponding to your device here):
Code:
fastboot flash oem SW_binaries_for_Xperia_AOSP_O_MR0_4.4_<release version>_<platform>.img
15. Reboot your device:
Code:
fastboot reboot
If the device able to boot, then congratulations!...
Guide reference: https://developer.sony.com/develop/...build-instructions/build-aosp-android-p-9-0-0
ADDITIONAL NOTES:
If you're want Google apps installed, follow these steps below:
1. Download OpenGapps from the website here and put the opengapps zip file into microsd card or USB OTG drive.
2. Download Magisk zip file here and put it into microsd card or USB OTG drive.
3. Download the TWRP image here according to your device and flash the recovery or just boot it directly
Code:
fastboot flash recovery TWRP.img
or
Code:
fastboot boot TWRP.img
4. Go to Install and select microSD or USB OTG storage and install opengapps package first.
5. Then, install Magisk package for patching in order to enable Google apps functionalities on AOSP ROM.
6. Wipe cache and reboot the device.
Thanks for the advice
This guide really came in handy, i'm not quite fixed up just yet, but so far has been a real help, thank you

Categories

Resources