NOTICE: I'm fine with this tutorial being posted on other sites, as long as I am given credit and have your thread point back to here for the pieces that I have specifically written. I do not condone near verbatim or verbatim copy and pasting of my work or others work without credit. Please give credit where credit is due. Thank you.
07-17-12: I have not, nor shall I ever claim copyright.
To compile Kit-Kat on Ubuntu I'm going to first give you steps to set up your computer to get this thing rolling.
You MUST be running a 64 bit version of Ubuntu, 32 bit is not supported.
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.
READ the entire OP and make sure to properly follow instructions. Don't forget to search the thread as your question may have already been answered.
Please use Pastebin for all errors you run into. Posting a link is much easier than a long list of errors in the thread. Thank you.
You will need 25GB (or more) 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 Kit-Kat.
Code:
$ sudo add-apt-repository ppa:webupd8team/java
$ sudo apt-get update && sudo apt-get install oracle-java6-installer
-Python, which you can download from python.org. Or:
Code:
$ sudo apt-get install python
-Git, which 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) Installing required packages (Ubuntu 13.04+)
Code:
$ sudo apt-get install git-core gnupg flex bison gperf build-essential \
zip curl zlib1g-dev zlib1g-dev:i386 libc6-dev lib32ncurses5-dev lib32z1 \
lib32ncurses5 lib32bz2-1.0 x11proto-core-dev libx11-dev:i386 libreadline6-dev:i386 \
lib32z1-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 lzop
$ sudo ln -s /usr/lib/i386-linux-gnu/mesa/libGL.so.1 /usr/lib/i386-linux-gnu/libGL.so
Installing required packages (Ubuntu 12.04)
Code:
$ sudo apt-get install git 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 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
Installing required packages (Ubuntu 10.04 -- 11.10)
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
On Ubuntu 10.10:
Code:
$ sudo ln -s /usr/lib32/mesa/libGL.so.1 /usr/lib32/mesa/libGL.so
On Ubuntu 11.10:
Code:
$ sudo apt-get install libx11-dev:i386
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"
#ASUS
SUBSYSTEM=="usb", ATTR{idVendor}=="0b05", MODE="0666"
#Dell
SUBSYSTEM=="usb", ATTR{idVendor}=="413c", MODE="0666"
#Foxconn
SUBSYSTEM=="usb", ATTR{idVendor}=="0489", MODE="0666"
#Garmin-Asus
SUBSYSTEM=="usb", ATTR{idVendor}=="091E", MODE="0666"
#Google
SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", MODE="0666"
#HTC
SUBSYSTEM=="usb", ATTR{idVendor}=="0bb4", MODE="0666"
#Huawei
SUBSYSTEM=="usb", ATTR{idVendor}=="12d1", MODE="0666"
#K-Touch
SUBSYSTEM=="usb", ATTR{idVendor}=="24e3", MODE="0666"
#KT Tech
SUBSYSTEM=="usb", ATTR{idVendor}=="2116", MODE="0666"
#Kyocera
SUBSYSTEM=="usb", ATTR{idVendor}=="0482", MODE="0666"
#Lenevo
SUBSYSTEM=="usb", ATTR{idVendor}=="17EF", MODE="0666"
#LG
SUBSYSTEM=="usb", ATTR{idVendor}=="1004", MODE="0666"
#Motorola
SUBSYSTEM=="usb", ATTR{idVendor}=="22b8", MODE="0666"
#NEC
SUBSYSTEM=="usb", ATTR{idVendor}=="0409", MODE="0666"
#Nook
SUBSYSTEM=="usb", ATTR{idVendor}=="2080", MODE="0666"
#Nvidia
SUBSYSTEM=="usb", ATTR{idVendor}=="0955", MODE="0666"
#OTGV
SUBSYSTEM=="usb", ATTR{idVendor}=="2257", MODE="0666"
#Pantech
SUBSYSTEM=="usb", ATTR{idVendor}=="10A9", MODE="0666"
#Philips
SUBSYSTEM=="usb", ATTR{idVendor}=="0471", MODE="0666"
#PMC-Sierra
SUBSYSTEM=="usb", ATTR{idVendor}=="04da", MODE="0666"
#Qualcomm
SUBSYSTEM=="usb", ATTR{idVendor}=="05c6", MODE="0666"
#SK Telesys
SUBSYSTEM=="usb", ATTR{idVendor}=="1f53", MODE="0666"
#Samsung
SUBSYSTEM=="usb", ATTR{idVendor}=="04e8", MODE="0666"
#Sharp
SUBSYSTEM=="usb", ATTR{idVendor}=="04dd", MODE="0666"
#Sony Ericsson
SUBSYSTEM=="usb", ATTR{idVendor}=="0fce", MODE="0666"
#Toshiba
SUBSYSTEM=="usb", ATTR{idVendor}=="0930", MODE="0666"
#ZTE
SUBSYSTEM=="usb", ATTR{idVendor}=="19D2", 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
4a) [OPTIONAL] Setting up ccache
You can optionally tell the build to use the ccache compilation tool. Ccache acts as a compiler cache that can be used to speed-up rebuilds. This works very well if you do "make clean" often, or if you frequently switch between different build products.
Put the following in your .bashrc or equivalent.
Code:
export USE_CCACHE=1
By default the cache will be stored in ~/.ccache. If your home directory is on NFS or some other non-local filesystem, you will want to specify the directory in your .bashrc as well.
Code:
export CCACHE_DIR=<path-to-your-cache-directory>
The suggested cache size is 50-100GB. You will need to run the following command once you have downloaded the source code:
Code:
prebuilts/misc/linux-x86/ccache/ccache -M 50G
This setting is stored in the CCACHE_DIR and is persistent.
5) Install the repo:
Code:
$ mkdir ~/bin
$ PATH=~/bin:$PATH
$ curl http://commondatastorage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
$ chmod a+x ~/bin/repo
6) Initialize the repo:
Code:
$ mkdir WORKING_DIRECTORY
$ cd WORKING_DIRECTORY
6a) For AOSP:
Code:
$ repo init -u https://android.googlesource.com/platform/manifest -b android-4.4.4_r2
6.1) For people who have already done a repo init:
Code:
$ cd WORKING_DIRECTORY
AOSP:
Code:
$ repo init -b android-4.4.4_r2
$ repo sync
7) When prompted, enter your real name and email address.
8) Gather the files:
Code:
$ repo sync
9) Continue onto adding a device
~How To Add A Device To The List~
1) Find the github for your device you wish to add. (For me it is the Asus Nexus 7 (2013) [codename: flo]
2) Now navigate to the location you are going clone the device tree to:
Code:
$ cd WORKING_DIRECTORY/device
$ mkdir asus
3) Clone the github device tree from remote to local: (The name after the branch 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 https://android.googlesource.com/device/asus/flo -b kitkat-dev flo
4) Now navigate into the folder:
Code:
$ cd flo
5) Connect phone to computer and make sure USB debugging is enabled and you have adb set up.
6) Extract Device Proprietary Files (if extract script is present):
Code:
$ ./extract-files.sh
Or:
Code:
./proprietary-files.sh
Or: See use your device's provided proprietary blobs (like flo): Download the binaries from: https://developers.google.com/android/nexus/drivers
Extract the blobs and place them in the directory from the root of your working directory (ex. vendor/asus/flo): vendor/MANUFACTUROR/CODENAME
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 ('#' being the number of cores in your processor +1):
Code:
$ make -j#
Or for a flashable zip:
Code:
$ make -j# otapackage
~FIXES~
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_d710". Stop.
Device d710 not found. Attempting to retrieve device repository from CyanogenMod Github (http://github.com/CyanogenMod).
Repository for d710 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_d710". Stop.
** Don't have a product spec for: 'full_d710'
** 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_d710.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.
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------
If you run into issues with Java being the incorrect version here is the fix:
Make sure Java 6 JDK is installed by typing in:
Code:
$ java -version
Open the file main.mk in build/core and delete this line from the java error code section:
Code:
$(error stop)
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Android 4.1+ needs an insecure kernel to use adb: http://forum.xda-developers.com/showthread.php?t=1687590
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------
This tutorial is based off this one: http://source.android.com/index.html
First
Great tut bro...thanks
And it returns
Team Nocturnal Developer
Nice d, well written for sure
Sent from my EVO using Tapatalk
You help me so much with this completly guide, did you think that work good with Zorin OS? I wanna try this distro based on Ubuntu.
So I'm a straight up beginner here, so bear with me...
I followed your guide to get everything setup, and I've learned so much already! I've gotten to the point of running the make command for my device, but I'm getting stuck on an error. I've tried to search this up as best as I could before posting here, but I'm at a loss lol.
make: *** No rule to make target `out/target/product/vs980/kernel', needed by `out/target/product/vs980/boot.img'. Stop.
make: *** Waiting for unfinished jobs....
Click to expand...
Click to collapse
Obviously this has to do with the kernel, but I believe I have all my files in the correct place. Maybe someone can point me in the right direction?
WARNING!!! I am about to ask 2 stupid and nooby questions:
1.This tutorial is for building a KIt Kat ROM right?
2.After repo sync I am stuck. I have an HTC Flyer and it's pretty much abandoned by HTC. Very few devs are working on it. So my question is are these the right files i need to clone?
https://github.com/FlyerICS/android_device_htc_flyer
Thank you for your time? And sorry if these are stupid question but I am still learning
I'm syncing 4.4-r1(kitkat) sources from aosp after the sync tree is 100% complete i got this error.
Syncing work tree: 100% (407/407), done.
error: device/google/accessory/demokit/: device/google/accessory/demokit checkout f414529d6ff582a1d3f739710fb668587dfb4461
[email protected]:~/WORKING_DIRECTORY$
Click to expand...
Click to collapse
any idea what should i do ??
And for Mako use proprietary binaries from your mako extract and in lunch menu select 8 it will build for KitKat for mako.
all features working and initial screen captures @ plus.google.com/u/0/109701627813546607713/posts
---------- Post added at 09:43 AM ---------- Previous post was at 09:39 AM ----------
aviz1911 said:
I'm syncing 4.4-r1(kitkat) sources from aosp after the sync tree is 100% complete i got this error.
any idea what should i do ??
Click to expand...
Click to collapse
i was also getting some error, now able to recall, but i suggest go ahead and build. that will be ultimate test.
Also instead of just "repo sync " to save time use "repo sync -c -d"
~Amit
hello.i have a ubuntu 13.10,but your guide is only for ubuntu 12 and below,so what is the command to install required package?
try this :
http://www.scottsroms.com/showthrea...vices-Build-AOSP-from-Scratch-on-Ubuntu-13-10
hisname said:
hello.i have a ubuntu 13.10,but your guide is only for ubuntu 12 and below,so what is the command to install required package?
Click to expand...
Click to collapse
Thanks. Nice guide..
Hi everybody!!
A question for all developpers:
Why since android 4.1, i cannot compile correctly executable files (like adb, adbd etc etc)? (4.0.4 no problem)
I have found that executable.mk in build/core folder is in cause:
Code:
ifeq ($(LOCAL_FORCE_STATIC_EXECUTABLE),true)
$(linked_module): $(my_target_crtbegin_static_o) $(all_objects) $(all_libraries) $(my_target_crtend_o)
$(transform-o-to-static-executable)
else
$(linked_module): $(my_target_crtbegin_dynamic_o) $(all_objects) $(all_libraries) $(my_target_crtend_o)
$(transform-o-to-executable)
endif
When LOCAL_FORCE_STATIC_EXECUTABLE is include in Android.mk of executable, the file in correct in output, but if the option is not present, my files are compiled like Share Lib.......?
What's the cause of this problem?
-toolchain?
-version of ubuntu (10.04 updated)?
-version of gcc/gxx from my computer (don't know if it uses any part of it)?
-if y try to compile it with another toolchain, will my files be correct in output?
Maybe Dastin can help me?
Many thanks for your help.
Bizcuite
Hello, I made a build for mako today... Bootloop...
I think these lines of the log are the issue
Code:
F/libEGL ( 804): couldn't find an OpenGL ES implementation
F/libc ( 804): Fatal signal 6 (SIGABRT) at 0x00000324 (code=-6), thread 804
I haven't touched the original code. Built as is
Full logcat has been attached.
Thank you for your help.
EDIIT: Lol, I was missing binary files it turns out.
hi, can someone help me with this error
Code:
target thumb C++: content_content_common_gyp <= external/chromium_org/content/common/android/device_telephony_info.cc
target thumb C++: content_content_common_gyp <= external/chromium_org/content/common/android/hash_set.cc
In file included from external/chromium_org/content/common/android/hash_set.cc:5:0:
/root/sagaCM/cm11/target/product/saga/obj/GYP/shared_intermediates/content/jni/HashSet_jni.h:10:26: error: extra tokens at end of #ifndef directive [-Werror]
/root/sagaCM/cm11/target/product/saga/obj/GYP/shared_intermediates/content/jni/HashSet_jni.h:11:26: error: missing whitespace after the macro name [-Werror]
target thumb C++: content_content_common_gyp <= external/chromium_org/content/common/android/surface_texture_peer.cc
In file included from external/chromium_org/content/common/android/hash_set.cc:5:0:
/root/sagaCM/cm11/target/product/saga/obj/GYP/shared_intermediates/content/jni/HashSet_jni.h:24:20: error: expected initializer before '<' token
/root/sagaCM/cm11/target/product/saga/obj/GYP/shared_intermediates/content/jni/HashSet_jni.h:26:17: error: expected initializer before '<' token
/root/sagaCM/cm11/target/product/saga/obj/GYP/shared_intermediates/content/jni/HashSet_jni.h:29:22: error: expected '{' before '<' token
/root/sagaCM/cm11/target/product/saga/obj/GYP/shared_intermediates/content/jni/HashSet_jni.h:29:22: error: expected unqualified-id before '<' token
external/chromium_org/content/common/android/hash_set.cc:30:1: error: expected '}' at end of input
cc1plus: all warnings being treated as errors
make: *** [/root/sagaCM/cm11/target/product/saga/obj/STATIC_LIBRARIES/content_content_common_gyp_intermediates/content/common/android/hash_set.o] Error 1
thanks
kylon said:
hi, can someone help me with this error
Code:
target thumb C++: content_content_common_gyp <= external/chromium_org/content/common/android/device_telephony_info.cc
target thumb C++: content_content_common_gyp <= external/chromium_org/content/common/android/hash_set.cc
In file included from external/chromium_org/content/common/android/hash_set.cc:5:0:
/root/sagaCM/cm11/target/product/saga/obj/GYP/shared_intermediates/content/jni/HashSet_jni.h:10:26: error: extra tokens at end of #ifndef directive [-Werror]
/root/sagaCM/cm11/target/product/saga/obj/GYP/shared_intermediates/content/jni/HashSet_jni.h:11:26: error: missing whitespace after the macro name [-Werror]
target thumb C++: content_content_common_gyp <= external/chromium_org/content/common/android/surface_texture_peer.cc
In file included from external/chromium_org/content/common/android/hash_set.cc:5:0:
/root/sagaCM/cm11/target/product/saga/obj/GYP/shared_intermediates/content/jni/HashSet_jni.h:24:20: error: expected initializer before '<' token
/root/sagaCM/cm11/target/product/saga/obj/GYP/shared_intermediates/content/jni/HashSet_jni.h:26:17: error: expected initializer before '<' token
/root/sagaCM/cm11/target/product/saga/obj/GYP/shared_intermediates/content/jni/HashSet_jni.h:29:22: error: expected '{' before '<' token
/root/sagaCM/cm11/target/product/saga/obj/GYP/shared_intermediates/content/jni/HashSet_jni.h:29:22: error: expected unqualified-id before '<' token
external/chromium_org/content/common/android/hash_set.cc:30:1: error: expected '}' at end of input
cc1plus: all warnings being treated as errors
make: *** [/root/sagaCM/cm11/target/product/saga/obj/STATIC_LIBRARIES/content_content_common_gyp_intermediates/content/common/android/hash_set.o] Error 1
thanks
Click to expand...
Click to collapse
You're using jdk 7, switch to 6
I m using oracle j7 and it s working with cm10x.
Why cm11 would need an older version
Inviato dal mio Desire S utilizzando Tapatalk
kylon said:
I m using oracle j7 and it s working with cm10x.
Why cm11 would need an older version
Inviato dal mio Desire S utilizzando Tapatalk
Click to expand...
Click to collapse
Because the jni header files, based on generic java classes, are messed with jdk 7, you for sure can alter the python file instead which generates them, but most roms use aosp of chromium and no fork, so there isn't really anything you can push this change to (except you do your own fork).
Also at every rom jdk 6 is recommended, jdk 7 fixes are just included as nice to have, when the whole thing got stable enough.
dastin1015 said:
6a) For AOSP:
Code:
$ repo init -u https://android.googlesource.com/platform/manifest -b android-4.4_r1
Click to expand...
Click to collapse
When doing this step I get this error:
Code:
[B]fatal: unable to auto-detect email address (got '[email protected](none)')[/B]
How to fix?
You need to use the git config command to set your name and email. Look up the syntax, I'm not at home just now.
Sent from my SAMSUNG-SGH-I717 using XDA Premium 4 mobile app
Related
To compile Gingerbread on Ubuntu I'm going to first give you steps to set up your computer to get this thing rolling. This will NOT make a fully functional ROM, but give you a place to start.
Note: The source is approximately 2.6GB in size. You will need 10GB free to complete the build.
These instructions are compiled by me from different sources such as source.android.com and Cyanogen Wiki.
1) You need the following:
Python 2.4 -- 2.7, which you can download from python.org.
Or:
Code:
$ sudo add-apt-repository ppa:fkrull/deadsnakes
$ sudo apt-get update
$ sudo apt-get install python2.5
JDK 6 if you wish to build Gingerbread or newer; JDK 5 for Froyo or older. You can download both from java.sun.com.
Or:
Code:
$ sudo add-apt-repository "deb http://archive.canonical.com/ lucid partner"
$ sudo add-apt-repository "deb-src http://archive.canonical.com/ubuntu lucid partner"
$ sudo apt-get update
$ sudo apt-get install sun-java6-jdk
Git 1.5.4 or newer. You can find it at git-scm.com.
Or:
Code:
$ sudo apt-get update
$ sudo apt-get upgrade
$ sudo apt-get install git-core
Valgrind, a tool that will help you find memory leaks, stack corruption, array bounds overflows, etc. Download from valgrind.org.
Or:
Code:
$ sudo apt-get update
$ sudo apt-get upgrade
$ sudo apt-get install valgrind
2) Install required packages.
Code:
$ sudo apt-get install git-core gnupg flex bison gperf build-essential \
zip curl zlib1g-dev libc6-dev lib64ncurses5-dev \
x11proto-core-dev libx11-dev lib64readline5-dev lib64z-dev \
libgl1-mesa-dev g++-multilib tofrodos
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, SYSFS{idVendor}==0502, MODE=0666
#ASUS
SUBSYSTEM==usb, SYSFS{idVendor}==0b05, MODE=0666
#Dell
SUBSYSTEM==usb, SYSFS{idVendor}==413c, MODE=0666
#Foxconn
SUBSYSTEM==usb, SYSFS{idVendor}==0489, MODE=0666
#Garmin-Asus
SUBSYSTEM==usb, SYSFS{idVendor}==091E, MODE=0666
#Google
SUBSYSTEM==usb, SYSFS{idVendor}==18d1, MODE=0666
#HTC
SUBSYSTEM=="usb", SYSFS{idVendor}=="0bb4", MODE="0666"
#Huawei
SUBSYSTEM==usb, SYSFS{idVendor}==12d1, MODE=0666
#K-Touch
SUBSYSTEM==usb, SYSFS{idVendor}==24e3, MODE=0666
#KT Tech
SUBSYSTEM==usb, SYSFS{idVendor}==2116, MODE=0666
#Kyocera
SUBSYSTEM==usb, SYSFS{idVendor}==0482, MODE=0666
#Lenevo
SUBSYSTEM==usb, SYSFS{idVendor}==17EF, MODE=0666
#LG
SUBSYSTEM==usb, SYSFS{idVendor}==1004, MODE=0666
#Motorola
SUBSYSTEM==usb, SYSFS{idVendor}==22b8, MODE=0666
#NEC
SUBSYSTEM==usb, SYSFS{idVendor}==0409, MODE=0666
#Nook
SUBSYSTEM==usb, SYSFS{idVendor}==2080, MODE=0666
#Nvidia
SUBSYSTEM==usb, SYSFS{idVendor}==0955, MODE=0666
#OTGV
SUBSYSTEM==usb, SYSFS{idVendor}==2257, MODE=0666
#Pantech
SUBSYSTEM==usb, SYSFS{idVendor}==10A9, MODE=0666
#Philips
SUBSYSTEM==usb, SYSFS{idVendor}==0471, MODE=0666
#PMC-Sierra
SUBSYSTEM==usb, SYSFS{idVendor}==04da, MODE=0666
#Qualcomm
SUBSYSTEM==usb, SYSFS{idVendor}==05c6, MODE=0666
#SK Telesys
SUBSYSTEM==usb, SYSFS{idVendor}==1f53, MODE=0666
#Samsung
SUBSYSTEM==usb, SYSFS{idVendor}==04e8, MODE=0666
#Sharp
SUBSYSTEM==usb, SYSFS{idVendor}==04dd, MODE=0666
#Sony Ericsson
SUBSYSTEM==usb, SYSFS{idVendor}==0fce, MODE=0666
#Toshiba
SUBSYSTEM==usb, SYSFS{idVendor}==0930, MODE=0666
#ZTE
SUBSYSTEM==usb, SYSFS{idVendor}==19D2, 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) Download 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-2.3.7_r1
7) When prompted, please configure Repo with your real name and email address. To use the Gerrit code-review tool, you will need an email address that is connected with a registered Google account. Make sure this is a live address at which you can receive messages. The name that you provide here will show up in attributions for your code submissions.
8) Gather the files:
Code:
$ repo sync
9) Verify and insert public key block:
Code:
$ gpg --import
Code:
-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: GnuPG v1.4.2.2 (GNU/Linux)
mQGiBEnnWD4RBACt9/h4v9xnnGDou13y3dvOx6/t43LPPIxeJ8eX9WB+8LLuROSV
lFhpHawsVAcFlmi7f7jdSRF+OvtZL9ShPKdLfwBJMNkU66/TZmPewS4m782ndtw7
8tR1cXb197Ob8kOfQB3A9yk2XZ4ei4ZC3i6wVdqHLRxABdncwu5hOF9KXwCgkxMD
u4PVgChaAJzTYJ1EG+UYBIUEAJmfearb0qRAN7dEoff0FeXsEaUA6U90sEoVks0Z
wNj96SA8BL+a1OoEUUfpMhiHyLuQSftxisJxTh+2QclzDviDyaTrkANjdYY7p2cq
/HMdOY7LJlHaqtXmZxXjjtw5Uc2QG8UY8aziU3IE9nTjSwCXeJnuyvoizl9/I1S5
jU5SA/9WwIps4SC84ielIXiGWEqq6i6/sk4I9q1YemZF2XVVKnmI1F4iCMtNKsR4
MGSa1gA8s4iQbsKNWPgp7M3a51JCVCu6l/8zTpA+uUGapw4tWCp4o0dpIvDPBEa9
b/aF/ygcR8mh5hgUfpF9IpXdknOsbKCvM9lSSfRciETykZc4wrRCVGhlIEFuZHJv
aWQgT3BlbiBTb3VyY2UgUHJvamVjdCA8aW5pdGlhbC1jb250cmlidXRpb25AYW5k
cm9pZC5jb20+iGAEExECACAFAknnWD4CGwMGCwkIBwMCBBUCCAMEFgIDAQIeAQIX
gAAKCRDorT+BmrEOeNr+AJ42Xy6tEW7r3KzrJxnRX8mij9z8tgCdFfQYiHpYngkI
2t09Ed+9Bm4gmEO5Ag0ESedYRBAIAKVW1JcMBWvV/0Bo9WiByJ9WJ5swMN36/vAl
QN4mWRhfzDOk/Rosdb0csAO/l8Kz0gKQPOfObtyYjvI8JMC3rmi+LIvSUT9806Up
hisyEmmHv6U8gUb/xHLIanXGxwhYzjgeuAXVCsv+EvoPIHbY4L/KvP5x+oCJIDbk
C2b1TvVk9PryzmE4BPIQL/NtgR1oLWm/uWR9zRUFtBnE411aMAN3qnAHBBMZzKMX
LWBGWE0znfRrnczI5p49i2YZJAjyX1P2WzmScK49CV82dzLo71MnrF6fj+Udtb5+
OgTg7Cow+8PRaTkJEW5Y2JIZpnRUq0CYxAmHYX79EMKHDSThf/8AAwUIAJPWsB/M
pK+KMs/s3r6nJrnYLTfdZhtmQXimpoDMJg1zxmL8UfNUKiQZ6esoAWtDgpqt7Y7s
KZ8laHRARonte394hidZzM5nb6hQvpPjt2OlPRsyqVxw4c/KsjADtAuKW9/d8phb
N8bTyOJo856qg4oOEzKG9eeF7oaZTYBy33BTL0408sEBxiMior6b8LrZrAhkqDjA
vUXRwm/fFKgpsOysxC6xi553CxBUCH2omNV6Ka1LNMwzSp9ILz8jEGqmUtkBszwo
G1S8fXgE0Lq3cdDM/GJ4QXP/p6LiwNF99faDMTV3+2SAOGvytOX6KjKVzKOSsfJQ
hN0DlsIw8hqJc0WISQQYEQIACQUCSedYRAIbDAAKCRDorT+BmrEOeCUOAJ9qmR0l
EXzeoxcdoafxqf6gZlJZlACgkWF7wi2YLW3Oa+jv2QSTlrx4KLM=
=Wi5D
-----END PGP PUBLIC KEY BLOCK-----
10) After copying and pasting the public key block press Crtl+D to end the input.
11) Compiling:
Code:
$ source build/envsetup.sh
Or:
Code:
$ . build/envsetup.sh
12) Issue:
Code:
$ lunch
13) Pick your poison.
14) Now issue:
Code:
$ make
15) Now just cross your fingers and hope it all works out!
16) Issue this command to create a flashable zip:
Code:
$ make otapackage
Or if you want to test on an emulator:
Code:
$ emulator
17) If all went well you can either run your build on an emulator or flash it on a device.
Code:
Please note that you have already selected your build target with lunch, and it is unlikely at best to run on a different target than it was built for.
~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 Hero CDMA)
2) Now navigate to the location you are going clone the device tree to:
Code:
$ cd WORKING_DIRECTORY/device
$ mkdir htc ; cd htc
3) Clone the github device tree from remote to local: (The heroc 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_heroc.git -b gingerbread heroc
4) Now navigate into the folder:
Code:
$ cd heroc
5) Connect phone to computer and enter this code:
Code:
$ ./extract-files.sh
6) Prepare To Compile:
Code:
$ source build/envsetup.sh
Or:
Code:
$ . build/envsetup.sh
7) Get your list of devices:
Code:
$ lunch
8) Pick your poison.
9) Now compile:
Code:
$ make
Or if you want a flashable zip:
Code:
$ make otapackage
I would like a tutorial on how to add devices. Either a generic one, or specifically the Desire S.
Cheers, peace
Sent from my HTC Desire S
chris5s said:
I would like a tutorial on how to add devices. Either a generic one, or specifically the Desire S.
Cheers, peace
Sent from my HTC Desire S
Click to expand...
Click to collapse
Tutorial added.
Good stuff. Plenty to keep me busy once I'm back from my hols
Thanks a million, so useful.
Sent from my HTC Desire S
chris5s said:
Good stuff. Plenty to keep me busy once I'm back from my hols
Thanks a million, so useful.
Sent from my HTC Desire S
Click to expand...
Click to collapse
You're quite welcome!
Sent from my Hero that never dies! ;D
if this post is still being kept up I could use some advice, when I go to edit WORKING_DIRECTORY/build/core/main.mk, there is no
ifneq (64,$(findstring 64,$(build_arch)))
....I did a search of the entire document and I scrolled through line-by-line. So I decided to try to go through and make some other simple configurations like on the Android.mk file under W_D/external/clearsilver/cgi and there were no LOCAL_LDFLAGS, instead LOCAL_LDLIBS and also LOCAL_CFLAGS output is:: LOCAL_CFLAGS := -fPIC ...verbatim from my document as is with no changes
lemonoid said:
if this post is still being kept up I could use some advice, when I go to edit WORKING_DIRECTORY/build/core/main.mk, there is no
ifneq (64,$(findstring 64,$(build_arch)))
....I did a search of the entire document and I scrolled through line-by-line. So I decided to try to go through and make some other simple configurations like on the Android.mk file under W_D/external/clearsilver/cgi and there were no LOCAL_LDFLAGS, instead LOCAL_LDLIBS and also LOCAL_CFLAGS output is:: LOCAL_CFLAGS := -fPIC ...verbatim from my document as is with no changes
Click to expand...
Click to collapse
I updated my repo, as I haven't in awhile, and looked at my main.mk and noticed the 32 bit warning is no longer there as well.
Hi can anyone shed any light on the following error:
build/core/base_rules.mk:102: *** user tag detected on new module - user tags are only supported on legacy modules. Stop.
Encountered after issuing make -otapackage command?
Using ubuntu 10.10, building for HTC Desire S.
Thanks
chris5s said:
Hi can anyone shed any light on the following error:
build/core/base_rules.mk:102: *** user tag detected on new module - user tags are only supported on legacy modules. Stop.
Encountered after issuing make -otapackage command?
Using ubuntu 10.10, building for HTC Desire S.
Thanks
Click to expand...
Click to collapse
Are you issuing
Code:
make -otapackage
Or
Code:
make otapackage
It should not have the hyphen in there.
dastin1015 said:
Are you issuing
Code:
make -otapackage
Or
Code:
make otapackage
It should not have the hyphen in there.
Click to expand...
Click to collapse
Only works with a hyphen. Without it I get an error about 'make'. Will try to replicate exact error when I'm back at th comp.
Sent from my HTC Desire S
chris5s said:
Only works with a hyphen. Without it I get an error about 'make'. Will try to replicate exact error when I'm back at th comp.
Sent from my HTC Desire S
Click to expand...
Click to collapse
I just installed Ubuntu to my external hard drive for my laptop so I'll follow my instructions and see if these instructions need to be updated.
Sent from my Hero that never dies! ;D
how would be the size of this repo sync ??
thanks.
cutiyar said:
how would be the size of this repo sync ??
thanks.
Click to expand...
Click to collapse
Not exactly sure, but it is significantly smaller than a Cyanogenmod repo sync.
dastin1015 said:
Not exactly sure, but it is significantly smaller than a Cyanogenmod repo sync.
Click to expand...
Click to collapse
thanks
can u just imagine it?
cutiyar said:
thanks
can u just imagine it?
Click to expand...
Click to collapse
I'd say about 4GB+ maybe. My Cyanogenmod source is about 6.8GB
ohhhhhh my god , very bad my internet is 25 kb/sec .
thanks.
i can get it like packages or torrent ?
thanks.
cutiyar said:
i can get it like packages or torrent ?
thanks.
Click to expand...
Click to collapse
No you can't. All updates are synced in with existing packages. I mean technically you could, but getting it would be pretty much impossible.
Good stuff man! I just got done doing this over the weekend on Mac OS X for evo. Glad to see someone posting aa guide like this for others.
tommytomatoe said:
Good stuff man! I just got done doing this over the weekend on Mac OS X for evo. Glad to see someone posting aa guide like this for others.
Click to expand...
Click to collapse
Thanks!
Sent from my Hero that never dies! ;D
To compile Ice Cream Sandwich on Ubuntu I'm going to first give you steps to set up your computer to get this thing rolling.
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 Ice Cream Sandwich. You can download it from java.sun.com. Or:
Code:
$ 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
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
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"
#ASUS
SUBSYSTEM=="usb", ATTR{idVendor}=="0b05", MODE="0666"
#Dell
SUBSYSTEM=="usb", ATTR{idVendor}=="413c", MODE="0666"
#Foxconn
SUBSYSTEM=="usb", ATTR{idVendor}=="0489", MODE="0666"
#Garmin-Asus
SUBSYSTEM=="usb", ATTR{idVendor}=="091E", MODE="0666"
#Google
SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", MODE="0666"
#HTC
SUBSYSTEM=="usb", ATTR{idVendor}=="0bb4", MODE="0666"
#Huawei
SUBSYSTEM=="usb", ATTR{idVendor}=="12d1", MODE="0666"
#K-Touch
SUBSYSTEM=="usb", ATTR{idVendor}=="24e3", MODE="0666"
#KT Tech
SUBSYSTEM=="usb", ATTR{idVendor}=="2116", MODE="0666"
#Kyocera
SUBSYSTEM=="usb", ATTR{idVendor}=="0482", MODE="0666"
#Lenevo
SUBSYSTEM=="usb", ATTR{idVendor}=="17EF", MODE="0666"
#LG
SUBSYSTEM=="usb", ATTR{idVendor}=="1004", MODE="0666"
#Motorola
SUBSYSTEM=="usb", ATTR{idVendor}=="22b8", MODE="0666"
#NEC
SUBSYSTEM=="usb", ATTR{idVendor}=="0409", MODE="0666"
#Nook
SUBSYSTEM=="usb", ATTR{idVendor}=="2080", MODE="0666"
#Nvidia
SUBSYSTEM=="usb", ATTR{idVendor}=="0955", MODE="0666"
#OTGV
SUBSYSTEM=="usb", ATTR{idVendor}=="2257", MODE="0666"
#Pantech
SUBSYSTEM=="usb", ATTR{idVendor}=="10A9", MODE="0666"
#Philips
SUBSYSTEM=="usb", ATTR{idVendor}=="0471", MODE="0666"
#PMC-Sierra
SUBSYSTEM=="usb", ATTR{idVendor}=="04da", MODE="0666"
#Qualcomm
SUBSYSTEM=="usb", ATTR{idVendor}=="05c6", MODE="0666"
#SK Telesys
SUBSYSTEM=="usb", ATTR{idVendor}=="1f53", MODE="0666"
#Samsung
SUBSYSTEM=="usb", ATTR{idVendor}=="04e8", MODE="0666"
#Sharp
SUBSYSTEM=="usb", ATTR{idVendor}=="04dd", MODE="0666"
#Sony Ericsson
SUBSYSTEM=="usb", ATTR{idVendor}=="0fce", MODE="0666"
#Toshiba
SUBSYSTEM=="usb", ATTR{idVendor}=="0930", MODE="0666"
#ZTE
SUBSYSTEM=="usb", ATTR{idVendor}=="19D2", 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.0.1_r1
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:
Code:
$ make -j1
~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 Hero CDMA)
2) Now navigate to the location you are going clone the device tree to:
Code:
$ cd WORKING_DIRECTORY/device
$ mkdir htc
3) Clone the github device tree from remote to local: (The heroc 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/TeamICS/android_device_htc_heroc.git heroc
4) Now navigate into the folder:
Code:
$ cd heroc
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 -j1
Or for a flashable zip:
Code:
$ make -j1 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.
Make and make -j1 is the same thing.
cdesai said:
Make and make -j1 is the same thing.
Click to expand...
Click to collapse
Quite aware, but since source has come out I've been working on this with others and from what we have seen 'make -j1' causes less errors than any other make command.
dastin1015 said:
Quite aware, but since source has come out I've been working on this with others and from what we have seen 'make -j1' causes less errors than any other make command.
Click to expand...
Click to collapse
Yea, it all depends on your machine
Also, maybe you can add this
AOSP source is synced at 4 jobs by default, and it is quite uncomfortable for people having a slow connection(makes it worse)
So, do this:
You need to edit the default.xml file
Its in WORKING_DIRECTORY/.repo/manifests/default.xml (notice the "." in front of repo)
You can edit it to change the default job no.:
Fire up Terminal
Copy/paste this:
Code:
gedit WORKING_DIRECTORY/.repo/manifests/default.xml
Change the default no. of jobs in this line
Code:
<default revision="refs/tags/android-4.0.1_r1"
remote="aosp"
[B][U]sync-j="4" />[/U][/B]
Change four to your preferred number.
Done!
You said 64bit recommended, does this mean 32bit will work? I thought gingerbread and newer REQUIRED 64bit.
When I attempt to add my device (inc or vigor) I am given an error that the source cannot be found. I checked the Github repo and found that only the Hero and Desire are listed there. How would I go about adding the device to /devices/htc myself?
lanternslight456 said:
You said 64bit recommended, does this mean 32bit will work? I thought gingerbread and newer REQUIRED 64bit.
Click to expand...
Click to collapse
32 bit will now work.
dmeadows013 said:
When I attempt to add my device (inc or vigor) I am given an error that the source cannot be found. I checked the Github repo and found that only the Hero and Desire are listed there. How would I go about adding the device to /devices/htc myself?
Click to expand...
Click to collapse
You need to use your own github source. You can use Cyanogenmod's because our TeamICS only supports Hero CDMA, Hero GSM, and Droid Eris.
dastin1015 said:
To compile Ice Cream Sandwich on Ubuntu I'm going to first give you steps to set up your computer to get this thing rolling.
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 Ice Cream Sandwich. You can download it from java.sun.com. Or:
Code:
$ 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
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
3) Configure your USB.
Code:
$ gksudo gedit /etc/udev/rules.d/51-android.rules
Inside of this blank text file insert:
For all HTC Models:
Code:
#Acer
SUBSYSTEM==usb, SYSFS{idVendor}==0502, MODE=0666
#ASUS
SUBSYSTEM==usb, SYSFS{idVendor}==0b05, MODE=0666
#Dell
SUBSYSTEM==usb, SYSFS{idVendor}==413c, MODE=0666
#Foxconn
SUBSYSTEM==usb, SYSFS{idVendor}==0489, MODE=0666
#Garmin-Asus
SUBSYSTEM==usb, SYSFS{idVendor}==091E, MODE=0666
#Google
SUBSYSTEM==usb, SYSFS{idVendor}==18d1, MODE=0666
#HTC
SUBSYSTEM=="usb", SYSFS{idVendor}=="0bb4", MODE="0666"
#Huawei
SUBSYSTEM==usb, SYSFS{idVendor}==12d1, MODE=0666
#K-Touch
SUBSYSTEM==usb, SYSFS{idVendor}==24e3, MODE=0666
#KT Tech
SUBSYSTEM==usb, SYSFS{idVendor}==2116, MODE=0666
#Kyocera
SUBSYSTEM==usb, SYSFS{idVendor}==0482, MODE=0666
#Lenevo
SUBSYSTEM==usb, SYSFS{idVendor}==17EF, MODE=0666
#LG
SUBSYSTEM==usb, SYSFS{idVendor}==1004, MODE=0666
#Motorola
SUBSYSTEM==usb, SYSFS{idVendor}==22b8, MODE=0666
#NEC
SUBSYSTEM==usb, SYSFS{idVendor}==0409, MODE=0666
#Nook
SUBSYSTEM==usb, SYSFS{idVendor}==2080, MODE=0666
#Nvidia
SUBSYSTEM==usb, SYSFS{idVendor}==0955, MODE=0666
#OTGV
SUBSYSTEM==usb, SYSFS{idVendor}==2257, MODE=0666
#Pantech
SUBSYSTEM==usb, SYSFS{idVendor}==10A9, MODE=0666
#Philips
SUBSYSTEM==usb, SYSFS{idVendor}==0471, MODE=0666
#PMC-Sierra
SUBSYSTEM==usb, SYSFS{idVendor}==04da, MODE=0666
#Qualcomm
SUBSYSTEM==usb, SYSFS{idVendor}==05c6, MODE=0666
#SK Telesys
SUBSYSTEM==usb, SYSFS{idVendor}==1f53, MODE=0666
#Samsung
SUBSYSTEM==usb, SYSFS{idVendor}==04e8, MODE=0666
#Sharp
SUBSYSTEM==usb, SYSFS{idVendor}==04dd, MODE=0666
#Sony Ericsson
SUBSYSTEM==usb, SYSFS{idVendor}==0fce, MODE=0666
#Toshiba
SUBSYSTEM==usb, SYSFS{idVendor}==0930, MODE=0666
#ZTE
SUBSYSTEM==usb, SYSFS{idVendor}==19D2, 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.0.1_r1
7) When prompted, please configure Repo with your real name and email address. To use the Gerrit code-review tool, you will need an email address that is connected with a registered Google account. Make sure this is a live address at which you can receive messages. The name that you provide here will show up in attributions for your code submissions.
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:
Code:
$ make
Please note that you have already selected your build target with lunch, and it is unlikely at best to run on a different target than it was built for.
~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 Hero CDMA)
2) Now navigate to the location you are going clone the device tree to:
Code:
$ cd WORKING_DIRECTORY/device
$ mkdir htc
3) Clone the github device tree from remote to local: (The heroc 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/TeamICS/android_device_htc_heroc.git heroc
4) Now navigate into the folder:
Code:
$ cd heroc
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 -j1
Or for a flashable zip:
Code:
$ make -j1 otapackage
Click to expand...
Click to collapse
First, thanks for gathering just about everything I needed in one place, I had gotten pretty far in the process on windows before I decided doing it in windows was a stupid idea..
When I ran this-- 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
I got back some errors, but I think these things were already loaded, or it was because I hadn't approved the sources..? Not sure, but I'm downloading the source now so it couldn't be THAT important(yet). I'm using ubuntu 11.10 if that helps at all.
At this point: 9) Compiling:
Code:
$ source build/envsetup.sh
Or:
Code:
$ . build/envsetup.sh
could I have done
Code:
$ repo init -u https://android.googlesource.com/platform/manifest -b android-4.0.1_r
and just be downloading ICS source? Because at the moment, it looks like it is downloading the source for all of the previous android source too.. isn't a bad thing, but I only made my partition 100gb in size because i was going to just work with ICS.
I'll probably go through this thread a little more throughly and do some other research while this download is going on-- thanks again for putting this thread together!
dastin1015 said:
32 bit will now work.
You need to use your own github source. You can use Cyanogenmod's because our TeamICS only supports Hero CDMA, Hero GSM, and Droid Eris.
Click to expand...
Click to collapse
Well the Vigor (Rezound) was just released, so it is not yet on the CM source. Do I need the kernel source to get what I need?
dmeadows013 said:
Well the Vigor (Rezound) was just released, so it is not yet on the CM source. Do I need the kernel source to get what I need?
Click to expand...
Click to collapse
You need more than the kernel. You need vendor files as well. Vendor files tell what your phones hardware is and how to build, etc. You usually get this from CM when they support your phone.
私のエボ3Dから送信される。
3) Clone the github device tree from remote to local: (The heroc 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.)
Click to expand...
Click to collapse
Ok, I'm looking for this, and I'm building for the htc glacier (mytouch 4g) I'm really new to this and looking for this on github. I've tried searching for glacier, mytouch 4g, mytouch, and several other derivatives and can't figure out what I'm supposed to find, it's mostly people's kernels. Can you give a little further guidance or clarification on this? For a new person to compiling from source. Thanks.
lanternslight456 said:
Ok, I'm looking for this, and I'm building for the htc glacier (mytouch 4g) I'm really new to this and looking for this on github. I've tried searching for glacier, mytouch 4g, mytouch, and several other derivatives and can't figure out what I'm supposed to find, it's mostly people's kernels. Can you give a little further guidance or clarification on this? For a new person to compiling from source. Thanks.
Click to expand...
Click to collapse
It's 4am where I'm at right now and I need some sleep and have class from noon to 4pm, but after that I will elaborate upon that.
私のエボ3Dから送信される。
lanternslight456 said:
Ok, I'm looking for this, and I'm building for the htc glacier (mytouch 4g) I'm really new to this and looking for this on github. I've tried searching for glacier, mytouch 4g, mytouch, and several other derivatives and can't figure out what I'm supposed to find, it's mostly people's kernels. Can you give a little further guidance or clarification on this? For a new person to compiling from source. Thanks.
Click to expand...
Click to collapse
Here you go:
https://github.com/CyanogenMod/android_device_htc_glacier
clone this to WORKING_DIRECTORY/device/htc/glacier (make the folder if it doesnt exist)
You'll need to tweak few things before you can successfully build, like tweaking the overlay for AOSP ICS
Package sun-java6-jdk has no installation candidate
I just had trouble to install the Sun Java6 JDK after updating to Ubuntu 10.04. The problem was that the system couldn’t find the package sun-java6-sdk and apt-get gave me the message:
Package sun-java6-jdk is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
E: Package sun-java6-jdk has no installation candidate
What I did to solve this problem was to add a new source
sudo add-apt-repository "deb http://archive.canonical.com/ lucid partner"
After that a normal
sudo apt-get update
sudo apt-get install sun-java6-jdk
I'm really sorry for the stupid question, but I can't seem to find the answer for this.
I'm using Ubuntu 11.10 64bit and I'm trying to get all the dependencies together so I can start playing. I already have all the repos in the default /etc/apt/sources.list enabled and get this feedback when I run
Code:
apt-get install lib32readline5-dev
Code:
Package lib32readline5-dev is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
However the following packages replace it:
lib32readline-gplv2-dev
E: Package 'lib32readline5-dev' has no installation candidate
My question is do I have to get the package "lib32readline5-dev" or can I use the replacement package that apt recommends "lib32readline-gplv2-dev".
This post seems to suggest that it will work but I just wanted to make sure before I cause a huge problem for myself.
http://forum.xda-developers.com/showpost.php?p=18631398&postcount=401
Also here is the package information from Ubuntu
http://packages.ubuntu.com/natty/lib32readline5-dev
http://packages.ubuntu.com/oneiric/lib32readline-gplv2-dev
they look like they do the same thing from the description.
Thanks for having patience and understanding with a N00b, and for all the work that you already put into this post, the information on this site is great.
--Sorrell
Sorrell said:
I'm really sorry for the stupid question, but I can't seem to find the answer for this.
I'm using Ubuntu 11.10 64bit and I'm trying to get all the dependencies together so I can start playing. I already have all the repos in the default /etc/apt/sources.list enabled and get this feedback when I run
Code:
apt-get install lib32readline5-dev
Code:
Package lib32readline5-dev is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
However the following packages replace it:
lib32readline-gplv2-dev
E: Package 'lib32readline5-dev' has no installation candidate
My question is do I have to get the package "lib32readline5-dev" or can I use the replacement package that apt recommends "lib32readline-gplv2-dev".
This post seems to suggest that it will work but I just wanted to make sure before I cause a huge problem for myself.
http://forum.xda-developers.com/showpost.php?p=18631398&postcount=401
Also here is the package information from Ubuntu
http://packages.ubuntu.com/natty/lib32readline5-dev
http://packages.ubuntu.com/oneiric/lib32readline-gplv2-dev
they look like they do the same thing from the description.
Thanks for having patience and understanding with a N00b, and for all the work that you already put into this post, the information on this site is great.
--Sorrell
Click to expand...
Click to collapse
You'd be fine using this:
Code:
$ sudo apt-get install lib32readline-gplv2-dev
I've been compiling without it and I've been fine, but I'm adding now.
Great, I think I`m ready to start breaking things now... lets hope I don't make my cappy useless.
cdesai said:
Here you go:
https://github.com/CyanogenMod/android_device_htc_glacier
clone this to WORKING_DIRECTORY/device/htc/glacier (make the folder if it doesnt exist)
You'll need to tweak few things before you can successfully build, like tweaking the overlay for AOSP ICS
Click to expand...
Click to collapse
do ypu know where to find the htc leo one? thank
cuzzo94 said:
do ypu know where to find the htc leo one? thank
Click to expand...
Click to collapse
http://github.com/CyanogenMod/android_device_htc_leo
私のエボ3Dから送信される。
i set up everything using your guide but i get an error when trying to build! see the screenhot!
{
"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"
}
NOTICE: I'm beginning to see this tutorial on numerous other sites. I'm fine with it being posted on other sites, as long as I am given credit and have your thread point back to here for the pieces that I have specifically written. I do not condone near verbatim or verbatim copy and pasting of my work or others work without credit. Please give credit where credit is due. Thank you.
07-17-12: I have not, nor shall I ever claim copyright.
To compile Jellybean on Ubuntu I'm going to first give you steps to set up your computer to get this thing rolling.
You MUST be running a 64 bit version of Ubuntu, 32 bit is not supported.
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.
READ the entire OP and make sure to properly follow instructions. Don't forget to search the thread as your question may have already been answered.
Please use Pastebin for all errors you run into. Posting a link is much easier than a long list of errors in the thread. Thank you.
You will need 25GB (or more) 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.
Code:
$ sudo apt-get install openjdk-6-jdk
-Python, which you can download from python.org. Or:
Code:
$ sudo apt-get install python
-Git, which 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.
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
On Ubuntu 10.10:
Code:
$ sudo ln -s /usr/lib32/mesa/libGL.so.1 /usr/lib32/mesa/libGL.so
On Ubuntu 11.10:
Code:
$ sudo apt-get install libx11-dev:i386
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 gnupg flex bison gperf build-essential \
zip curl libc6-dev libncurses5-dev x11proto-core-dev \
libx11-dev libreadline6-dev libgl1-mesa-glx \
libgl1-mesa-dev g++-multilib mingw32 tofrodos \
python-markdown libxml2-utils xsltproc zlib1g-dev
$ 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"
#ASUS
SUBSYSTEM=="usb", ATTR{idVendor}=="0b05", MODE="0666"
#Dell
SUBSYSTEM=="usb", ATTR{idVendor}=="413c", MODE="0666"
#Foxconn
SUBSYSTEM=="usb", ATTR{idVendor}=="0489", MODE="0666"
#Garmin-Asus
SUBSYSTEM=="usb", ATTR{idVendor}=="091E", MODE="0666"
#Google
SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", MODE="0666"
#HTC
SUBSYSTEM=="usb", ATTR{idVendor}=="0bb4", MODE="0666"
#Huawei
SUBSYSTEM=="usb", ATTR{idVendor}=="12d1", MODE="0666"
#K-Touch
SUBSYSTEM=="usb", ATTR{idVendor}=="24e3", MODE="0666"
#KT Tech
SUBSYSTEM=="usb", ATTR{idVendor}=="2116", MODE="0666"
#Kyocera
SUBSYSTEM=="usb", ATTR{idVendor}=="0482", MODE="0666"
#Lenevo
SUBSYSTEM=="usb", ATTR{idVendor}=="17EF", MODE="0666"
#LG
SUBSYSTEM=="usb", ATTR{idVendor}=="1004", MODE="0666"
#Motorola
SUBSYSTEM=="usb", ATTR{idVendor}=="22b8", MODE="0666"
#NEC
SUBSYSTEM=="usb", ATTR{idVendor}=="0409", MODE="0666"
#Nook
SUBSYSTEM=="usb", ATTR{idVendor}=="2080", MODE="0666"
#Nvidia
SUBSYSTEM=="usb", ATTR{idVendor}=="0955", MODE="0666"
#OTGV
SUBSYSTEM=="usb", ATTR{idVendor}=="2257", MODE="0666"
#Pantech
SUBSYSTEM=="usb", ATTR{idVendor}=="10A9", MODE="0666"
#Philips
SUBSYSTEM=="usb", ATTR{idVendor}=="0471", MODE="0666"
#PMC-Sierra
SUBSYSTEM=="usb", ATTR{idVendor}=="04da", MODE="0666"
#Qualcomm
SUBSYSTEM=="usb", ATTR{idVendor}=="05c6", MODE="0666"
#SK Telesys
SUBSYSTEM=="usb", ATTR{idVendor}=="1f53", MODE="0666"
#Samsung
SUBSYSTEM=="usb", ATTR{idVendor}=="04e8", MODE="0666"
#Sharp
SUBSYSTEM=="usb", ATTR{idVendor}=="04dd", MODE="0666"
#Sony Ericsson
SUBSYSTEM=="usb", ATTR{idVendor}=="0fce", MODE="0666"
#Toshiba
SUBSYSTEM=="usb", ATTR{idVendor}=="0930", MODE="0666"
#ZTE
SUBSYSTEM=="usb", ATTR{idVendor}=="19D2", 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
6a) For AOSP:
Code:
$ repo init -u https://android.googlesource.com/platform/manifest -b android-4.2.2_r1.2
For CM:
Code:
$ repo init -u git://github.com/CyanogenMod/android.git -b cm-10.1
6.1) For people who have already done a repo init:
Code:
$ cd WORKING_DIRECTORY
AOSP:
Code:
$ repo init -b android-4.3_r2
$ repo sync
CM:
Code:
$ repo init -b cm-10.1
$ repo sync
7) When prompted, enter your real name and email address.
8) Gather the files:
Code:
$ repo sync
9) Continue onto adding a device
~How To Add A Device To The List~
1) Find the github for your device you wish to add. (For me it is the Samsung Epic 4G Touch [codename d710])
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 name after the branch 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_samsung_d710.git -b cm-10.1 d710
4) Now navigate into the folder:
Code:
$ cd d710
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
Or:
Code:
./proprietary-files.sh
Or: See if other repos have your device's proprietary blobs already (like d710):
Code:
$ ~/WORKING_DIRECTORY
$ mkdir vendor
$ git clone https://github.com/TheMuppets/proprietary_vendor_samsung -b cm-10.2 samsung
6.1) Some devices have other dependencies like a common device repo. The d710 utilizes a galaxys2-common repo for the galaxys2 family of devices. Clone that repo. From inside the d710 folder:
Code:
$ cd ..
$ git clone git://github.com/CyanogenMod/android_device_samsung_galaxys2-common.git -b cm-10.1 galaxys2-common
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 ('#' being the number of cores in your processor +1):
Code:
$ make -j#
12) Speed up builds using ccache (optional, but highly recommended):
Edit your .bashrc and add this line at the bottom:
Code:
export USE_CCACHE=1
Then issue these commands:
Code:
$ export USE_CCACHE=1
$ export CCACHE_DIR=~/.ccache
$ prebuilts/misc/linux-x86/ccache/ccache -M 50G
The suggested cache size is 50-100G. (This is size in GB)
Or for a flashable zip:
Code:
$ make -j# otapackage
~FIXES~
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_d710". Stop.
Device d710 not found. Attempting to retrieve device repository from CyanogenMod Github (http://github.com/CyanogenMod).
Repository for d710 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_d710". Stop.
** Don't have a product spec for: 'full_d710'
** 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_d710.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.
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------
If you run into issues with Java being the incorrect version here is the fix:
Make sure Java 6 JDK is installed by typing in:
Code:
$ java -version
Open the file main.mk in build/core and delete this line from the java error code section:
Code:
$(error stop)
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Change all references in your device repo from frameworks/base to frameworks/native
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Apply this patch for guava: https://github.com/CyanogenMod/andr...mmit/c8b97210aa31c9b80b5fd136d8617ebe4e731e09
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Android 4.1+ needs an insecure kernel to use adb: http://forum.xda-developers.com/showthread.php?t=1687590
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------
This tutorial is based off this one: http://source.android.com/index.html
Most excellent! Thank you for the quick post after the source drop!
p011uX said:
Most excellent! Thank you for the quick post after the source drop!
Click to expand...
Click to collapse
You're quite welcome!
O.O This is new? I'm at the right time and at the right place...
And what if we don't already have a working device tree? I want to try to get SOMETHING running on my T-Mo GS3, just to see how this all works and maybe contribute to the community.
brfield said:
And what if we don't already have a working device tree? I want to try to get SOMETHING running on my T-Mo GS3, just to see how this all works and maybe contribute to the community.
Click to expand...
Click to collapse
You have a device tree: https://github.com/CyanogenMod/android_device_samsung_i9300
dastin1015 said:
You have a device tree: https://github.com/CyanogenMod/android_device_samsung_i9300
Click to expand...
Click to collapse
That's for the international, I am on the T-Mo version, aka the U.S.A variant.
brfield said:
That's for the international, I am on the T-Mo version, aka the U.S.A variant.
Click to expand...
Click to collapse
It would essentially be modifications of the international version with changed files to be for T-Mobile, but I don't know the specifics because I don't create device repos from scratch.
dastin1015 said:
It would essentially be modifications of the international version with changed files to be for T-Mobile, but I don't know the specifics because I don't create device repos from scratch.
Click to expand...
Click to collapse
Thanks for the help. I'll look into it later.
Can we use the ICS device tree for our device? If this is a stupid question feel free to tell me as I know very little about device trees
Sent by my Robot Butler
Supermaster34 said:
Can we use the ICS device tree for our device? If this is a stupid question feel free to tell me as I know very little about device trees
Sent by my Robot Butler
Click to expand...
Click to collapse
Initially yes, but things will have to be modified to make things work.
私のEVO 3Dから送信される。
Na, the US versions got a S4, and the international s3 has an exynos.
Totally different.
Also, might wanna move some stuff to spoliers, just to make scrolling easier.
And, using android-4.1.1_r1 branch for the init would be better than using jb-dev.
2nd page.. I take it.
E=MC420
cdesai said:
[snip]
And, using android-4.1.1_r1 branch for the init would be better than using jb-dev.
Click to expand...
Click to collapse
JBQ actually recommends building from the tag as opposed to the branch.
Code:
repo init -u https://android.googlesource.com/platform/manifest -b refs/tags/android-4.1.1_r1
repo sync
For people who have already done a repo init:
Code:
cd /path/to/AndroidTree
repo init -b refs/tags/android-4.1.1_r1
repo sync
What Ubuntu Version are you working with?
I heard 10.04 should bring the best results, so I installed that one..
but before I had 12.04 and the experience there is a lot better.. Anyone compiling on 12.04 without problems?
is there anything wrong when just building from master?
I don't believe master is synced with JB...but I very well could be wrong on that.
thanks a lot for this.
wich ubuntu is the best for this?
make otapackage help
So I've tried before to get an AOSP Rom working for my phone (the HTC One XL) but I kept getting this error when I try to do a make otapackage:
make: *** No rule to make target `otapackage'. Stop.
I'm getting that again for JB.
Any help?
---------- Post added at 09:58 AM ---------- Previous post was at 09:57 AM ----------
pnda said:
thanks a lot for this.
wich ubuntu is the best for this?
Click to expand...
Click to collapse
10.04 is still what Google uses in-house so its probably the best.
That's most likely because you did not do:
Code:
source build/envsetup.sh
First of all, let me clear myself what I am describing here is a simplified version is what Google provided in their Building Android from Source, So I am not taking any copyright issue or anything you are going to do with this guide. U can use this guide and make a ROM. And if you think it's worthwhile to give credit to this thread, give link to this thread. I don't mind if you don't give credit to this thread, atleast you are making better android development.
What is this thread for?
- This is the thread which will guide you about how to setup environment for building an android from source. Feel free to ask question regarding it. You also can copy paste your error (if it’s short) or attach log cat (weather in .text file or from pastebin). I will try to solve any many errors as I can, but come on I CANNOT solve every errors you ran into.
Requirement
- Though this thread is noob friendly, for sure you require basic computer knowledge especially regarding Ubuntu setup and basic command prompt.
- You should have install Ubuntu 64-bit version (32-bit version is not supported) to your computer either in virtual machine or as separate Operating System.
- For Ubuntu you require minimum 80 GB of space to compile a single build from source.
- I think I made myself clear about requirements.
- This might not build fully working ROM and you may have to do some changes according to it.
Disclaimers
I am not responsible for any broken PCs or damaged hard drive or anything unexpected and unfortunate happen to your computer or to your device. You are doing everything by knowing all the risks, so don’t blame on me about anything.
INDEX of Topics I am describing here
Post – 1: Setting up build environment
Post – 2: Install and Initialise repo
Post – 3: Setup device for specific build
Post – 4: Device specific vendor changes
Post - 5: Repo optimization and speed up build environment
Post – 6: reserve for future use
Post – 7: reserve for future use.
Now, Let’s start with real stuff …..
{
"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"
}
1A. Install JDK 6
Code:
sudo apt-get install openjdk-6-jdk
1B. Install python
Code:
sudo apt-get install python
1C. Install git-core
Code:
sudo apt-get install git-core
1D. Install android SDK- Download it: http://developer.android.com/sdk/index.html
- Extract it to your home directory and rename it to android-sdk
- At home press ctrl+h to see hidden files and folder
- Open .bashrc file with text editor
- Add following lines at the end of it
Code:
# Android tools
export PATH=${PATH}:~/android-sdk/tools
export PATH=${PATH}:~/android-sdk/platform-tools
export PATH=${PATH}:~/bin
- Go to your home folder and open .profile file with text editor
- Add following lines at the bottom of that page
Code:
PATH="$HOME/android-sdk/tools:$HOME/android-sdk/platform-tools:$PATH"
- Now you have successfully install android-SDK
- To check its installed correctly, open a new Terminal and type
Code:
android
- It will open a window with android-sdk
1E: Install required packages- For all Ubuntu
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
- On Ubuntu 10.10
Code:
sudo ln -s /usr/lib32/mesa/libGL.so.1 /usr/lib32/mesa/libGL.so
- On Ubuntu 11.10
Code:
sudo apt-get install libx11-dev:i386
- On Ubuntu 12.04 & 12.10
Code:
sudo apt-get install git gnupg flex bison gperf build-essential \
zip curl libc6-dev libncurses5-dev x11proto-core-dev \
libx11-dev libreadline6-dev libgl1-mesa-glx \
libgl1-mesa-dev g++-multilib mingw32 tofrodos \
python-markdown libxml2-utils xsltproc zlib1g-dev
sudo ln -s /usr/lib/i386-linux-gnu/mesa/libGL.so.1 /usr/lib/i386-linux-gnu/libGL.so
- On Ubuntu 13.04
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
sudo ln -s /usr/lib/i386-linux-gnu/mesa/libGL.so.1 /usr/lib/i386-linux-gnu/libGL.so
1F: Configure USB - create 51-android.rules
Code:
gksudo gedit /etc/udev/rules.d/51-android.rules
- It will open up an empty file names 51-android.rules, copy paste all of following in that file, save it and close
Code:
#Acer
SUBSYSTEM=="usb", ATTR{idVendor}=="0502", MODE="0666"
#ASUS
SUBSYSTEM=="usb", ATTR{idVendor}=="0b05", MODE="0666"
#Dell
SUBSYSTEM=="usb", ATTR{idVendor}=="413c", MODE="0666"
#Foxconn
SUBSYSTEM=="usb", ATTR{idVendor}=="0489", MODE="0666"
#Garmin-Asus
SUBSYSTEM=="usb", ATTR{idVendor}=="091E", MODE="0666"
#Google
SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", MODE="0666"
#HTC
SUBSYSTEM=="usb", ATTR{idVendor}=="0bb4", MODE="0666"
#Huawei
SUBSYSTEM=="usb", ATTR{idVendor}=="12d1", MODE="0666"
#K-Touch
SUBSYSTEM=="usb", ATTR{idVendor}=="24e3", MODE="0666"
#KT Tech
SUBSYSTEM=="usb", ATTR{idVendor}=="2116", MODE="0666"
#Kyocera
SUBSYSTEM=="usb", ATTR{idVendor}=="0482", MODE="0666"
#Lenevo
SUBSYSTEM=="usb", ATTR{idVendor}=="17EF", MODE="0666"
#LG
SUBSYSTEM=="usb", ATTR{idVendor}=="1004", MODE="0666"
#Motorola
SUBSYSTEM=="usb", ATTR{idVendor}=="22b8", MODE="0666"
#NEC
SUBSYSTEM=="usb", ATTR{idVendor}=="0409", MODE="0666"
#Nook
SUBSYSTEM=="usb", ATTR{idVendor}=="2080", MODE="0666"
#Nvidia
SUBSYSTEM=="usb", ATTR{idVendor}=="0955", MODE="0666"
#OTGV
SUBSYSTEM=="usb", ATTR{idVendor}=="2257", MODE="0666"
#Pantech
SUBSYSTEM=="usb", ATTR{idVendor}=="10A9", MODE="0666"
#Philips
SUBSYSTEM=="usb", ATTR{idVendor}=="0471", MODE="0666"
#PMC-Sierra
SUBSYSTEM=="usb", ATTR{idVendor}=="04da", MODE="0666"
#Qualcomm
SUBSYSTEM=="usb", ATTR{idVendor}=="05c6", MODE="0666"
#SK Telesys
SUBSYSTEM=="usb", ATTR{idVendor}=="1f53", MODE="0666"
#Samsung
SUBSYSTEM=="usb", ATTR{idVendor}=="04e8", MODE="0666"
#Sharp
SUBSYSTEM=="usb", ATTR{idVendor}=="04dd", MODE="0666"
#Sony Ericsson
SUBSYSTEM=="usb", ATTR{idVendor}=="0fce", MODE="0666"
#Toshiba
SUBSYSTEM=="usb", ATTR{idVendor}=="0930", MODE="0666"
#ZTE
SUBSYSTEM=="usb", ATTR{idVendor}=="19D2", MODE="0666"
- After that issue following command to make it executable when it is necessary
Code:
sudo chmod a+r /etc/udev/rules.d/51-android.rules
This is done for the part of setting up building environment.
Now go to next post
Repository Fetching
2A: Setup repo
Code:
mkdir ~/bin
PATH=~/bin:$PATH
curl [url]https://dl-ssl.google.com/dl/googlesource/git-repo/repo[/url] > ~/bin/repo
chmod a+x ~/bin/repo
2B: Initialize the repo:
Code:
mkdir WORKING_DIRECTORY
cd WORKING_DIRECTORY
2C: Source specific repo command:
For AOSP 4.2.2:
Code:
repo init -u [url]https://android.googlesource.com/platform/manifest[/url] -b android-4.2.2_r1.2
For CM Select either cm-10.1/10.2)
Code:
repo init -u git://github.com/CyanogenMod/android.git -b cm-10.1/cm-10.2
For PAC-man: (Select either cm-10.1/10.2)
Code:
repo init -u git://github.com/PAC-man/android.git -b cm-10.2/cm-10.1
For AOKP: (Select either jb-mr1/jb-mr2)
Code:
repo init -u https://github.com/AOKP/platform_manifest.git -b jb-mr2/jb-mr1
For PA: 4.3
Code:
repo init -u [email protected]:ParanoidAndroid/manifest.git -b jb43
For slimroms: 4.2
Code:
repo init -u git://github.com/SlimRoms/platform_manifest.git -b jb4.2
For MoKee OpenSource: 4.2
Code:
repo init -u https://github.com/MoKee/android.git -b jb-mr1_mkt
2D: When prompted, enter your real name and email address.
2E: Sync Repo from remote to local
Code:
repo sync
This will take times as it will download all source from github to your computer it depend on your internet connection that how long it will take from anywhere around 30 minutes(If you have 4 mbps download speed) to 30 days(If you have 30kbps download speed).
2F: Continue next to device specific section
Xperia X10 specific device tree modifications
So, now you will have to add device tree and dependencies to local repo...
For that you have to copy sources from github to local directory and also device's repository
Let's start with it... (I am describing here how to setup device tree for cm10.1 from CMX10 repositories)
3A: Add Device tree and dependency for cm10.1
- Go to your working directory and press ctrl+h - You will see .repo directory
- Open .repo and there make a folder named local_manifests
- In .repo/local_manifests right click and make a new document and name it to roomservice.xml and type this :
Code:
<?xml version="1.0" encoding="UTF-8"?>
<manifest>
#Add hardware from Evervolv sources
<project path="hardware/qcom/display-legacy" name="Evervolv/android_hardware_qcom_display-legacy" revision="jellybean" />
<project path="hardware/qcom/gps-legacy" name="Evervolv/android_hardware_qcom_gps-legacy" revision="jellybean" />
#Add sources from CMX10 repo
<project path="hardware/atheros/wifi/libs" name="CMX10/android_hardware_atheros_wifi_libs" revision="cm-10.1" />
<project path="hardware/sony/DASH" name="CyanogenMod/android_hardware_sony_DASH" revision="cm-10.1" />
<project name="CMX10/android_device_semc_es209ra" path="device/semc/es209ra" revision="cm10.1" />
<project name="CMX10/proprietary_es209ra" path="vendor/semc/es209ra" revision="jellybean" />
<project name="CMX10/android_kernel_semc_es209ra" path="kernel/semc/es209ra" revision="master" />
</manifest>
- After copying this sources you have to sync repo
Code:
cd WORKING_DIRECTORY
repo sync
- You will not need any vendor specific changes for cm10.1 you can directly go to the step 3F for next instruction...
3B: Editing source for slimroms
- Finish steps of 3A than we have to edit some details in device/semc/es209ra in local directory
- go to device/semc/es209ra and rename cm.mk file to slim.mk
- now open slim.mk file with text editor select all and copy paste following details:
Code:
## Specify phone tech before including full_phone
$(call inherit-product, vendor/slim/config/gsm.mk)
# Inherit some common slimrom stuff.
$(call inherit-product, vendor/slim/config/common_full_phone.mk)
# Inherit device configuration
$(call inherit-product, device/semc/es209ra/full_es209ra.mk)
# Boot Animation
TARGET_SCREEN_HEIGHT := 854
TARGET_SCREEN_WIDTH := 480
# Release name
PRODUCT_RELEASE_NAME := X10i
## Device identifier. This must come after all inclusions
PRODUCT_DEVICE := es209ra
PRODUCT_NAME := slim_es209ra
#Set build fingerprint / ID / Product Name ect.
PRODUCT_BUILD_PROP_OVERRIDES += PRODUCT_NAME=LT18i BUILD_FINGERPRINT="SEMC/LT18i_1254-2184/LT18i:4.0.4/4.1.B.0.431/UL5_3w:user/release-keys" PRIVATE_BUILD_DESC="LT18i-user 4.0.4 4.1.B.0.431 UL5_3w test-keys"
- You also have to edit dependency file for slimrom
- Rename cm.dependencies to slim.dependencies, open it with text editor, select all and copy paste following details
Code:
[
{
"repository": "SlimRoms/hardware_libhardware_legacy",
"target_path": "hardware/libhardware_legacy",
"branch": "jellybean" [COLOR="Red"]<<< change branch according to your android version[/COLOR]
}
]
- Now go to the next post for editing vendor source....
3C: Editing source for aokp
- Find of championswimmer's aokp source tree for aokp manifestations
- He has all working tree for x10..
- If you need any further help for aokp, ask here...
3D: Editing source for MoKee OpenSource
- Finish steps of 3A than we have to edit some details in device/semc/es209ra in local directory
- go to device/semc/es209ra and rename cm.mk file to mokee.mk
- now open mokee.mk file with text editor select all and copy paste following details:
Code:
## Specify phone tech before including full_phone
$(call inherit-product, vendor/mk/config/gsm.mk)
# Inherit some common MoKee stuff.
$(call inherit-product, vendor/mk/config/common_full_phone.mk)
# Inherit device configuration
$(call inherit-product, device/semc/es209ra/full_es209ra.mk)
# Boot Animation
TARGET_SCREEN_HEIGHT := 854
TARGET_SCREEN_WIDTH := 480
# Release name
PRODUCT_RELEASE_NAME := X10i
## Device identifier. This must come after all inclusions
PRODUCT_DEVICE := es209ra
PRODUCT_NAME := mk_es209ra
#Set build fingerprint / ID / Product Name ect.
PRODUCT_BUILD_PROP_OVERRIDES += PRODUCT_NAME=LT18i BUILD_FINGERPRINT="SEMC/LT18i_1254-2184/LT18i:4.0.4/4.1.B.0.431/UL5_3w:user/release-keys" PRIVATE_BUILD_DESC="LT18i-user 4.0.4 4.1.B.0.431 UL5_3w test-keys"
- Not done yet, Now go to next post for vendor specific changes
3E: Editing source for Paranoid Android and PAC-man
- For Paranoid android you will need some extensive changes in vendor files, just finish step 3A and go to next step for vendor specific changes.
- No any device tree changes needed for PA and PAC-man
- If you want any other custom rom device tree, post github source code here and I will try to edit source for you and add it here
3F: Compilation of Rom
- Now actual compilation start - Let's start
Code:
cd WORKING_DIRECTORY
. build/envsetup.sh
lunch
- Select your combo for cm it should be cm_es209ra-userdebug write appropriate number and than press Enter
- Than start building
Code:
make -j4
make otapackage -j4
- Here the number after -j indicates core of your PC+1 if you have 3 core pc you can use -j4
- Once you finish all the process you will find flashable zip in your out directory
Vendor tree modification for Xperia X10
- All vendor setup will be made to the local directory in your WORKING_DIRECTORY/Vendor
4A: Slimroms Vendor Setup
- Go to vendor/slim to your local directory
- Here you only need to edit one file and that file is vendorsetup.sh
- Open vendorsetup.sh with text editor and just add this line to the end of the file
Code:
add_lunch_combo slim_es209ra-userdebug
- Save file and you are ready to go with Step 3F
4B: Vendor Setup for MoKee OpenSource
- Go to vendor/mk to your local directory
- Here you have to edit 1 file and that file is mokee-build-targets
- Open mokee-build-targets with text editor and just add this line to the end of the file
Code:
mk_es209ra-userdebug
- Save file and you are ready to go with Step 3F
4C: Vendor Setup For Paranoid Android
- Go to vendor/pa to your local directory
- Here you need to edit files in packages, Products, vendorprops and vendorsetup.sh
Step-1
So, First we are going to add file in vendor/pa/packages, so go to vendor/pa/packages
- Here we are adding torch to our package
- Right click and create a blank document and name it as es209ra.mk and copy paste this content.
Code:
# Extra packages
PRODUCT_PACKAGES += \
Torch
Step 2
Now go to vendor/pa/products
- Here we have to add product file for our device
- Open AndroidProducts.mk file with text editor and following lines at the end
Code:
ifeq (pa_es209ra,$(TARGET_PRODUCT))
PRODUCT_MAKEFILES += $(LOCAL_DIR)/pa_es209ra.mk
endif
- Right click and create a blank document and name it as pa_es209ra.mk
- Copy Paste following details in that file
Code:
# Copyright (C) 2012 ParanoidAndroid Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# Check for target product
ifeq (pa_es209ra,$(TARGET_PRODUCT))
# Define PA bootanimation size
PARANOID_BOOTANIMATION_NAME := HDPI
# OVERLAY_TARGET adds overlay asset source
OVERLAY_TARGET := pa_hdpi
# Build paprefs from sources
PREFS_FROM_SOURCE ?= false
# Include ParanoidAndroid common configuration
include vendor/pa/config/pa_common.mk
# Inherit AOSP device configuration
$(call inherit-product, device/semc/es209ra/full_es209ra.mk)
# Product Package Extras
-include vendor/pa/packages/es209ra.mk
# Override AOSP build properties
PRODUCT_NAME := pa_es209ra
PRODUCT_BRAND := semc
PRODUCT_MODEL := es209ra
PRODUCT_MANUFACTURER := Sony Ericsson
PRODUCT_BUILD_PROP_OVERRIDES += PRODUCT_NAME=LT18i BUILD_FINGERPRINT="SEMC/LT18i_1254-2184/LT18i:4.0.4/4.1.B.0.431/UL5_3w:user/release-keys" PRIVATE_BUILD_DESC="LT18i-user 4.0.4 4.1.B.0.431 UL5_3w test-keys"
# Update local_manifest.xml
GET_VENDOR_PROPS := $(shell vendor/pa/tools/getvendorprops.py $(PRODUCT_NAME))
GET_PROJECT_RMS := $(shell vendor/pa/tools/removeprojects.py $(PRODUCT_NAME))
GET_PROJECT_ADDS := $(shell vendor/pa/tools/addprojects.py $(PRODUCT_NAME))
endif
Step 3
- Edit vendosetup.sh file
- Go to vendor/pa and vendorsetup.sh with text editor
- Copy Paste followinfg lines at the end of that file
Code:
add_lunch_combo pa_es209ra-userdebug
- Now you are ready to go with step 3F
4D: Vendor Setup For PAC-Man
- Here we have to edit files in vendor/pac
- We have to edit files of products and vendorsetup.sh
Step 1
- Go to vendor/pac/products
- Right click and create blank document and name it as pac_es209ra.mk
- Copy paste following content to that file
Code:
# Check for target product
ifeq (pac_es209ra,$(TARGET_PRODUCT))
# OVERLAY_TARGET adds overlay asset source
OVERLAY_TARGET := pa_hdpi
# PAC device overlay
PRODUCT_PACKAGE_OVERLAYS += vendor/pac/overlay/pac/hdpi_480x800
$(shell cp -f vendor/pac/prebuilt/common/bootanimation_framework/android-logo-mask_sony-hdpi.png frameworks/base/core/res/assets/images/android-logo-mask.png)
# PAC boot logo
PRODUCT_COPY_FILES += \
vendor/pac/prebuilt/common/bootlogo/pac_logo_480x800.rle:root/logo.rle
# Copy bootanimation
PRODUCT_COPY_FILES += \
vendor/pac/prebuilt/hdpi/bootanimation.zip:system/media/bootanimation.zip
# include PAC common configuration
include vendor/pac/config/pac_common.mk
# Inherit CM device configuration
$(call inherit-product, device/semc/es209ra/cm.mk)
PRODUCT_NAME := pac_es209ra
# Update local_manifest.xml
GET_PROJECT_RMS := $(shell vendor/pac/tools/removeprojects.py $(PRODUCT_NAME))
GET_PROJECT_ADDS := $(shell vendor/pac/tools/addprojects.py $(PRODUCT_NAME))
Step 2
- Edit vendosetup.sh file
- Go to vendor/pa and vendorsetup.sh with text editor
- Copy Paste followinfg lines at the end of that file
Code:
# Xperia 2010
add_lunch_combo pac_es209ra-userdebug
- Now you are ready to go with step 3F
Build optimization for all device
Speed up builds using ccache (optional, but highly recommended)
- Edit your .bashrc and add this line at the bottom:
Code:
export USE_CCACHE=1
- Then issue these commands from terminal
Code:
$ export USE_CCACHE=1
$ export CCACHE_DIR=~/.ccache
$ prebuilts/misc/linux-x86/ccache/ccache -M 50G
- The suggested cache size is 50-100G. (This is size in GB)
- This will decrease time of compiling and improve speed.
post - 6 i am in need of this buddy dont post
Post 7 - this one is mine too u can have your post now
This is awesome!!!
sent from a SHOCKINGLY buttery smooth TOUCHWIZ rom.
z28tovette said:
This is awesome!!!
sent from a SHOCKINGLY buttery smooth TOUCHWIZ rom.
Click to expand...
Click to collapse
just helping out for development here
Thanks my friend
Envoyé depuis mon Xperia X10
thanks for this wonderful tut
and will u release any awesome rom like what u've done before?:victory:
great guide thank you very much and maybe u can make a kernel making guide too
Leo said:
thanks for this wonderful tut
and will u release any awesome rom like what u've done before?:victory:
Click to expand...
Click to collapse
I wish, But as i don't have device, I don't want to make any blind build which might brick some tester's device...
If I get device, sure I will release one...
Buda1996 said:
great guide thank you very much and maybe u can make a kernel making guide too
Click to expand...
Click to collapse
I have to collect some tools for x10 kernel making like ftf tools and stuff and on top of it, I don't have device
So I will see how it goes
Such a nice share/work ...and very useful THANKS a lot for that bro =)
I had error "Cannot fetch galaxyfreak/android_frameworks_native"
Init curl commondatastorage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
NOTICE: I'm fine with this tutorial being posted on other sites, as long as I am given credit and have your thread point back to here for the pieces that I have specifically written. I do not condone near verbatim or verbatim copy and pasting of my work or others work without credit. Please give credit where credit is due. Thank you.
07-17-12: I have not, nor shall I ever claim copyright.
To compile Lollipop on Ubuntu I'm going to first give you steps to set up your computer to get this thing rolling.
You MUST be running a 64 bit version of Ubuntu, 32 bit is not supported.
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.
READ the entire OP and make sure to properly follow instructions. Don't forget to search the thread as your question may have already been answered.
Please use Pastebin for all errors you run into. Posting a link is much easier than a long list of errors in the thread. Thank you.
Source is roughly 8.5GB in size and you will need over 30GB (or more) free to complete a single build, and up to 100GB (or more) for a full set of builds.
1) You need the following:
-JDK 7 if you wish to build Lollipop.
Code:
$ sudo apt-get update
$ sudo apt-get install openjdk-7-jdk
Optionally, update the default Java version by running:
Code:
$ sudo update-alternatives --config java
$ sudo update-alternatives --config javac
If you encounter version errors for Java, then it could be:
Failing to install the correct JDK
Another JDK previously installed appearing in your path. Prepend the correct JDK to the beginning of your PATH or remove the problematic JDK
-Python, which you can download from python.org. Or:
Code:
$ sudo apt-get install python
-Git, which 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) Installing required packages (Ubuntu 13.04+)
Code:
$ sudo apt-get install git-core gnupg flex bison gperf build-essential \
zip curl zlib1g-dev zlib1g-dev:i386 libc6-dev lib32ncurses5-dev lib32z1 \
lib32ncurses5 lib32bz2-1.0 x11proto-core-dev libx11-dev:i386 libreadline6-dev:i386 \
lib32z1-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 lzop
$ sudo ln -s /usr/lib/i386-linux-gnu/mesa/libGL.so.1 /usr/lib/i386-linux-gnu/libGL.so
Installing required packages (Ubuntu 12.04)
Code:
$ sudo apt-get install git 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 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
Installing required packages (Ubuntu 10.04 -- 11.10)
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
On Ubuntu 10.10:
Code:
$ sudo ln -s /usr/lib32/mesa/libGL.so.1 /usr/lib32/mesa/libGL.so
On Ubuntu 11.10:
Code:
$ sudo apt-get install libx11-dev:i386
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"
#ASUS
SUBSYSTEM=="usb", ATTR{idVendor}=="0b05", MODE="0666"
#Dell
SUBSYSTEM=="usb", ATTR{idVendor}=="413c", MODE="0666"
#Foxconn
SUBSYSTEM=="usb", ATTR{idVendor}=="0489", MODE="0666"
#Garmin-Asus
SUBSYSTEM=="usb", ATTR{idVendor}=="091E", MODE="0666"
#Google
SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", MODE="0666"
#HTC
SUBSYSTEM=="usb", ATTR{idVendor}=="0bb4", MODE="0666"
#Huawei
SUBSYSTEM=="usb", ATTR{idVendor}=="12d1", MODE="0666"
#K-Touch
SUBSYSTEM=="usb", ATTR{idVendor}=="24e3", MODE="0666"
#KT Tech
SUBSYSTEM=="usb", ATTR{idVendor}=="2116", MODE="0666"
#Kyocera
SUBSYSTEM=="usb", ATTR{idVendor}=="0482", MODE="0666"
#Lenevo
SUBSYSTEM=="usb", ATTR{idVendor}=="17EF", MODE="0666"
#LG
SUBSYSTEM=="usb", ATTR{idVendor}=="1004", MODE="0666"
#Motorola
SUBSYSTEM=="usb", ATTR{idVendor}=="22b8", MODE="0666"
#NEC
SUBSYSTEM=="usb", ATTR{idVendor}=="0409", MODE="0666"
#Nook
SUBSYSTEM=="usb", ATTR{idVendor}=="2080", MODE="0666"
#Nvidia
SUBSYSTEM=="usb", ATTR{idVendor}=="0955", MODE="0666"
#OTGV
SUBSYSTEM=="usb", ATTR{idVendor}=="2257", MODE="0666"
#Pantech
SUBSYSTEM=="usb", ATTR{idVendor}=="10A9", MODE="0666"
#Philips
SUBSYSTEM=="usb", ATTR{idVendor}=="0471", MODE="0666"
#PMC-Sierra
SUBSYSTEM=="usb", ATTR{idVendor}=="04da", MODE="0666"
#Qualcomm
SUBSYSTEM=="usb", ATTR{idVendor}=="05c6", MODE="0666"
#SK Telesys
SUBSYSTEM=="usb", ATTR{idVendor}=="1f53", MODE="0666"
#Samsung
SUBSYSTEM=="usb", ATTR{idVendor}=="04e8", MODE="0666"
#Sharp
SUBSYSTEM=="usb", ATTR{idVendor}=="04dd", MODE="0666"
#Sony Ericsson
SUBSYSTEM=="usb", ATTR{idVendor}=="0fce", MODE="0666"
#Toshiba
SUBSYSTEM=="usb", ATTR{idVendor}=="0930", MODE="0666"
#ZTE
SUBSYSTEM=="usb", ATTR{idVendor}=="19D2", 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
4a) [OPTIONAL] Setting up ccache
You can optionally tell the build to use the ccache compilation tool. Ccache acts as a compiler cache that can be used to speed-up rebuilds. This works very well if you do "make clean" often, or if you frequently switch between different build products.
Put the following in your .bashrc or equivalent.
Code:
export USE_CCACHE=1
By default the cache will be stored in ~/.ccache. If your home directory is on NFS or some other non-local filesystem, you will want to specify the directory in your .bashrc as well.
Code:
export CCACHE_DIR=<path-to-your-cache-directory>
The suggested cache size is 50-100GB. You will need to run the following command once you have downloaded the source code:
Code:
prebuilts/misc/linux-x86/ccache/ccache -M 50G
This setting is stored in the CCACHE_DIR and is persistent.
5) Install the repo:
Code:
$ mkdir ~/bin
$ PATH=~/bin:$PATH
$ curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
$ chmod a+x ~/bin/repo
6) Initialize the repo:
Code:
$ mkdir WORKING_DIRECTORY
$ cd WORKING_DIRECTORY
6a) For AOSP:
Code:
$ repo init -u https://android.googlesource.com/platform/manifest.git -b android-5.1.1_r13
6.1) For people who have already done a repo init:
Code:
$ cd WORKING_DIRECTORY
AOSP:
Code:
$ repo init -b android-5.1.1_r13
$ repo sync
7) When prompted, enter your real name and email address.
8) Gather the files:
Code:
$ repo sync
9) Continue onto adding a device
~How To Add A Device To The List~
1) Find the github for your device you wish to add. (For me it is the Asus Nexus 7 (2013) [codename: flo]
2) Now navigate to the location you are going clone the device tree to:
Code:
$ cd WORKING_DIRECTORY/device
$ mkdir asus
3) Clone the github device tree from remote to local: (The name after the branch 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 https://android.googlesource.com/device/asus/flo.git -b lollipop-dev flo
4) Now navigate into the folder:
Code:
$ cd flo
5) Connect phone to computer and make sure USB debugging is enabled and you have adb set up.
6) Extract Device Proprietary Files (if extract script is present):
Code:
$ ./extract-files.sh
Or:
Code:
./proprietary-files.sh
Or: See use your device's provided proprietary blobs (like flo): Download the binaries from: https://developers.google.com/android/nexus/drivers
Extract the blobs and place them in the directory from the root of your working directory (ex. vendor/asus/flo): vendor/MANUFACTUROR/CODENAME
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 ('#' being the number of cores in your processor +1):
Code:
$ make -j#
Or for a flashable zip:
Code:
$ make -j# otapackage
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------
This tutorial is based off this one: http://source.android.com/source/initializing.html
Is this tutorial only for officially supported devices that are/will be running 'lollipop'? Will I be able to build lollipop on other device from this source? The thing is that I need to encode the device so it is compatible with 'lollipop'. I'm not really sure how it's done but if it's possible can you explain how or direct me in the right direction? Thanks.
Very nice guide.
Please I need serious help
I am trying to build lollipop for oneplus one.
I have followed multiple guides to get this correct.
However I am stuck at [email protected]:~/bin/WORKING_DIRECTORY$ make -j16
============================================
PLATFORM_VERSION_CODENAME=REL
PLATFORM_VERSION=5.0
TARGET_PRODUCT=aosp_bacon
TARGET_BUILD_VARIANT=userdebug
TARGET_BUILD_TYPE=release
TARGET_BUILD_APPS=
TARGET_ARCH=arm
TARGET_ARCH_VARIANT=armv7-a-neon
TARGET_CPU_VARIANT=krait
TARGET_2ND_ARCH=
TARGET_2ND_ARCH_VARIANT=
TARGET_2ND_CPU_VARIANT=
HOST_ARCH=x86_64
HOST_OS=linux
HOST_OS_EXTRA=Linux-3.16.0-25-generic-x86_64-with-Ubuntu-14.10-utopic
HOST_BUILD_TYPE=release
BUILD_ID=LRX21M
OUT_DIR=out
============================================
Checking build tools versions...
build/core/dex_preopt.mk:47: *** target pattern contains no '%'. Stop.
However if i use "sudo make -j 16"
I get this
Which would you like? [aosp_arm-eng] 15
============================================
PLATFORM_VERSION_CODENAME=REL
PLATFORM_VERSION=5.0
TARGET_PRODUCT=aosp_bacon
TARGET_BUILD_VARIANT=userdebug
TARGET_BUILD_TYPE=release
TARGET_BUILD_APPS=
TARGET_ARCH=arm
TARGET_ARCH_VARIANT=armv7-a-neon
TARGET_CPU_VARIANT=krait
TARGET_2ND_ARCH=
TARGET_2ND_ARCH_VARIANT=
TARGET_2ND_CPU_VARIANT=
HOST_ARCH=x86_64
HOST_OS=linux
HOST_OS_EXTRA=Linux-3.16.0-25-generic-x86_64-with-Ubuntu-14.10-utopic
HOST_BUILD_TYPE=release
BUILD_ID=LRX21M
OUT_DIR=out
============================================
[email protected]:~/bin/WORKING_DIRECTORY$ sudo make -j16
============================================
PLATFORM_VERSION_CODENAME=REL
PLATFORM_VERSION=5.0
TARGET_PRODUCT=full
TARGET_BUILD_VARIANT=eng
TARGET_BUILD_TYPE=release
TARGET_BUILD_APPS=
TARGET_ARCH=arm
TARGET_ARCH_VARIANT=armv7-a
TARGET_CPU_VARIANT=generic
TARGET_2ND_ARCH=
TARGET_2ND_ARCH_VARIANT=
TARGET_2ND_CPU_VARIANT=
HOST_ARCH=x86_64
HOST_OS=linux
HOST_OS_EXTRA=Linux-3.16.0-25-generic-x86_64-with-Ubuntu-14.10-utopic
HOST_BUILD_TYPE=release
BUILD_ID=LRX21M
OUT_DIR=out
============================================
Checking build tools versions...
What happens is the target product and everything changes so the output is a generic build.
Please help
Thanks
navendugoyal said:
Very nice guide.
Please I need serious help
I am trying to build lollipop for oneplus one.
Click to expand...
Click to collapse
You have to have a device tree for your product. You must then select that device and build type using 'lunch'.
Device tree is there
GROGG88 said:
You have to have a device tree for your product. You must then select that device and build type using 'lunch'.
Click to expand...
Click to collapse
Thanks for replying buddy, highly appreciate it.
Device tree is present.
Infact I have tried multiple device tree setups - but get the same error everytime
I have tried
CM
Oneplusaosp
TheUnas
but the same error
Also why after the sudo make command it should be changing the target product to a generic ?
screenshots - device tree
here is the device tree screenshot
navendugoyal said:
Thanks for replying buddy, highly appreciate it.
Device tree is present.
Infact I have tried multiple device tree setups - but get the same error everytime
I have tried
CM
Oneplusaosp
TheUnas
but the same error
Also why after the sudo make command it should be changing the target product to a generic ?
Click to expand...
Click to collapse
I do not have a solid answer regarding why 'sudo' would change your target. That truly is odd, but at the same time there is no reason why you should need sudo since your build did not fail due to permissions.
I'm curious... Where exactly did you fetch your device tree from? I do not see it in googlesource.com. Seeing as you're building for the OnePlusOne, I must ask if you're attempting to build AOSP or CM?
GROGG88 said:
I do not have a solid answer regarding why 'sudo' would change your target. That truly is odd, but at the same time there is no reason why you should need sudo since your build did not fail due to permissions.
I'm curious... Where exactly did you fetch your device tree from? I do not see it in googlesource.com. Seeing as you're building for the OnePlusOne, I must ask if you're attempting to build AOSP or CM?
Click to expand...
Click to collapse
Here are the 2 places I have tried my device tree form
https://github.com/OnePlusAosp/android_device_oneplus_bacon.git
Also
https://github.com/TheUnas - they have forked lot of things for OneplusOne lollipop.
great guide i'am doing mt first build fingures crossed it works thanks again buddy
navendugoyal said:
Here are the 2 places I have tried my device tree form
https://github.com/OnePlusAosp/android_device_oneplus_bacon.git
Also
https://github.com/TheUnas - they have forked lot of things for OneplusOne lollipop.
Click to expand...
Click to collapse
Do you have a copy of '../device/oppo/common/common.mk' ?
I'm trying to duplicate your condition against my source, but I need to know exactly what you've added to your tree. So far I'm coming up with this:
GROGG88 said:
Do you have a copy of '../device/oppo/common/common.mk' ?
I'm trying to duplicate your condition against my source, but I need to know exactly what you've added to your tree. So far I'm coming up with this:
Click to expand...
Click to collapse
Yes I have
See the screenshot
You can get them from here
https://github.com/TheUnas
No File or Directory
Ok, I'm building Android 5.0 Lollipop Aosp Tag= Android-5.0.0_r2
The problem is that some files cannot be found normally and need some editing
For example:
device/htc/leo/custom_libraries/libsensors/AkmSensor.cpp:25:27: fatal error: linux/akm8973.h: No such file or directory
The file "akm8973.h" can be found in "kernel/htc/leo/include/linux" But, nope, the compiler can't find it
One workaround is that I edit it to find the file like this
Before:
#include <linux/akm8973.h>
to
#include <akm8973.h>
and then put the file in the same dir as the file asking for it "device/htc/leo/custom_libraries/libsensors/"
Please, help, I know this is not normal and if there is a fix, please tell me
I have an oppo find 7
folder in the device there is not oppo/find7 so I created me, this folder now is empty, for proprietary file I can use the script "extract-files.sh" present in the source CM11 ? I have an oppo find 7
EDIT: i take device tree and proprietary files (already extracted to a compilation of a cyanogenmod) from cyanogenmod's github but that device tree is for android kitkat, not for lollipop, then i have this error:
http://pastebin.com/HhNGmFS2
after this problem i try this: i take the product_config.mk from cyanogen source but the problem is still there.
sorry for my bad english
Hey, trying to build L for HTC One M7,
this is my rom source : https://github.com/disco2
and this is my device tree : https://github.com/lollipop-m7
After selecting my device on lunch, it says
Code:
build/core/envsetup.mk:157: *** No config file found for TARGET_DEVICE m7. Stop.
** Don't have a product spec for: 'aosp_m7'
** Do you have the right repo manifest?
I have no idea why I get this error, there is no missing files or inaccurate names, but I keep getting this. Any idea?
YudmudTR said:
Hey, trying to build L for HTC One M7,
this is my rom source : https://github.com/disco2
and this is my device tree : https://github.com/lollipop-m7
After selecting my device on lunch, it says
Code:
build/core/envsetup.mk:157: *** No config file found for TARGET_DEVICE m7. Stop.
** Don't have a product spec for: 'aosp_m7'
** Do you have the right repo manifest?
I have no idea why I get this error, there is no missing files or inaccurate names, but I keep getting this. Any idea?
Click to expand...
Click to collapse
I have the same problem. Searching the internet I realized that you have to edit the manifest file . Go to the root of the repo and hit ctrl + h , then you'll see the folder .repo, inside there is manifest file to edit. You must add lines to your device by putting the directory of vendors and devices belonging to your phone ( if you see how add the other devices you'll understand better)
Although I added my device to Maifest I can not compile the AOSP for more error. I am currently compiling the generic and then virtualize just to try Lollipop
Sent from my Find7 using XDA Free mobile app
Any help please??
xperiafan13 said:
Click to expand...
Click to collapse
Please use pastebin for the errors and give a brief output to see the whole code of error...
From given picture i can say that it is showing an error in file_contexts, but I can't say it for sure until looking at whole code of error...
thanks
Trying to build for Xperia L taoshan
Hi there,
I was wondering whether i would be able to build a lollipop build for Xperia L device which is not included in official device list. If i am to develop then which code should i consider as a base to start..... Some steps for the same would be really appreciated...
Looks like I just need to turn off Java check right?
Code:
Checking build tools versions...
************************************************************
You asked for an OpenJDK 7 build but your version is
java version "1.7.0_72" Java(TM) SE Runtime Environment (build 1.7.0_72-b14) Java HotSpot(TM) 64-Bit Server VM (build 24.72-b04, mixed mode).
************************************************************
I put "$(error stop)" into a comment.
I am trying to build 5.0.0_r5 for htc bravo and no matter what I do, I get this error:
Code:
hardware/qcom/audio-legacy/qsd8k/AudioHardware.cpp: In function 'android_audio_legacy::AudioHardwareInterface* android_audio_legacy::createAudioHardware()':
hardware/qcom/audio-legacy/qsd8k/AudioHardware.cpp:2020:30: error: cannot allocate an object of abstract type 'android_audio_legacy::AudioHardware'
return new AudioHardware();
^
In file included from hardware/qcom/audio-legacy/qsd8k/AudioHardware.cpp:37:0:
hardware/qcom/audio-legacy/qsd8k/AudioHardware.h:165:7: note: because the following virtual functions are pure within 'android_audio_legacy::AudioHardware':
class AudioHardware : public AudioHardwareBase
^
In file included from hardware/libhardware_legacy/include/hardware_legacy/AudioHardwareBase.h:20:0,
from hardware/qcom/audio-legacy/qsd8k/AudioHardware.h:26,
from hardware/qcom/audio-legacy/qsd8k/AudioHardware.cpp:37:
hardware/libhardware_legacy/include/hardware_legacy/AudioHardwareInterface.h:255:29: note: virtual android_audio_legacy::AudioStreamOut* android_audio_legacy::AudioHardwareInterface::openOutputStreamWithFlags(uint32_t, audio_output_flags_t, int*, uint32_t*, uint32_t*, android::status_t*)
virtual AudioStreamOut* openOutputStreamWithFlags(
^
hardware/qcom/audio-legacy/qsd8k/AudioHardware.cpp:2021:1: error: control reaches end of non-void function [-Werror=return-type]
}
^
cc1plus: some warnings being treated as errors
Only commenting out 'createAudioHardware' allows to proceed with the build:
hardware/qcom/audio-legacy/qsd8k/AudioHardware.cpp
Code:
extern "C" AudioHardwareInterface* createAudioHardware(void) {
return new AudioHardware();
}
hardware/libhardware_legacy/audio/audio_hw_hal.cpp
Code:
ladev->hwif = createAudioHardware();
Here is my manifest.
Anyone else with this?