[Q] Building Froyo on Ubuntu - Desire Android Development

I am attempting to build android on ubuntu, but i get the most unhelpful error message when it fails to build.
PLATFORM_VERSION_CODENAME=REL
PLATFORM_VERSION=2.2.1
TARGET_PRODUCT=htc_bravo
TARGET_BUILD_VARIANT=eng
TARGET_SIMULATOR=
TARGET_BUILD_TYPE=release
TARGET_BUILD_APPS=
TARGET_ARCH=arm
HOST_ARCH=x86
HOST_OS=linux
HOST_BUILD_TYPE=release
BUILD_ID=MASTER
============================================
No private recovery resources for TARGET_DEVICE bravo
Install: out/host/linux-x86/framework/apicheck.jar
Install: out/host/linux-x86/framework/clearsilver.jar
Install: out/host/linux-x86/framework/droiddoc.jar
Install: out/host/linux-x86/lib/libneo_util.so
Install: out/host/linux-x86/lib/libneo_cs.so
Install: out/host/linux-x86/lib/libneo_cgi.so
Install: out/host/linux-x86/lib/libclearsilver-jni.so
target Java: core (out/target/common/obj/JAVA_LIBRARIES/core_intermediates/classes)
/bin/bash: line 1: 18273 Killed javac -J-Xmx512M -target 1.5 -Xmaxerrs 9999999 -encoding ascii -bootclasspath out/target/common/obj/JAVA_LIBRARIES/core_intermediates/classes.jar -g -extdirs "" -d out/target/common/obj/JAVA_LIBRARIES/core_intermediates/classes \@out/target/common/obj/JAVA_LIBRARIES/core_intermediates//java-source-list-uniq
make: *** [out/target/common/obj/JAVA_LIBRARIES/core_intermediates/classes-full-debug.jar] Error 41
i have googled as much as i can without finding an actual answer for this, just people with similar problems.
im running Ubuntu 10.04 64bit and i have tried both with java5 and java6 both with the same issue.

ahanson86 said:
I am attempting to build android on ubuntu, but i get the most unhelpful error message when it fails to build.
PLATFORM_VERSION_CODENAME=REL
PLATFORM_VERSION=2.2.1
TARGET_PRODUCT=htc_bravo
TARGET_BUILD_VARIANT=eng
TARGET_SIMULATOR=
TARGET_BUILD_TYPE=release
TARGET_BUILD_APPS=
TARGET_ARCH=arm
HOST_ARCH=x86
HOST_OS=linux
HOST_BUILD_TYPE=release
BUILD_ID=MASTER
============================================
No private recovery resources for TARGET_DEVICE bravo
Install: out/host/linux-x86/framework/apicheck.jar
Install: out/host/linux-x86/framework/clearsilver.jar
Install: out/host/linux-x86/framework/droiddoc.jar
Install: out/host/linux-x86/lib/libneo_util.so
Install: out/host/linux-x86/lib/libneo_cs.so
Install: out/host/linux-x86/lib/libneo_cgi.so
Install: out/host/linux-x86/lib/libclearsilver-jni.so
target Java: core (out/target/common/obj/JAVA_LIBRARIES/core_intermediates/classes)
/bin/bash: line 1: 18273 Killed javac -J-Xmx512M -target 1.5 -Xmaxerrs 9999999 -encoding ascii -bootclasspath out/target/common/obj/JAVA_LIBRARIES/core_intermediates/classes.jar -g -extdirs "" -d out/target/common/obj/JAVA_LIBRARIES/core_intermediates/classes \@out/target/common/obj/JAVA_LIBRARIES/core_intermediates//java-source-list-uniq
make: *** [out/target/common/obj/JAVA_LIBRARIES/core_intermediates/classes-full-debug.jar] Error 41
i have googled as much as i can without finding an actual answer for this, just people with similar problems.
im running Ubuntu 10.04 64bit and i have tried both with java5 and java6 both with the same issue.
Click to expand...
Click to collapse
After a few quick searches I noticed this as an answer to another thread:
"Looks like it has something to do with the Linux version. I use an older version of Ubuntu (8.04) because as what I know Google mentioned that there can be build errors with later versions."
Seems Ubuntu 8.04 with java5 is working pretty good for many people, although as I have not tested or compiled any android source myself I cannot say if it will work or not. Hope it helps you a few steps closer though!

You need to have Sun Java6 JDK Installed, its in a partner repo, so do the following (for Ubuntu 10.04), if you are in 10.10, just change lucid for maverick
Code:
sudo add-apt-repository "deb http://archive.canonical.com/ lucid partner"
sudo apt-get update
sudo apt-get install sun-java6-jdk
Then install the required build files:
Code:
sudo apt-get install it-core gnupg flex bison gperf libsdl1.2-dev libesd0-dev libwxgtk2.6-dev squashfs-tools build-essential zip curl libncurses5-dev zlib1g-dev sun-java6-jdk pngcrush g++-multilib lib32z1-dev lib32ncurses5-dev lib32readline5-dev gcc-4.3-multilib g++-4.3-multilib
Now edit your ~/.bashrc file to include the following (if not already done)
Code:
#Android Building Specific...
export JAVA_HOME=/usr/lib/jvm/java-6-sun
export ANDROID_JAVA_HOME=$JAVA_HOME
export ARCH=arm
export CROSS_COMPILE=arm-eabi-
export ANDROID_SDK_TOOLS=/folder/where/sdk/tools/are/extracted
export ANDROID_PREBUILT_ARMEABI=/folder/where/android/tools/arm-eabi/toolchain/is
export PATH=${PATH}:${JAVA_HOME}/bin:${ANDROID_SDK_TOOLS}:${ANDROID_PREBUILT_ARMEABI}
With the above edits to your .bashrc file, you need to make sure that the 2 variables ANDROID_SDK_TOOLS and ANDROID_PREBUILT_ARMEABI relate to actual folders, for example*(as it is on mine)
Code:
export ANDROID_SDK_TOOLS=/home/paulw/Programming/android-sdk-linux_86/tools
export ANDROID_PREBUILT_ARMEABI=/home/paulw/mydroid/prebuilt/linux-x86/toolchain/arm-eabi-4.4.0/bin
*note* ANDROID_PREBUILT_ARMEABI is actually within the downloaded Android source code which is pulled in via repo, all my android source is within ~/mydroid.
If you are building from the master tree, ignore this bit, but if you are building from Froyo (you passed -b froyo to repo before syncing) then in the android folder (where you issue make, etc etc) make sure you have edited the file build/core/main.mk, go to line 104:
Replace:
Code:
# Check for the correct version of java
java_version := $(shell java -version 2>&1 | head -n 1 | grep '[ "]1\.5[\. "$$]')
ifeq ($(strip $(java_version)),)
$(info ************************************************************)
$(info You are attempting to build with the incorrect version)
$(info of java.)
$(info $(space))
$(info Your version is: $(shell java -version 2>&1 | head -n 1).)
$(info The correct version is: 1.5.)
$(info $(space))
$(info Please follow the machine setup instructions at)
$(info $(space)$(space)$(space)$(space)http://source.android.com/download)
$(info ************************************************************)
$(error stop)
endif
# Check for the correct version of javac
javac_version := $(shell javac -version 2>&1 | head -n 1 | grep '[ "]1\.5[\. "$$]')
ifeq ($(strip $(javac_version)),)
$(info ************************************************************)
$(info You are attempting to build with the incorrect version)
$(info of javac.)
$(info $(space))
$(info Your version is: $(shell javac -version 2>&1 | head -n 1).)
$(info The correct version is: 1.5.)
$(info $(space))
$(info Please follow the machine setup instructions at)
$(info $(space)$(space)$(space)$(space)http://source.android.com/download)
$(info ************************************************************)
$(error stop)
endif
with:
Code:
# Check for the correct version of java
java_version := $(shell java -version 2>&1 | head -n 1 | grep '[ "]1\.6[\. "$$]')
ifeq ($(strip $(java_version)),)
$(info ************************************************************)
$(info You are attempting to build with the incorrect version)
$(info of java.)
$(info $(space))
$(info Your version is: $(shell java -version 2>&1 | head -n 1).)
$(info The correct version is: 1.6.)
$(info $(space))
$(info Please follow the machine setup instructions at)
$(info $(space)$(space)$(space)$(space)http://source.android.com/download)
$(info ************************************************************)
$(error stop)
endif
# Check for the correct version of javac
javac_version := $(shell javac -version 2>&1 | head -n 1 | grep '[ "]1\.6[\. "$$]')
ifeq ($(strip $(javac_version)),)
$(info ************************************************************)
$(info You are attempting to build with the incorrect version)
$(info of javac.)
$(info $(space))
$(info Your version is: $(shell javac -version 2>&1 | head -n 1).)
$(info The correct version is: 1.6.)
$(info $(space))
$(info Please follow the machine setup instructions at)
$(info $(space)$(space)$(space)$(space)http://source.android.com/download)
$(info ************************************************************)
$(error stop)
endif

still getting the same error unfortunately

I am going to build two VM's
one using 64bit Ubuntu 9.04 and one using 64bit Ubuntu 10.04 (both fresh installs)
and see what happens

Use synaptics, search for java and remove the likes of OpenJDK, IcedTea, etc etc, and make sure the only jdk installed is sun-java6 one.

Thanks for the info. I have wiped my virtual machines now and rebuilding them. But ill make sure that sun jdk is the only one installed this time. And fingers crossed it will work...
Ill let you know how things go when I get home and finish off.
Sent from my HTC Desire using XDA App

Thanks both of you for your comments, ive now got what i hope is it successfully building, on 10.04 with sun java sdk , fresh install seems to have cleaned up the mess i had with most likely several different sdks

Aye I had issues when coming to 10.04 from 9.10 regarding OpenJDK being pre-installed to some extent & conflicting IcedTea plugins (no idea why those affected it) But purging all traces of both & only leaving sun-java6-jdk worked well for me
If you use it as a primary system, you may want to put sun-java6-plugin on too, as thats the mozilla plugin so java apps work on the net.

Nay not using as a primary system just yet. Its currently just in a vm. Not used linux for a main os for quite some time. May go back one day
Sent from my HTC Desire using XDA App

uhoh now im getting a problem about librpc not being built and found.
/bin/ld: warning: librpc.so, needed by out/target/product/bravo/obj/lib/libgps.so, not found (try using -rpath or -rpath-link)
i have build librpc.so but it still wont pick it up?
is this something i need to pull from my current rom?

well it built, at least i think it did, where should my system.img be? only one i can find is
out/target/product/bravo/obj/PACKAGING/systemimage_unopt_intermediates/system.img
is that the correct one?
tried using that on an emulator and it gets stuck, does my emulator need any special settings?

i hope someone can help me with this, ive managed to build a system.img but when i try to boot it in the emulator i get the below in the kernel messages and the system freezes
init: untracked pid 34 exited
request_suspend_state: wakeup (3->0) at 2797636724 (2010-12-15 23:47:49.116651170 UTC)
init: untracked pid 54 exited
init: untracked pid 55 exited
request_suspend_state: wakeup (0->0) at 7912074624 (2010-12-15 23:47:54.231084960 UTC)
init: untracked pid 60 exited
init: untracked pid 68 exited
init: untracked pid 69 exited
request_suspend_state: wakeup (0->0) at 13023347882 (2010-12-15 23:47:59.342371737 UTC)
init: untracked pid 74 exited
init: untracked pid 82 exited
request_suspend_state: wakeup (0->0) at 17133542069 (2010-12-15 23:48:03.452557200 UTC)
init: untracked pid 87 exited
init: critical process 'servicemanager' exited 4 times in 4 minutes; rebooting into recovery mode
save exit: isCheckpointed 1
save exit: isCheckpointed 1
Restarting system with command 'recovery'.
Reboot failed -- System halted
Click to expand...
Click to collapse

ahanson86 said:
I am attempting to build android on ubuntu, but i get the most unhelpful error message when it fails to build.
HOST_ARCH=x86
============================================
No private recovery resources for TARGET_DEVICE bravo
Install: out/host/linux-x86/framework/apicheck.jar
Install: out/host/linux-x86/framework/clearsilver.jar
Install: out/host/linux-x86/framework/droiddoc.jar
Install: out/host/linux-x86/lib/libneo_util.so
Install: out/host/linux-x86/lib/libneo_cs.so
Install: out/host/linux-x86/lib/libneo_cgi.so
Install: out/host/linux-x86/lib/libclearsilver-jni.so
im running Ubuntu 10.04 64bit and i have tried both with java5 and java6 both with the same issue.
Click to expand...
Click to collapse
just a thought but have you considered using the x86 architecture rather than x64?

vuLgAr said:
just a thought but have you considered using the x86 architecture rather than x64?
Click to expand...
Click to collapse
the build itself has gone through fine now, it was java mismatches, now my problem lies with servicemanager closing as soon as it loads (by the looks of it) when i atempt to boot the system.img in the emulator

Just for another update I built a cyanogen mod system image etc from the cm similar for desire but get a kernel panic with that one. May try to do it on an x86 vm and see if that makes any difference
Unless anyone has any ideas what could cause these issues.
Sent from my HTC Desire using XDA App

use this:
http://forum.xda-developers.com/showthread.php?t=709105
and the cyanogen wiki to build, make sure to comment out the java thingy

Thanks. That's actually the thread I was using for my custom build. It builds fine but gives errors about processes and servicemanager exiting 4 times and then tries to reboot
Sent from my HTC Desire using XDA App

Ok well I managed to get it working. Flashed to my phone and boots.. now just need to get android market and such installed hopefully it wont be too difficult and find out why wifi ain't working. May jump to 2.3 though and skip messing with 2.2
Sent from my HTC Desire using XDA App

ahanson86 said:
Ok well I managed to get it working. Flashed to my phone and boots.. now just need to get android market and such installed hopefully it wont be too difficult and find out why wifi ain't working. May jump to 2.3 though and skip messing with 2.2
Sent from my HTC Desire using XDA App
Click to expand...
Click to collapse
Hi ahanson,
Like you, I am also trying to compile to froyo/gingerbread.
I am able to build the system.img, boot.img, userdata.img and recovery.img
But when i flash them, the device does not boot at all.
I have even created a otapackage, but flashing it does not help either - the device gets stuck at the htc boot screen.
Since you got it working, can you please tell me what changes did you made to your build to get it working?

Related

[GUIDE]BUILD CM10.1 FROM SOURCE| AIRFLUIP EDITION [Mac + Linux]

GITHUB servers are up!
So I finally thought that I should make a guide to build from source as I feel like the one on the wiki is a bit outdated and isn't very clear.
I will cover both instructions for how to build for Ubuntu 13.04 (64 bit only), and OS X 10.8.x(PLEASE KEEP AT LEAST 35GB Free)
LINUX SPECIFIC INSTRUCTIONS
Please open a terminal window NOW. If you can't do this, don't build android. Please be vigilant in following in-terminal directions, such as pressing enter if it's asking you to do so or confirm something, and using sudo before a command will invoke a password prompt also if entering a new command, please wait until the command exits out to the bash prompt (asking for a new command)
First, let's get rid of the wrong java assuming it's already installed, Android will "REFUSE" to build properly with the wrong java.
Code:
sudo apt-get purge openjdk-\* icedtea-\* icedtea6-\*
Now let's install the correct java,
Code:
sudo add-apt-repository ppa:webupd8team/java && sudo apt-get update && sudo apt-get install oracle-java6-installer && java -version
It should end with this
java version "1.6.0_37"
Java(TM) SE Runtime Environment (build 1.6.0_37-b06)
Java HotSpot(TM) 64-Bit Server VM (build 20.12-b01, mixed mode)
or something like it.
Now let's set up for making bacon!
Enter this in order to get dependencies for building android, please note that this is about 100-150 megs and will take a few minutes/10ish minutes depending on your computer and internet connection.
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
then,
Code:
sudo ln -s /usr/lib/i386-linux-gnu/mesa/libGL.so.1 /usr/lib/i386-linux-gnu/libGL.so
Repo is required for sucking sources from the cloud, so let's get it
Code:
mkdir ~/bin && curl https://dl-ssl.google.com/dl/googlesource/git-repo/repo > ~/bin/repo && chmod a+x ~/bin/repo
Now let's add this repo thing to our path
Code:
sudo nano ~/.bashrc
at the bottom of the file,add this
Code:
export PATH=~/bin:$PATH
now press Ctrl-O followed by Ctrl-X
restart bash by entering
Code:
source ~/.bashrc
now find a directory to build android in. Personally, I use /home/username/android
so for now let's place it in there
Code:
mkdir ~/android && cd ~/android && mkdir cm && cd cm
SYNC TIME!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!x10^infinity!
Code:
repo init -u git://github.com/CyanogenMod/android.git -b cm-10.1 && mkdir -p .repo/local_manifests && curl https://raw.github.com/teamuserdebug/page/manifests/manifests/cm10.1-aries.xml > .repo/local_manifests/local_manifest.xml && repo sync
make sure you acknowledge name, color, email etc, or you'll be sitting around and wasting time. this can take anywhere from 1 hr to 1 week depending on your internet connection, personally takes me 3-5 hrs.
go grab a starbucks and come back, you'll need it.
after it's done, make sure you are still in your cm directory.
IT'S BUILDING TIME
OPTIONAL: If you have some free space sitting around eg, 70-100 gigs for building android,
it's time to setup CCACHE, this speeds up future builds by "A LOT"
first edit .bashrc
Code:
sudo nano ~/.bashrc
add these lines at the bottom
Code:
export CCACHE_DIR=/home/-username-/.ccache
(Note, replace "-username-" with your computer username, without the dashes.
Code:
export USE_CCACHE=1
press Ctrl-O followed by Ctrl-X
enter
Code:
[CODE]source ~/.bashrc
[/CODE]
now enable ccache by entering
Code:
prebuilts/misc/linux-x86/ccache/ccache -M50
or
Code:
./prebuilts/misc/linux-x86/ccache/ccache -M50
if the first one doesn't work
BUILD TIME:
enter these
Code:
cd ~/android/cm
Code:
vendor/cm/get-prebuilts
Code:
. build/envsetup.sh
Code:
lunch cm_galaxys4gmtd-userdebug
Code:
mka clobber
Code:
mka bacon
It will be in ~/android/cm/out/products/target/galaxys4gmtd/cm-unofficial-something-something-signed.zip or something like that.
Make sure you don't pick the wrong zip file, because there are 2 or 3 in there.
OS X 10.8.x SPECIFIC INSTRUCTIONS
Please open a terminal window NOW. If you can't do this, don't build android. Please be vigilant in following in-terminal directions, such as pressing enter if it's asking you to do so or confirm something, and using sudo before a command will invoke a password prompt also if entering a new command, please wait until the command exits out to the bash prompt (asking for a new command)
First, let's install java if it's not already installed
Code:
java
Now, we MUST install X-Code otherwise we won't even be able to lunch.
1. Open the App Store
2. Find X-Code,(it's free) and install it [this is a 1+ GB download, and install]
3.Open X-Code and go to preferences. There you find a 'Downloads' tab. Open it and install “Command line tools” It will take a few minutes to download and install
Now let's set up for making bacon!
Download and install MacPorts, not Homebrew, since MacPorts is faster.
You can get the mountain lion pkg installer here
After it is installed, close and open terminal.
edit your bash profile
Code:
sudo nano ~/.bash_profile
add
Code:
export BUILD_MAC_SDK_EXPERIMENTAL=1
somewhere at the bottom
Press Ctrl-X, then y, then "enter/return" Note: Yes, the control key is used, not the command key, so don't be confused
Install dependencies to make bacon
Code:
POSIXLY_CORRECT=1 sudo port install git-core coreutils findutils gsed gnupg pngcrush repo
then
Code:
sudo ln -s /opt/local/bin/gfind /opt/local/bin/find && ln -s /opt/local/bin/gsed /opt/local/bin/sed
run
Code:
pngcrush
in terminal to make sure that things are properly in your path
THEY SHOULD BE since MacPorts edits your .bash_profile for you.
Now, we need a case-sensitive folder so we will need to make a sparseimage which you will have to mount every time you want to do something with your android builds.(like a DMG), but for now, this command will attach it for you. It will be on your desktop
Code:
hdiutil create -type SPARSE -fs "Case-sensitive Journaled HFS+" -size 60g -volname "android" -attach ~/Desktop/Android
Make the cm folder
Code:
cd /Volumes/Android && mkdir cm && cd cm
SYNC TIME!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!x10^infinity!
Code:
repo init -u git://github.com/CyanogenMod/android.git -b cm-10.1 && mkdir -p .repo/local_manifests && curl https://raw.github.com/teamuserdebug/page/manifests/manifests/cm10.1-aries.xml > .repo/local_manifests/local_manifest.xml && repo sync
make sure you acknowledge name, color, email etc, or you'll be sitting around and wasting time. this can take anywhere from 1 hr to 1 week depending on your internet connection, personally takes me 3-5 hrs.
go grab a starbucks and come back, you'll need it.
after it's done, make sure you are still in your cm directory.
Before we build, we have to fix an elf.h error
Code:
cp /Volumes/android/cm/external/elfutils/libelf/elf.h /usr/local/include
IT'S BUILDING TIME
OPTIONAL: If you have some free space sitting around eg, 70-100 gigs for building android,
it's time to setup CCACHE, this speeds up future builds by "A LOT"
install a ccache which is usable by mac
Code:
sudo port install ccache
edit your bash profile to use ccache.
Code:
sudo nano ~/.bash_profile
find the line that says
Code:
export PATH=/opt/local/bin:/opt/local/sbin:$PATH
and edit it to say
Code:
export PATH=/opt/local/libexec/ccache:/opt/local/bin:/opt/local/sbin:$PATH
press Ctrl-X, then y, then "enter/return"
then exit and reopen terminal
now configure ccache's memory
Code:
ccache -M50
BUILD TIME:
enter these
Code:
cd ~/android/cm
Code:
vendor/cm/get-prebuilts
Code:
. build/envsetup.sh
Code:
lunch cm_galaxys4gmtd-userdebug
Code:
mka clobber
Code:
mka bacon
It will be in /Volumes/android/cm/out/products/target/galaxys4gmtd/cm-unofficial-something-something-signed.zip or something like that.
Make sure you don't pick the wrong zip file, because there are 2 or 3 in there
nice, didn't take long to get it stickied either.
sent from within pure darkness
I know right!
Also, I have edited it for the mac version as well.
Now you guys can build on both mac and linux!!!!!!!!!!!!
Also, I will post when github stuffs are back up.
Thx. is this coming from a straight Unbuntu say setup without having to install a bunch of crap? I had that BBQLinux installed which is supposed to be for building android but it didn't have apt installed, so then tried yum to install that, and it didn't have that. lol. Just going to install Ubuntu on a VM and try your directions from a new install.
yes
but obviously you need to have wifi
airfluip1 said:
yes
but obviously you need to have wifi
Click to expand...
Click to collapse
Why do I need wifi?
i mean internet.
airfluip1 said:
i mean internet.
Click to expand...
Click to collapse
O ya, I got tonnes of that. lol. Thanks for the guide though. I've tried a few times to get a build environment going and it always goes wacky or I don't get something right.
i think that they are up now.
airfluip1 said:
i think that they are up now.
Click to expand...
Click to collapse
don't know, I'm getting fetch errors, url can't found, 404 and then when it's done, it craps out and says can't sync, too many fetch errors. Is this the servers still being down?
Maybe
Sent from my SGH-T959V using xda premium
airfluip, you might have been better off creating a local_manifest.xml file (though those are deprecated and now you can just create a manifest file called, for example, airfluip1_aokp.xml).
You're going to have to keep up with the platform_manifest changes and will have to resolve merge conflicts if the AOKP team decides to make some major changes (not unlikely).
You can actually add the changes you made to the manifest.xml into a custom manifest xml file similar to what we did with team acid's CM9/AOKP repos.
maybe, but I thought it was easier. I'll change it in a week or two.
Just thought I'd throw in that BBQLinux is arch based and for building android and linuxBBQ is NOT the same thing, it's probably the worst distro to start from to build android. In case someone else decides to go there.
airfluip1 said:
maybe, but I thought it was easier. I'll change it in a week or two.
Click to expand...
Click to collapse
Just as a way to make syncing source faster, you can also remove the device/kernel trees for other devices that aren't the SGS4G so that we can just download what's necessary for building for our phone.
yeah, I know. I'll do that later as well. I just don't have much time for a few weeks.
I got a rom compiled with your sources airfluip. I haven't flash tested yet.
I did run into problems with the SGS4GParts package so I had to remove it from galaxys4gmtd.mk, other than that the rom compiled fine. I'll help you look into the error later.
Thanks for the guide, easy to follow
EDIT
By the way, are you using TWRP in these builds, or is it CWM?
Code:
______ _____ __ __ _____
/\ _ \/\ __`\/\ \/\ \ /\ _ `\
\ \ \L\ \ \ \/\ \ \ \/'/'\ \ \L\ \
\ \ __ \ \ \ \ \ \ , < \ \ ,__/
\ \ \/\ \ \ \_\ \ \ \\`\ \ \ \/
\ \_\ \_\ \_____\ \_\ \_\\ \_\
\/_/\/_/\/_____/\/_/\/_/ \/_/
===========-Package complete-===========
zip: /home/fb/android/jb_aokp/work/out/target/product/galaxys4gmtd/aokp_galaxys4gmtd_unofficial_2013-05-14.zip
md5: c8fcc3417bab626ca6d018b88450ab42
size: 150M
========================================
It must have been something that I edited.
I am using CWm.
I don't like twrp very much.
It's always something....
I'm not sure if something changed since you made this tutorial but I can't seem to get this to build.
My first attempt resulted in the SGS4GParts error like FB mentioned. Which seems to have something to do with the TVOut setting.
Each attempt at rebuilding I seem to get different errors.
I also get this when building starts...normal?
Code:
find: `../../vendor/unbundled_google/libs/gcm/gcm-client/src': No such file or directory
find: `../../vendor/unbundled_google/libs/gcm/gcm-server/src': No such file or directory
find: `../../vendor/unbundled_google/libs/gcm/gcm-client/src': No such file or directory
find: `../../vendor/unbundled_google/libs/gcm/gcm-server/src': No such file or directory
find: `src': No such file or directory
Edit: Is there a way to grab a log of the entire build output? Is it saved to a file somewhere?
LOL I am building right now.
The src error is normal
AND IF THERE IS A BUILD ERROR, POST A LOG IN PASTEBIN.
ALSO, THERE SHOULDN'T BE ANY BUILD ERRORS RIGHT NOW AS LONG as you
Code:
repo sync
before you do a new build.
Also you should run
Code:
make clobber && mka bacon
everytime.

[GUIDE][DEV] Compile any source built rom for your device [ULTRA NOOB FRIENDLY]

I know there are many other guides avalable regarding this, But I tried to focus on the small points also that many guides overlook
that's why I have this for you. Do let know if I have missed something or more details have to be included in case still there is a difficulty in compiling
This thread on Madteam Forums: http://madteam.co/forum/development...lt-rom-for-your-device-(ultra-noob-friendly)/
So lets start with simple things
Basic FAQ:
Q: What is a Source built rom?
A: Source Built Roms are roms that are compiled from source on a Linux Platform! They are not themed manually.
Q: How do we build these type of roms?
A: Setup Linux and then follow this guide.
Click to expand...
Click to collapse
This post/guide is divided into 4 parts:
1. Setting up build environment
2. Machine specifications etc.
3. Device Tree and source basics
4. Syncing Source and Building
PART 1: Setting up build environment​
Type sudo su and then your password to get rid of Admin Permissions
#Installing Python
STEP 1: Open terminal (CTRL + ALT + T)
Then execute the following commands in terminal one by one
Code:
sudo apt-get install build-essential gcc
cd Downloads
wget http://www.python.org/ftp/python/2.5.6/Python-2.5.6.tgz
tar -xvzf Python-2.5.6.tgz
cd Python-2.5.6
./configure --prefix=/usr/local/python2.5
make
sudo make install
sudo ln -s /usr/local/python2.5/bin/python /usr/bin/python2.5
Now Python is configured
#Installing JDK
As far as I know PPA which was the earlier method of installing JDK etc. doesn't exist's anymore, So I used another way!
Step 1: Open Terminal (CTRL + ALT + T)
STEP 2: Now we need to download the JDK 6 Binary by executing this command in terminal
Code:
wget --no-check-certificate --no-cookies --header "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com" "http://download.oracle.com/otn-pub/java/jdk/6u45-b06/jdk-6u45-linux-x64.bin"
STEP 3: Then we need to run the binary and move it to a shared location:
Code:
chmod +x jdk-6u45-linux-x64.bin
sudo ./jdk-6u45-linux-x64.bin
sudo mv jdk1.6.0_45 /usr/lib/jvm/
STEP 4: Now you have to install all binaries and give them highest priority, This will also overwrite the previous version of Java Binaries in your computer
Code:
sudo update-alternatives --install /usr/bin/java java /usr/lib/jvm/jdk1.6.0_45/bin/java 1
sudo update-alternatives --install /usr/bin/javac javac /usr/lib/jvm/jdk1.6.0_45/bin/javac 1
sudo update-alternatives --install /usr/bin/javaws javaws /usr/lib/jvm/jdk1.6.0_45/bin/javaws 1
sudo update-alternatives --install /usr/bin/jar jar /usr/lib/jvm/jdk1.6.0_45/bin/jar 1
sudo update-alternatives --install /usr/bin/javadoc javadoc /usr/lib/jvm/jdk1.6.0_45/bin/javadoc 1
STEP 5: Now check if JDK 1.6 is selected on this:
Code:
sudo update-alternatives --config java
sudo update-alternatives --config javac
sudo update-alternatives --config javaws
sudo update-alternatives --config jar
sudo update-alternatives --config javadoc
Now JDK is configured! To check if it is done
Execute this is Terminal
Code:
java -version
Output will be similar to this
Code:
java version "1.6.0_45"
Java(TM) SE Runtime Environment (build 1.6.0_45-b06)
Java HotSpot(TM) 64-Bit Server VM (build 20.45-b01, mixed mode)
#Installing GNU Make
Code:
cd Downloads
wget -o make.tar.gz http://ftp.gnu.org/gnu/make/make-3.81.tar.gz
tar -xvzf make-3.81.tar.gz
cd make-3.82
./configure
sudo make install
These commands are for Make 1.81 if you want to install Make 1.82 Execute these
Code:
cd
wget -o make.tar.gz http://ftp.gnu.org/gnu/make/make-3.82.tar.gz
tar -xvzf make-3.82.tar.gz
cd make-3.82
./configure
sudo make install
Now GNU make is configures
#Installing Android SDK
STEP ONE: Download the SDK from http://developer.android.com/sdk/index.html and extract it in a folder called "sdk" in the Downloads folder
STEP TWO: Now, Execute these commands in terminal
Code:
cd ~/Downloads/sdk/tools/
./android sdk
SDK is configured now :victory:
#Installing required packages:
STEP 1: Open Terminal
Now execute these commands:
Code:
apt-get install git-core gnupg flex bison gperf build-essential \
zip curl zlib1g-dev libc6-dev libncurses5-dev x11proto-core-dev \
libx11-dev libreadline6-dev libgl1-mesa-dev tofrodos python-markdown \
libxml2-utils xsltproc pngcrush gcc-multilib lib32z1 schedtool
Good, Now you have successfully setup linux build environment!​
PART 2: Machine specifications and other misc. stuff​
Basic Computer Specs:
2Ghz Dual Core Processor
2GB Minimum ram
50GB File Space (For only one rom source)
*PLEASE NOTE*: This is the basic specification, It really depends on the condition of your ram and cpu!
If you want to use other apps while compilation you should make a 5GB minimum swap partition!
If ram is more than 4GB ram then you don't swap partition!
PART 3: DEVICE TREE AND SOURCE BASICS​
Basic source folders:
/packages - Proprietary rom applications
/framework - Framework (Overall rom UI and stuff)
/device - Device config
/vendor - Vendor Tree and other vendor files
/hardware - Hardware drivers
Q: What is BoardConfig.mk?
A: It's the file where you setup path's to files like toolchain etc. and enable/disable stuff, its very easy to understand. You can find it in your device's tree
Q: Where is build.prop in source?
A. Build.prop is available in the source in the form of system.prop in the device tree!
Q: How to remove ringtones, video editor, CM wallpapers from bulid?
A: Go to device/releasetools/extras.txt and Delete anything you don't want in your build
PART 4: Syncing Source and Building​
# Installing Repo Package
Code:
mkdir ~/bin
curl https://dl-ssl.google.com/dl/googlesource/git-repo/repo > ~/bin/repo
chmod a+x ~/bin/repo
STEP 2: Now it is recommended to reboot your computer (No need of sudo su after reboot)
STEP 3: Now make directory:
Code:
mkdir -p ~/rom/android/system
STEP 4: Go into directory and set path for Repo Package
Code:
cd ~/rom/android/system
PATH=~/bin:$PATH
STEP 5: NOW ITS TIME FOR SYNCING:
Their are different sources for different roms:
Some are listed bellow:
MIUI - www.github.com/micode/
Rootbox - www.github.com/Root-Box/
rasbeanjelly - www.github.com/rascarlo/
Xylon AOSP - www.github.com/xyaosp/
PAC-Man - www.github.com/PAC-Man/
CyanogenMod - www.github.com/Cyanogenmod/
CarbonROM - www.github.com/carbondev/
SaberMOD - www.github.com/SaberMOD/
AOKP - www.github.com/AOKP/
From the above collection some are Gingerbread some are ICS and some are JB 4.1/4.2 you have to visit these links via browser and see which source is which and follow the commands given at android.git/platform_manifest.git
Click to expand...
Click to collapse
For CM10.1 source execute this:
Code:
repo init -u git://github.com/CyanogenMod/android.git -b cm10.1
For syncing CM10 source execute:
Code:
repo init -u git://github.com/CyanogenMod/android.git -b jellybean
You have to find for the rest!!
PS: You don't have to execute all the repo init commands written above
Now to sync execute this after the the repo init command
Code:
repo sync
Once it finishes without breaking all the folders will appear in rom/android/system folder
now execute this:
Code:
mkdir -p ~/rom/android/system/device/<ManufacturerName>/<DeviceCodeName>
and extract the device config/tree here
for me its samsung/totoro (galaxy Y, Don't mind )
then do the following:
Code:
mkdir -p ~/rom/android/system/vendor/<ManufacturerName>/<DeviceCodename>
Its the same as for the device folder
Now for compiling:
Code:
. build/envsetup.sh
lunch cm_<DeviceCodename>-eng
brunch cm_<DeviceCodename>-eng
Your build will be located at /rom/android/system/out as <RomName>-date/month/year-UNOFFICIAL-<DeviceCodeName>.zip
HAPPY COMPILING ​
Credits:
MadTeam (motafoca, whitexp etc.) for MADTeam Forums and many help
Team Broadcom CM (bieltv.3, SpaceCaker, Psychogame etc.) for giving my device a quite stable cm.. I learnt to compile because of them! Cheers
BeerGang
mithun46
abhisahara
galaxyfreak
cybojenix
Sniper Killer for supporting me a lot! Thanks dude
prototype-U for Supporting..
Others who supported me
IF YOU LIKE MY GUIDE, DO RATE THIS THREAD A FIVE STAR!
THOSE WHO ARE FACING ERRORS, DO POST YOUR PROBLEM at speed_bot's Source Building Help Thread ​
Good good !! Nicely compiled
abhisahara said:
Good good !! Nicely compiled
Click to expand...
Click to collapse
Thanks
I'll update this guide whenever I get time
Good work on this, I found it quite clear keep up the good work!
Sent from my GT-I9505 using Tapatalk 4 Beta
nicely copied
Aniruddh Chandratre said:
nicely copied
Click to expand...
Click to collapse
Just read what I said at the begging of the thread!
If you are too lazy then:
I know there are many other guides avalable regarding this, But I tried to focus on the small points also that many guides overlook
that's why I have this for you. Do let know if I have missed something or more details have to be included in case still there is a difficulty in compiling
Click to expand...
Click to collapse
And yes, I took reference from others guide... I do give credits!
Have you ever compiled it(successfully) yourself?
Sent from my HTC Desire X using xda app-developers app
prototype-U said:
Have you ever compiled it(successfully) yourself?
Sent from my HTC Desire X using xda app-developers app
Click to expand...
Click to collapse
Yes.. I did..
Thanks for your support
Arnav.G said:
Yes.. I did..
Thanks for your support
Click to expand...
Click to collapse
Where is it?
Sent from my HTC Desire X using xda app-developers app
prototype-U said:
Where is it?
Sent from my HTC Desire X using xda app-developers app
Click to expand...
Click to collapse
It will come...
Please don't spam the thread now! I know you are a RC and you know the rules but still.. Please
http://xda-university.com/as-a-developer/getting-started-building-android-from-source
Nice simplifications...
Noob friendly? Lol! Did you test it on yourself!
When I run the binaries on jdk
I get errors on the 2nd command-Syntax error
Why >
Fang Leone said:
When I run the binaries on jdk
I get errors on the 2nd command-Syntax error
Why >
Click to expand...
Click to collapse
Can you please explain your problem in a little more details?
"This Story Ends Where It Began" - Octavarium (Dream Theater)
Sent from my GT-I9505
Great Guide!!
This is very kind of you to make this helpful thread. It really helped me alot after setting up my new build environment. I ran into an error on you post that you may want to correct, other than that, great work! Here is the typo
"cd Downloads
wget -o make.tar.gz http://ftp.gnu.org/gnu/make/make-3.81.tar.gz
tar -xvzf make-3.81.tar.gz<--this is correct.
cd make-3.82<---it changes here.
./configure
sudo make install"
Hello guys!
I have an error at brunch:
Code:
host Java: guavalib (/home/richard/android/system/out/host/common/obj/JAVA_LIBRARIES/guavalib_intermediates/classes)
logtags: /home/richard/android/system/out/target/common/obj/JAVA_LIBRARIES/framework_intermediates/src/core/java/android/content/EventLogTags.java <= frameworks/base/core/java/android/content/EventLogTags.logtags
logtags: /home/richard/android/system/out/target/common/obj/JAVA_LIBRARIES/framework_intermediates/src/core/java/android/speech/tts/EventLogTags.java <= frameworks/base/core/java/android/speech/tts/EventLogTags.logtags
logtags: /home/richard/android/system/out/target/common/obj/JAVA_LIBRARIES/framework_intermediates/src/core/java/android/webkit/EventLogTags.java <= frameworks/base/core/java/android/webkit/EventLogTags.logtags
[B]make: *** No rule to make target `/home/richard/android/system/out/host/linux-x86/bin/dx', needed by `/home/richard/android/system/out/target/common/obj/APPS/Apollo_intermediates/proguard.classes-with-local.dex'. Stop.[/B]
make: *** Waiting for unfinished jobs....
logtags: /home/richard/android/system/out/target/common/obj/JAVA_LIBRARIES/telephony-common_intermediates/src/src/java/com/android/internal/telephony/EventLogTags.java <= frameworks/opt/telephony/src/java/com/android/internal/telephony/EventLogTags.logtags
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Anyone knows what's causing it? It couldn't be the roomservice.xml in local_manifest as I used the one which another person successfully built CM with. I also repo sync'ed a few times already. I tried make clobber and built again, but nothing :crying:
I am building PACMAN ROM (4.3) now by the way.
All help is appreciated (with a thank!)
Greedings everyone
For some time now i am trying to download and compile CyanongenMod Sources for my Device. I Install VirtualBox + Linux Mint + all the needed stuff. Then i do the repo init and everything looks ok but when i do the repo sync it always throw me a error fetch stop because of sync errors. Ive done it a lot of time with no luck. Also i tried the repo sync -f which finaly finishes fetching things but stops at getting the project tree. Can anyone help me? :/ its really frustrating
vale amicis said:
I know there are many other guides avalable regarding this, But I tried to focus on the small points also that many guides overlook
that's why I have this for you. Do let know if I have missed something or more details have to be included in case still there is a difficulty in compiling
This thread on Madteam Forums: http://madteam.co/forum/development...lt-rom-for-your-device-(ultra-noob-friendly)/
So lets start with simple things
Basic FAQ:
This post/guide is divided into 4 parts:
1. Setting up build environment
2. Machine specifications etc.
3. Device Tree and source basics
4. Syncing Source and Building
PART 1: Setting up build environment​
Type sudo su and then your password to get rid of Admin Permissions
#Installing Python
STEP 1: Open terminal (CTRL + ALT + T)
Then execute the following commands in terminal one by one
Code:
sudo apt-get install build-essential gcc
cd Downloads
wget http://www.python.org/ftp/python/2.5.6/Python-2.5.6.tgz
tar -xvzf Python-2.5.6.tgz
cd Python-2.5.6
./configure --prefix=/usr/local/python2.5
make
sudo make install
sudo ln -s /usr/local/python2.5/bin/python /usr/bin/python2.5
Now Python is configured
#Installing JDK
As far as I know PPA which was the earlier method of installing JDK etc. doesn't exist's anymore, So I used another way!
Step 1: Open Terminal (CTRL + ALT + T)
STEP 2: Now we need to download the JDK 6 Binary by executing this command in terminal
Code:
wget --no-check-certificate --no-cookies --header "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com" "http://download.oracle.com/otn-pub/java/jdk/6u45-b06/jdk-6u45-linux-x64.bin"
STEP 3: Then we need to run the binary and move it to a shared location:
Code:
chmod +x jdk-6u45-linux-x64.bin
sudo ./jdk-6u45-linux-x64.bin
sudo mv jdk1.6.0_45 /usr/lib/jvm/
STEP 4: Now you have to install all binaries and give them highest priority, This will also overwrite the previous version of Java Binaries in your computer
Code:
sudo update-alternatives --install /usr/bin/java java /usr/lib/jvm/jdk1.6.0_45/bin/java 1
sudo update-alternatives --install /usr/bin/javac javac /usr/lib/jvm/jdk1.6.0_45/bin/javac 1
sudo update-alternatives --install /usr/bin/javaws javaws /usr/lib/jvm/jdk1.6.0_45/bin/javaws 1
sudo update-alternatives --install /usr/bin/jar jar /usr/lib/jvm/jdk1.6.0_45/bin/jar 1
sudo update-alternatives --install /usr/bin/javadoc javadoc /usr/lib/jvm/jdk1.6.0_45/bin/javadoc 1
STEP 5: Now check if JDK 1.6 is selected on this:
Code:
sudo update-alternatives --config java
sudo update-alternatives --config javac
sudo update-alternatives --config javaws
sudo update-alternatives --config jar
sudo update-alternatives --config javadoc
Now JDK is configured! To check if it is done
Execute this is Terminal
Code:
java -version
Output will be similar to this
Code:
java version "1.6.0_45"
Java(TM) SE Runtime Environment (build 1.6.0_45-b06)
Java HotSpot(TM) 64-Bit Server VM (build 20.45-b01, mixed mode)
#Installing GNU Make
Code:
cd Downloads
wget -o make.tar.gz http://ftp.gnu.org/gnu/make/make-3.81.tar.gz
tar -xvzf make-3.81.tar.gz
cd make-3.82
./configure
sudo make install
These commands are for Make 1.81 if you want to install Make 1.82 Execute these
Code:
cd
wget -o make.tar.gz http://ftp.gnu.org/gnu/make/make-3.82.tar.gz
tar -xvzf make-3.82.tar.gz
cd make-3.82
./configure
sudo make install
Now GNU make is configures
#Installing Android SDK
STEP ONE: Download the SDK from http://developer.android.com/sdk/index.html and extract it in a folder called "sdk" in the Downloads folder
STEP TWO: Now, Execute these commands in terminal
Code:
cd ~/Downloads/sdk/tools/
./android sdk
SDK is configured now :victory:
#Installing required packages:
STEP 1: Open Terminal
Now execute these commands:
Code:
apt-get install git-core gnupg flex bison gperf build-essential \
zip curl zlib1g-dev libc6-dev libncurses5-dev x11proto-core-dev \
libx11-dev libreadline6-dev libgl1-mesa-dev tofrodos python-markdown \
libxml2-utils xsltproc pngcrush gcc-multilib lib32z1 schedtool
Good, Now you have successfully setup linux build environment!​
PART 2: Machine specifications and other misc. stuff​
Basic Computer Specs:
2Ghz Dual Core Processor
2GB Minimum ram
50GB File Space (For only one rom source)
*PLEASE NOTE*: This is the basic specification, It really depends on the condition of your ram and cpu!
If you want to use other apps while compilation you should make a 5GB minimum swap partition!
If ram is more than 4GB ram then you don't swap partition!
PART 3: DEVICE TREE AND SOURCE BASICS​
Basic source folders:
/packages - Proprietary rom applications
/framework - Framework (Overall rom UI and stuff)
/device - Device config
/vendor - Vendor Tree and other vendor files
/hardware - Hardware drivers
Q: What is BoardConfig.mk?
A: It's the file where you setup path's to files like toolchain etc. and enable/disable stuff, its very easy to understand. You can find it in your device's tree
Q: Where is build.prop in source?
A. Build.prop is available in the source in the form of system.prop in the device tree!
Q: How to remove ringtones, video editor, CM wallpapers from bulid?
A: Go to device/releasetools/extras.txt and Delete anything you don't want in your build
PART 4: Syncing Source and Building​
# Installing Repo Package
Code:
mkdir ~/bin
curl https://dl-ssl.google.com/dl/googlesource/git-repo/repo > ~/bin/repo
chmod a+x ~/bin/repo
STEP 2: Now it is recommended to reboot your computer (No need of sudo su after reboot)
STEP 3: Now make directory:
Code:
mkdir -p ~/rom/android/system
STEP 4: Go into directory and set path for Repo Package
Code:
cd ~/rom/android/system
PATH=~/bin:$PATH
STEP 5: NOW ITS TIME FOR SYNCING:
For CM10.1 source execute this:
Code:
repo init -u git://github.com/CyanogenMod/android.git -b cm10.1
For syncing CM10 source execute:
Code:
repo init -u git://github.com/CyanogenMod/android.git -b jellybean
You have to find for the rest!!
PS: You don't have to execute all the repo init commands written above
Now to sync execute this after the the repo init command
Code:
repo sync
Once it finishes without breaking all the folders will appear in rom/android/system folder
now execute this:
Code:
mkdir -p ~/rom/android/system/device/<ManufacturerName>/<DeviceCodeName>
and extract the device config/tree here
for me its samsung/totoro (galaxy Y, Don't mind )
then do the following:
Code:
mkdir -p ~/rom/android/system/vendor/<ManufacturerName>/<DeviceCodename>
Its the same as for the device folder
Now for compiling:
Code:
. build/envsetup.sh
lunch cm_<DeviceCodename>-eng
brunch cm_<DeviceCodename>-eng
Your build will be located at /rom/android/system/out as <RomName>-date/month/year-UNOFFICIAL-<DeviceCodeName>.zip
HAPPY COMPILING ​
Click to expand...
Click to collapse
I had two things to ask
1)Was installing android-sdk needed
2)If device not yet had a cm build or device tree how to get them

[GUIDE] How to port Bluez to Kitkat, Lollipop & Marshmallow

Introduction
When the bluetooth stack changed to Bluedroid in Android 4.2, it was a nightmare to some of the old devices like my GT-P6800. I didn't have any experience in Bluetooth before so I did what I know. I spent weeks to revert the 4.2 platform to Bluez. Even though I succeeded, it probably not doable for 4.3 and later.
Last Nov. I found that bluez.org announced support for Andriod in Sep. It gave me hope again! Thanks to the bluez team!:good: The principle is straight forward - Implement the functions defined in "hardware/libhardware/include/hardware/bluetooth.h". That's what I thought but I didn't have enough knowledge nor confidence to try...
After studying for a while, I started porting bluez to Android 4.4 last Christmas. It was frustrated and helpless. Although the lastest Android 4.4 example for Mako and Flo are out, they don't help much. A bunch of prebuilt kernel objects surely doesn't help! Porting for those devices already having bluedroid support is meaningless to most of us too...
Building the bluez hal and daemon are straight forward but how to make it really work is another story. After a few painful and frustrated weekends, I finally managed to pull everything together. I can start/stop and pairing bluetooth devices in the platform now. And here I'm, sharing my experiences. I think there might be better way and I welcome any corrections.
My p6800 has CSR bluetooth chip which has no bluedroid support. I think the same approach would work for other chips too. Cheers! :highfive:
** All paths assume your rom source dircetory to be the current directory **
1. Downlaod and Build
Bluez.org already has its own tutorial. I just summerize and list my suggestions.
1.1 local manifest
I learned my lesson and would avoid touching the "manifest.xml".
Add the following lines to your ".repo/local_manifests/local_menifest.xml"
For cm11, omni, etc.
Code:
<remote name="gcode" fetch="https://code.google.com/p/"/>
<remote name="korg" fetch="git://git.kernel.org/pub/scm/bluetooth/"/>
<remove-project name="android_external_bluetooth_bluedroid"/>
<project remote="korg" path="external/bluetooth/bluez" name="bluez" group="pdk" revision="master"/>
<project remote="korg" path="external/bluetooth/sbc" name="sbc" group="pdk" revision="master"/>
<project remote="gcode" path="external/bluetooth/glib" name="aosp-bluez.glib" group="pdk" revision="master"/>
For AOSP, replace the remove-project with:
Code:
<remove-project name="platform/external/bluetooth/bluedroid"/>
After repo sync, bluez will replace bluedroid.
1.2 patching bionic
The patches for bionic are simple. Mainly by adding two flags and the function epoll_create1().
Bionic may vary from ROMs. It is wiser to patch the bionic of your ROM manually. You may follow the changes of the two commits below:
https://code.google.com/p/aosp-blue...96020013615b00d70579123f&repo=platform-bionic
https://code.google.com/p/aosp-blue...3347746d0d9727d8439ef4c4&repo=platform-bionic
1.3 neccessary tools
There are tools in "external/bluetooth/bluez/tools". You may need some of those tools for setup or testing.
This is the "Android.mk" I added to "external/bluetooth/bluez/tools". You may cheery pick the required tools for your device.
Code:
#
# Bluetooth tools for setup and debug
# daniel_hk
LOCAL_PATH := external/bluetooth
# Retrieve BlueZ version from configure.ac file
BLUEZ_VERSION := $(shell grep ^AC_INIT $(LOCAL_PATH)/bluez/configure.ac | cpp -P -D'AC_INIT(_,v)=v')
# Specify pathmap for glib
#pathmap_INCL += glib:external/bluetooth/glib
# Specify common compiler flags
BLUEZ_COMMON_CFLAGS := -DVERSION=\"$(BLUEZ_VERSION)\" \
-DSTORAGEDIR=$(ANDROID_STORAGEDIR) \
# Disable warnings enabled by Android but not enabled in autotools build
BLUEZ_COMMON_CFLAGS += -Wno-pointer-arith -Wno-missing-field-initializers
# @ daniel, extra tools for CSR
ifeq ($(BOARD_HAVE_BLUETOOTH_CSR),true)
#
# bccmd
#
include $(CLEAR_VARS)
LOCAL_SRC_FILES:= \
bluez/lib/hci.c \
bluez/lib/bluetooth.c \
bluez/tools/bccmd.c \
bluez/tools/csr.c \
bluez/tools/csr_3wire.c \
bluez/tools/csr_bcsp.c \
bluez/tools/csr_hci.c \
bluez/tools/csr_h4.c \
bluez/tools/csr_usb.c \
bluez/tools/ubcsp.c
LOCAL_CFLAGS := $(BLUEZ_COMMON_CFLAGS)
LOCAL_C_INCLUDES:=\
$(LOCAL_PATH)/bluez \
$(LOCAL_PATH)/bluez/lib \
$(LOCAL_PATH)/bluez/tools \
$(LOCAL_PATH)/bluez/src \
$(LOCAL_PATH)/bluez/src/shared \
LOCAL_MODULE:=bccmd
include $(BUILD_EXECUTABLE)
#
# sdptool
#
include $(CLEAR_VARS)
LOCAL_SRC_FILES:= \
bluez/lib/hci.c \
bluez/lib/bluetooth.c \
bluez/lib/sdp.c \
bluez/tools/sdptool.c \
bluez/src/sdp-xml.c
LOCAL_CFLAGS := $(BLUEZ_COMMON_CFLAGS)
LOCAL_C_INCLUDES:=\
$(LOCAL_PATH)/bluez \
$(LOCAL_PATH)/bluez/lib \
$(LOCAL_PATH)/bluez/tools \
$(LOCAL_PATH)/bluez/src \
$(LOCAL_PATH)/bluez/src/shared \
LOCAL_C_INCLUDES += \
$(call include-path-for, glib) \
$(call include-path-for, glib)/glib \
LOCAL_SHARED_LIBRARIES := \
libglib \
LOCAL_MODULE_PATH := $(TARGET_OUT_OPTIONAL_EXECUTABLES)
LOCAL_MODULE_TAGS := optional
LOCAL_MODULE:=sdptool
include $(BUILD_EXECUTABLE)
endif
1.4 patches for CyanogenMod 11
In CyanogenMod 11, the function "pin_request_cb" has one more argument. The following file need some patches:
in the file "external/bluetooth/bluez/android/hal-bluetooth.c"
Code:
[I]** in function: handle_pin_request[/I]
bt_hal_cbacks->pin_request_cb(addr, name, ev->class_of_dev, 0); // @ daniel, added 0 for cm11
in the file "external/bluetooth/bluez/android/client/if-bt.c"
Code:
[I]** in function: pin_request_cb[/I]
static void pin_request_cb(bt_bdaddr_t *remote_bd_addr, bt_bdname_t *bd_name,
uint32_t cod, uint8_t secure) // @ daniel, added secure from cm11
{
/* Store for command completion */
bt_bdaddr_t2str(remote_bd_addr, last_remote_addr);
pin_request_addr = *remote_bd_addr;
haltest_info("%s: remote_bd_addr=%s bd_name=%s cod=%06x secure=%02x\n", __func__,
last_remote_addr, bd_name->name, cod, secure); // @ daniel, added
terminal_prompt_for("Enter pin: ", pin_request_answer);
}
2. kerenl patch
In the "README" inside "external/bluetooth/bluez/android", there is the line:
Minimal required version of management interface is 1.3. This corresponds to Linux 3.9 but latest available version is recommended.
Click to expand...
Click to collapse
If you have tried porting bluez and fail, check the logcat. You might probably found the error "Failed to access management interface". This is the key making bluez to work! Sadly, most of the existing Android kernels are before ver. 3.9! The latest kernel we have might be ver. 3.4.x and the kernel for my p6800 is ver. 3.0.x! As the above line stated, Bluez5 requires the kernel to have management interface 1.3 or above. That means we have to backport the bluetooth subsystem from at least ver. 3.9. I backport my kernel with the latest (3.13-1) found in linux-foundation.org: http://drvbp1.linux-foundation.org/~mcgrof/rel-html/backports/
It was a tough and painful job! There are lots of changes. I finally got a bootable backport kernel in 2 days!
I packed my patches in View attachment kernel-3.0.x-backport-3.13-1.zip. This patch is for my 3.0.x kernel which might be different from other 3.0.x kernels. Don't have time to tidy up but it works for me. Although I've done the hard part, it still requires extra patience to get yours done. Prepare yourself...
2.1 Backport 3.13-1 to your kernel
Direct replacements.
Replace the following folders in the zip with the one in your kernel source:
drivers/bluetooth
net/bluetooth
include/net/bluetooth
include/backport​
Direct replacement might not work!
Check include/linux in the zip
For each file,
add the required part (which I delimited with comments @ daniel and //@ ) to the corresponding file in your kernel source.
If file not exist,
copy the files to your kernel source​
Check your defconfig. As README suggested, defconfig should have:
CONFIG_BT
CONFIG_BT_RFCOMM
CONFIG_BT_RFCOMM_TTY
CONFIG_BT_BNEP
CONFIG_BT_BNEP_MC_FILTER
CONFIG_BT_BNEP_PROTO_FILTER
CONFIG_BRIDGE
CONFIG_UHID
# and for CSR chips
CONFIG_BT_HCIUART=y
CONFIG_BT_HCIUART_H4=y
CONFIG_BT_HCIUART_BCSP=y​
You probably need to compile the kernel many times to get it work. I worte a build script View attachment build-k.zip to compile the kernel only.
Copy build-k to your ROM source directory and type:
Code:
./build-k <your device>
2.2 Backport-hid-generic to your kernel
There is another patch in the Mako-kern example:
https://code.google.com/p/aosp-blue...eneric-driver.patch?repo=device-lge-mako-kern
Don't know if it is required for your kernel but adding this patch seems doesn't hurt.
If you do it right, you may find "Bluetooth management interface 1.4" in your logcat. Congratulation! Bluetoothd can connect to your kernel now!
3. initialization and setup
Take a look at your devices tree's TARGET_CUSTOM_BLUEDROID definition. If you have a file assigned, it supposed to replace the file "bluetooth.c" in the "system/bluetooth" project. In Android 4.4, this project is no longer exist/needed. Before Android 4.2, this project provide the functions "bt_enable()" and "bt_disable()" which are called in the frameworks. These functions will tell you how to "power on", "power off" and init your device's Bluetooth chip.
For CSR:
set /sys/class/rfkill/rfkill0/state to 1 ("power on")
start the service "bccmd" which will setup the chip and upload a PSConfig to the chip
start the service "hciattach" which init the port hci0 with parameters
start the service "bluetoothd" which is the bluez stack
The services are defined in init.rc or init.${ro.hardware}.rc.
3.1 Test your device and the tools
Disable the "import init.bluetooth.rc" line if you have added it before.
Example for CSR chips. Follow the steps in bt_enable. In a terminal or via adb:
Code:
$ su -- [I][COLOR="SeaGreen"]root user is required[/COLOR][/I]
# echo "1" > /sys/class/rfkill/rfkill0/state
# bccmd -t bcsp -d /dev/ttySAC0 -b 115200 psload -r /system/etc/PSConfig_8811.psr
Loading 0x212c ... done
Loading 0x212d ... done
...
Loading PSKEY_CLOCK_REQUEST_ENABLE ... done
Loading PSKEY_UART_HOST_WAKE ... done
# hciattach -p /dev/ttySAC0 bcsp 3000000 flow
Device setup complete
# hciconfig hci0 up
# hcitool scan -- [I][COLOR="SeaGreen"]turn on a device's bluetooth for testing[/COLOR][/I]
Nexus 4 -- [I][COLOR="SeaGreen"]found the device means bluetooth is working now[/COLOR][/I]
3.2 Init sequence
In Bluez5, the HAL (bluetooth.default.so) driver will be loaded at boot and the daemon (bluetoothd) will be started inside too. Take a look at the function "bool hal_ipc_init(void)" in "external/bluetooth/bluez/android/hal-ipc.c". You may find how the HAL is init which is different from pre-4.2 Androids.
In order to get the daemon (bluetoothd) to work, we have to init the chip before that.
I worte a shell script init.bt.sh to init the chip/port:
Code:
#!/system/bin/sh
# modified by daniel_hk
LOG_TAG="CSR8811-HCI"
BTUART_PORT=/dev/ttySAC0
BTSTATE=/sys/class/rfkill/rfkill0/state
PSCONFIG=/system/etc/PSConfig_8811.psr
logi ()
{
/system/bin/log -t $LOG_TAG -p i ": [email protected]"
}
loge ()
{
/system/bin/log -t $LOG_TAG -p e ": [email protected]"
}
failed ()
{
loge "$1: exit code $2"
exit $2
}
#Enable power of csr chip
echo "1" > $BTSTATE
# PS Config with bccmd
logwrapper /system/bin/bccmd -t bcsp -d $BTUART_PORT -b 115200 psload -r $PSCONFIG
case $? in
0) logi "bccmd init port....done";;
*) failed "port: $BTUART_PORT - bccmd failed" $?;
exit $?;;
esac
# attach HCI
logwrapper /system/bin/hciattach -p $BTUART_PORT bcsp 3000000 flow
case $? in
0) logi "hci attached to : $BTUART_PORT";;
*) failed "port: $BTUART_PORT - hciattach failed" $?;
exit $?;;
esac
exit 0
It takes time for bccmd and hciattach to complete. Putting them in seperate services requires delay in between. I think it is better to run them as application one after one.
A new rc file init.${ro.hardware}.bt.rc is created and need to be imported in your init.${ro.hardware}.rc
Code:
on boot
start bt_init
on property:init.svc.bluetoothd=running
start hci0_up
on property:init.svc.bluetoothd=stopped
start hci0_down
service bt_init /system/bin/logwrapper /system/bin/sh /system/etc/init.bt.sh
class main
user root
group bluetooth net_bt_admin system
disabled
oneshot
service hci0_up /system/bin/logwrapper /system/xbin/hciconfig hci0 up
class main
group bluetooth
disabled
oneshot
service hci0_down /system/bin/logwrapper /system/xbin/hciconfig hci0 down
class main
group bluetooth
disabled
oneshot
import init.bluetooth.rc
Since HAL (bluetooth.default.so) is started quite early, I start the service bt_init at boot. I have tried a few places, daemon might timed out before bt_init finish. It also seems no need to repeat the init process everytime.
When bluetoothd is running (system/core/init will set the property init.svc.bluetoothd=running), set hci0 up with hciconfig. And when the service bluetoothd is stopped, set hci0 down with hciconfig. There might be a better way. Please indulge me if something better coming up.
You may turn ON/OFF bluetooth in settings now. Pairing and file transfer is working too.
4. Further porting
Take a look at the function get_profile_interface() in the file external/bluetooth/bluez/android/hal-bluetooth.c. Some interfaces which frameworks requested are missing.
eg. Bluetooth Handsfree interface
Bluetooth Map Client Interface
Bluetooth Health Interface
Bluetooth GATT Interface​Update: Fully support for Kitkat now. Check the README inside the android folder for detail.
As I mentioned before, I'm new to bluetooth. Further reading is required for me to fix other services. I also don't have enough time now. I have to process the stuck works after the Chinese New Year holiday. :cyclops: Hoping I can continue by the end of Feb. In the mean time, I hope someone have better knowledge may help fix other services.
For those devices don't have bluedroid support, we have a chance to carry on now!
[GUIDE] Porting Bluez to Marshmallow
Check the modified Bluez in my github.
It has been tested with Omni6 (Android-6.0.1_r3)
You have to remove system_bt in local_manifest.xml (similar to bluedroid, check post #1 for detail)
CM needs extra modifications. Will be available after testing.
Nice , Xperia Novathor devs also working on stable bluez 
 @95A31
Nice guide In CM11 you need also revert this https://github.com/CyanogenMod/andr...mmit/763c68d048d268bd931dffa72000f52830ffe2d8
95A31 said:
Nice guide In CM11 you need also revert this https://github.com/CyanogenMod/andr...mmit/763c68d048d268bd931dffa72000f52830ffe2d8
Click to expand...
Click to collapse
Thanks! Patch in section 1.4 is another alternative for cm11.
daniel_hk said:
Thanks! Patch in section 1.4 is another alternative for cm11.
Click to expand...
Click to collapse
Wops my fault :silly:, you have right
although i dont have my previous device which has csr chip..but those still have csr will get greatly benefited ..your work is incredible......god bless u!!!
keep the good work!!!
static void pin_request_cb is defined in external/bluetooth/bluez/android/client/if-bt.c
95A31 said:
static void pin_request_cb is defined in external/bluetooth/bluez/android/client/if-bt.c
Click to expand...
Click to collapse
yeah, it is also defined in if-bt.c but if you check android/Android.mk, only haltest use it. If you want to build haltest, you need to change if-bt.c too.
Take a look the file android/Android.mk which is the make file for android. bluetooth.default.so which cm11 refered to, use the definition in hal-bluetoth.c.
Sent from my Nexus 7 using Tapatalk
daniel_hk said:
yeah, it is also defined in if-bt.c but if you check android/Android.mk, only haltest use it. If you want to build haltest, you need to change if-bt.c too.
Take a look the file android/Android.mk which is the make file for android. bluetooth.default.so which cm11 refered to, use the definition in hal-bluetoth.c.
Sent from my Nexus 7 using Tapatalk
Click to expand...
Click to collapse
Forgot my unknowledge/newbie but I can not find it in hal-bluetoth.c (In BLueZ git)
95A31 said:
Forgot my unknowledge/newbie but I can not find it in hal-bluetoth.c (In BLueZ git)
Click to expand...
Click to collapse
It's in the android folder. In the same place as Android.mk.
If you can't find inside the file, you might have the old version. Try include the project in manifest and sync again.
I have a suggested local_manifest in post #1.
Good luck!
Sent from my Nexus 7 using Tapatalk
daniel_hk said:
It's in the android folder. In the same place as Android.mk.
Sent from my Nexus 7 using Tapatalk
Click to expand...
Click to collapse
I mean in hal-bluetooth.c, can you tell me the line in this version ot the file? (I know that it is a retarded question but I really can find other occurences of pin_request_cb outside handle_pin_request function) I am working on BlueZ git so I am working on lastest version
95A31 said:
I mean in hal-bluetooth.c, can you tell me the line in this version ot the file? (I know that it is a retarded question but I really can find other occurences of pin_request_cb outside handle_pin_request function) I am working on BlueZ git so I am working on lastest version
Click to expand...
Click to collapse
All the changes are listed in post#1.
In line 239 of you link, there is the line:
bt_hal_cbacks->pin_request_cb(addr, name, ev->class_of_dev);
It is a callback. The definition is in cm11 which had changed. That's why we have to add one more argument. (or revert the cm11 commit as you said)
The definition if-bt.c which is a client, is for testing. It has to define the callback which is required in int. Got it?
daniel_hk said:
All the changes are listed in post#1.
In line 239 of you link, there is the line:
bt_hal_cbacks->pin_request_cb(addr, name, ev->class_of_dev);
It is a callback. The definition is in cm11 which had changed. That's why we have to add one more argument. (or revert the cm11 commit as you said)
The definition if-bt.c which is a client, is for testing. It has to define the callback which is required in int. Got it?
Click to expand...
Click to collapse
Get it :good:
Ok, I have a nice bootloop: http://pastebin.com/QcZbEkfx Guys some ideas ?
95A31 said:
Ok, I have a nice bootloop: http://pastebin.com/QcZbEkfx Guys some ideas ?
Click to expand...
Click to collapse
I have checked your logcat. There is no management interface log. The kernel backport on blietooth subsystem is probably failed.
Sent from my Nexus 7 using Tapatalk
daniel_hk said:
I have checked your logcat. There is no management interface log. The kernel backport on blietooth subsystem is probably failed.
Sent from my Nexus 7 using Tapatalk
Click to expand...
Click to collapse
I foud this dependence in my case: WLAN init need that BT chip is initialized because WLAN ask clock to BT. The intoduction of import init.bluetooth.rc broke this dependence. Fu*king details :cyclops: I hope to save debug time to someone
Thanks, very helpful guide. Following this I was able to get BlueZ working on MSM7x27a. However, instead of dropping the backport sources in the kernel tree I followed this documentation to build the backports as external modules, which looks like a cleaner way to me. This requires building the kernel without BT (and, in cases like this, patching the source to remove some dependencies on built-in BT). This leaves the kernel sources (mostly) untouched, and makes adapting the backport sources easier because you can separately build the modules without doing a full kernel build.
The modules can then be built like this:
Code:
# clean output files
make -C kernel/backports ARCH=arm CROSS_COMPILE="arm-eabi-" KLIB=$OUT/obj/KERNEL_OBJ KLIB_BUILD=$OUT/obj/KERNEL_OBJ mrproper
# configure
make -C kernel/backports ARCH=arm CROSS_COMPILE="arm-eabi-" KLIB=$OUT/obj/KERNEL_OBJ KLIB_BUILD=$OUT/obj/KERNEL_OBJ menuconfig
# build
make -C kernel/backports ARCH=arm CROSS_COMPILE="arm-eabi-" KLIB=$OUT/obj/KERNEL_OBJ KLIB_BUILD=$OUT/obj/KERNEL_OBJ
jjm34 said:
Thanks, very helpful guide. Following this I was able to get BlueZ working on MSM7x27a. However, instead of dropping the backport sources in the kernel tree I followed this documentation to build the backports as external modules, which looks like a cleaner way to me. This requires building the kernel without BT (and, in cases like this, patching the source to remove some dependencies on built-in BT). This leaves the kernel sources (mostly) untouched, and makes adapting the backport sources easier because you can separately build the modules without doing a full kernel build.
The modules can then be built like this:
Code:
# clean output files
make -C kernel/backports ARCH=arm CROSS_COMPILE="arm-eabi-" KLIB=$OUT/obj/KERNEL_OBJ KLIB_BUILD=$OUT/obj/KERNEL_OBJ mrproper
# configure
make -C kernel/backports ARCH=arm CROSS_COMPILE="arm-eabi-" KLIB=$OUT/obj/KERNEL_OBJ KLIB_BUILD=$OUT/obj/KERNEL_OBJ menuconfig
# build
make -C kernel/backports ARCH=arm CROSS_COMPILE="arm-eabi-" KLIB=$OUT/obj/KERNEL_OBJ KLIB_BUILD=$OUT/obj/KERNEL_OBJ
Click to expand...
Click to collapse
Yeah! Yours seems better. I was messing with the kernel for a while before backport. Traditional backport kill my WiFi so I did what I knew. I will try yours later.
Any other success would be cheerful.
Sent from my Nexus 7 using Tapatalk
Sucessfully ported on CyanogenMod 11.0 git (using Bluetooth from AOSP).
HOWTO:
Remove CyanogenMod Bluetooth and grab AOSP version by local_manifest:
Code:
<?xml version="1.0" encoding="UTF-8"?>
<manifest>
<remote name="kernel"
fetch="git://git.kernel.org/pub/scm/" />
<remote name="googlecode"
fetch="https://code.google.com/" />
<remove-project name="CyanogenMod/android_external_bluetooth_bluedroid" />
<project remote="kernel" path="external/bluetooth/bluez" name="bluetooth/bluez" groups="pdk" revision="master" />
<project remote="kernel" path="external/bluetooth/sbc" name="bluetooth/sbc" groups="pdk" revision="master" />
<project remote="googlecode" path="external/bluetooth/glib" name="p/aosp-bluez.glib" groups="pdk" revision="master" />
<remove-project name="CyanogenMod/android_packages_apps_Bluetooth" />
<remove-project name="CyanogenMod/android_packages_apps_BluetoothExt" />
<project path="packages/apps/Bluetooth" name="platform/packages/apps/Bluetooth" remote="aosp" revision="refs/tags/android-4.4.2_r1" />
<project path="aosp/packages/apps/Settings" name="platform/packages/apps/Settings" remote="aosp" revision="refs/tags/android-4.4.2_r1" />
<project path="aosp/frameworks/base" name="platform/frameworks/base/" remote="aosp" revision="refs/tags/android-4.4.2_r1" />
<project path="aosp/hardware/libhardware" name="platform/hardware/libhardware/" remote="aosp" revision="refs/tags/android-4.4.2_r1" />
</manifest>
Replace CyanogenMod Bluetooth system with AOSP one:
Code:
rm cm-11.0/hardware/libhardware/include/hardware/bluetooth.h
cp aosp/hardware/libhardware/include/hardware/bluetooth.h cm-11.0/hardware/libhardware/include/hardware/bluetooth.h
rm -rf cm-11.0/frameworks/base/core/java/android/bluetooth
cp -r aosp/frameworks/base/core/java/android/bluetooth cm-11.0/frameworks/base/core/java/android
rm cm-11.0/frameworks/base/services/java/com/android/server/BluetoothManagerService.java
cp aosp/frameworks/base/services/java/com/android/server/BluetoothManagerService.java cm-11.0/frameworks/base/services/java/com/android/server/BluetoothManagerService.java
rm -rf cm-11.0/packages/apps/Settings/src/com/android/settings/bluetooth
cp -r aosp/packages/apps/Settings/src/com/android/settings/bluetooth cm-11.0/packages/apps/Settings/src/com/android/settings
Adapt CyanogenMod with this changes:
Code:
diff --git a/frameworks/base/Android.mk b/frameworks/base/Android.mk
index 91338ef..43a87ef 100644
--- a/frameworks/base/Android.mk
+++ b/frameworks/base/Android.mk
@@ -88,10 +88,8 @@ LOCAL_SRC_FILES += \
core/java/android/wipower/IWipower.aidl \
core/java/android/wipower/IWipowerManagerCallback.aidl \
core/java/android/bluetooth/IBluetooth.aidl \
- core/java/android/bluetooth/IQBluetooth.aidl \
core/java/android/bluetooth/IBluetoothA2dp.aidl \
core/java/android/bluetooth/IBluetoothCallback.aidl \
- core/java/android/bluetooth/IQBluetoothAdapterCallback.aidl \
core/java/android/bluetooth/IBluetoothHeadset.aidl \
core/java/android/bluetooth/IBluetoothHeadsetPhone.aidl \
core/java/android/bluetooth/IBluetoothHealth.aidl \
@@ -100,18 +98,12 @@ LOCAL_SRC_FILES += \
core/java/android/bluetooth/IBluetoothPan.aidl \
core/java/android/bluetooth/IBluetoothManager.aidl \
core/java/android/bluetooth/IBluetoothManagerCallback.aidl \
- core/java/android/bluetooth/IQBluetoothManagerCallback.aidl \
core/java/android/bluetooth/IBluetoothPbap.aidl \
core/java/android/bluetooth/IBluetoothMap.aidl \
core/java/android/bluetooth/IBluetoothStateChangeCallback.aidl \
- core/java/android/bluetooth/IBluetoothHandsfreeClient.aidl \
- core/java/android/bluetooth/IBluetoothHidDevice.aidl \
- core/java/android/bluetooth/IBluetoothHidDeviceCallback.aidl \
core/java/android/bluetooth/IBluetoothGatt.aidl \
core/java/android/bluetooth/IBluetoothGattCallback.aidl \
core/java/android/bluetooth/IBluetoothGattServerCallback.aidl \
- core/java/android/bluetooth/IBluetoothSap.aidl \
- core/java/android/bluetooth/IBluetoothDun.aidl \
core/java/android/content/IClipboard.aidl \
core/java/android/content/IContentService.aidl \
core/java/android/content/IIntentReceiver.aidl \
@@ -407,7 +399,6 @@ aidl_files := \
frameworks/base/core/java/com/android/internal/view/IInputMethodClient.aidl \
frameworks/base/core/java/com/android/internal/view/IInputMethodManager.aidl \
frameworks/base/core/java/com/android/internal/view/IInputMethodSession.aidl \
- frameworks/base/core/java/android/bluetooth/BluetoothLEServiceUuid.aidl \
frameworks/base/graphics/java/android/graphics/Bitmap.aidl \
frameworks/base/graphics/java/android/graphics/Rect.aidl \
frameworks/base/graphics/java/android/graphics/Region.aidl \

[GUIDE]How to build a rom from scratch/source for the Micromax Canvas 2 aka a110.

Hello guys. I have seen a lot of activity here. But I found almost no one knew about source building in this community. Another reason for posting is for people who want to build cm11 from scratch themselves. Our computer crashes most of the time.
Here starts the fun :
Prerequisites
Quote:
HTML:
1. Ubuntu 13.10 / BBQLINUX (I personally use this)
2. patience...lots and lots of patience.
1. Installing ubuntu 13.10.
Quote:
This can be done in 3 ways and I am not gonna cover it all.
- along with windows ,i.e dual boot
- in virtualbox within windows
- as a windows application installation with "wubi" installer
For starting user i think second option, i.e installing in virtualbox is best.
here's starting tutorials
http://www.youtube.com/watch?v=tDDRFiwHujg
NOTE - you should have atleast 100 Gb partion for virtualbox.
2. Setting up building environment.
PHP:
THIS ALL BELOW STEPS ARE NOT NEEDED IF YOU HAVE INSTALLED BBQLINUX, BUILDING ENVIRONMENT IS SET IN BBQLINUX BY DEFAULT. IT WORKS OUT-OF-THE-BOX.
Initializing a fresh Android Build Environment in Ubuntu 13.10 sucks, right? The instructions at the AOSP page are outdated and inaccurate. Near as I can tell, they try to have you install 2 JDKs, the first one not even being the correct link for Saucy Salamander, and the second being OpenJDK. Which might work. But I dunno about all that, I’d rather have Oracle’s official stamp when it comes to building for Android.
Currently most of the guides are up to 12.04 LTS, which is fine and dandy, but being on the cutting edge is nice too.
This guide applies to all variations of Ubuntu 13.10 Saucy Salamander 64 bit. Do not use the 32 Bit version. Also, PAY CLOSE ATTENTION when to use “sudo” and when to not. It can make things funky if you do something as root that you shouldn’t.
Much thanks goes out to Google, ProTekk, Canonical, and everyone else that I read a random paragraph here and snippet there.
First lets perform an update:
HTML:
sudo apt-get update
After this Restart ubuntu.
Okay, let’s set up the correct JDK.
Many of you probably have some kind of wrong Java installed unless you’re starting with a fresh Ubuntu base, and even then maybe.
Let’s get rid of that. Copy and paste this into a Terminal window:
Code:
PHP:
sudo apt-get purge openjdk-\* icedtea-\* icedtea6-\*
Follow the instructions to remove OpenJDK.
If you must keep it, it’s possible. But I’m not going to tell you how to do it here. I don’t want any chance of confusion or mistake.
Now copy and paste the following into the Terminal:
Code:
PHP:
sudo add-apt-repository ppa:webupd8team/java
This will add the correct PPA to your system for updated builds of Java 6 JDK that are compatible with 13.10.
No more unrecognized Java version errors! And it will update automatically with the rest of your system.
Next, we actually need to install the package. More copy-paste:
Code:
PHP:
sudo apt-get update && sudo apt-get install oracle-java6-installer
Follow the on-screen instructions. You have to Accept the Licensing Agreement to complete the install. Hopefully no human centipede clauses.
Let’s make sure the correct version of Java is activated, run the following Terminal command:
Code:
PHP:
java -version
You should see something like the following:
Code:
PHP:
java version “1.6.0_45″ Java(TM) SE Runtime Environment (build 1.6.0_45-b06) Java HotSpot(TM) 64-Bit Server VM (build 20.12-b01, mixed mode)
Ok, back to a fresh Terminal prompt. Time for installing the guts to build stuff in Ubuntu:
Code:
PHP:
sudo apt-get install git-core gnupg ccache lzop flex bison gperf build-essential zip curl zlib1g-dev zlib1g-dev:i386 libc6-dev lib32ncurses5 lib32z1 lib32bz2-1.0 lib32ncurses5-dev 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
When that is done installing, run the following command in your Terminal window:
Code:
PHP:
sudo ln -s /usr/lib/i386-linux-gnu/mesa/libGL.so.1 /usr/lib/i386-linux-gnu/libGL.so
That’s it on the package side of things.
You guessed it, time for more Terminal. This really is the easiest way, seriously. And it’s totally worth it when you’re basking in the glory of a bunch of people on XDA.
The binary for a program called “repo” will let you talk to git servers and download all that precious source code. That second part after the && allows it to be executable:
Code:
PHP:
mkdir ~/bin && curl http://commondatastorage.googleapis.com/git-repo-downloads/repo > ~/bin/repo && chmod a+x ~/bin/repo
Use your favorite text editor to open ~/.bashrc
I like nano:
Code:
PHP:
sudo nano ~/.bashrc
At the very bottom, add the following line:
Code:
PHP:
export PATH=~/bin:$PATH
Save it. In nano that would be Ctrl-O and then Enter. Then Ctrl-X to exit back to a prompt. Restart bash:
Code:
PHP:
source ~/.bashrc
Set up android sdk
Refer this guide. Go only to sdk section.
http://forum.xda-developers.com/showthread.php?t=2302780
3. Downloading source
Open terminal
To initialize your local repository using the your Rom trees, use a command like this:
HTML:
mkdir cm11
cd cm11
Repositories of famous roms. Choose one:
HTML:
repo init -u git://github.com/CyanogenMod/android.git -b cm-11.0
repo init -u git://github.com/AOKP/platform_manifest.git -b kitkat
repo init -u git://github.com/ResurrectionRemix/platform_manifest.git -b kitkat1
Of course you have to make rom specific changes as they are not supported yet. But will be in near FUTURE. I Will highlight rom specific changes in second post.
Create local_manifest.xml in .repo folder.
PHP:
cd .repo
nano local_manifest.xml
Paste following into the terminal
PHP:
<?xml version="1.0" encoding="UTF-8"?>
<manifest>
<project path="device/micromax/a110" name="Ateekujjawal/android_device_micromax_a110" remote="github" revision="cm-11.0" />
<project path="kernel/micromax/a110" name="Ateekujjawal/android_kernel_micromax_a110" remote="github" revision="cm-11.0" />
</manifest>
Save it. In nano that would be Ctrl-O and then Enter. Then Ctrl-X to exit back to a prompt. Restart bash.
Then to sync up:
HTML:
repo sync -j#
# is number of jobs you want to give for your downloading source. I use 2.
Download gonna be huge. Approx 12-15 GB.
So its gonna take while depending upon your internet connection.
You may get errors while downloading, like
HTML:
Sync exited due to fetch errors
Just restart download by
HTML:
repo sync
Let's extract those vendors.
HTML:
cd cm11
cd /device/micromax/a110
./extract-files.sh
Starting Building process
PHP:
. build/envsetup.sh && time brunch a110 -j#
Again # is meant for No. of CPU cores you have.
Building gonna take time, depending upon your computer configuration.
Any errors, post here.
I will try my best to solve problems .
Start building your own CM11...
Any suggestion welcome.
Sent from my GT-I9082 using Tapatalk Pro.
R1
Sent from my GT-I9082 using Tapatalk Pro.
R2
Sent from my GT-I9082 using Tapatalk Pro.
R3
Sent from my GT-I9082 using Tapatalk Pro.
Great also add to get android SDK...
We forgot that remember....??
Also add ther android touch files ..
Without that adb won't work...
More mistakes ...edit it through buddy...
Avenger4droid said:
Great also add to get android SDK...
We forgot that remember....??
Also add ther android touch files ..
Without that adb won't work...
More mistakes ...edit it through buddy...
Click to expand...
Click to collapse
If error comes, then no. Don't tell me. Plus in that link the error fixation is there. At least hit Thanks.
Sent from my GT-I9082 using Tapatalk Pro.
wow. gud one. bookmarked for future reference
So now are you going yo build ROM or we have to build by our self....????
talhask said:
So now are you going yo build ROM or we have to build by our self....????
Click to expand...
Click to collapse
Patience bro. We are building. But you know our pc crashed. So it is gonna take time. If you want to build any other rom, then you can follow this guide. I wouldn't say it is noob friendly but it's a Kickstart.
Sent from my GT-I9082 using Tapatalk Pro.
okay on my way to to download source again new expected date of release is 24 th of march...
hope this time no bad thing happens...
now those wanna try this method i say wait for a couple days as till then i will release and check wheteher its working or not...
:good::good:
regards..
i can see if i can find a good build server then it is easy

[GUIDE][AOSP][WIP] Build android from source on windows 10

CURRENT STATUS: can compile android kernel successfully, right now cant compile complete rom.
Edition: Windows 10
Version: 1607
OS Build: 14393.222
===========================================
REQUIREMENTS
===========================================​
1) Windows 10 64-Bit with Anniversary Update
===========================================
Setting up ubuntu bash on windows 10
===========================================​
1) open the Settings --> Update & Security --> For Developers--> enable Developer Mode
2) search for “Turn Windows Features On or Off” in cortana & hit enter
3) Enable the “Windows Subsystem for Linux (Beta)” option in the list and click “OK.” & restart your system
4) search for “bash” in cortana & hit enter
5) type "y" & hit enter
6) download of ubuntu for windows 10 will start. It will take some time depending on your internet speed. You’ll be asked to create a user account and password for use in the Bash environment. restart your system
7) search for “Bash on Ubuntu on Windows” in cortana & hit enter
8) congratulations you have successfully installed bash on windows 10
9) OPTIONAL
add bash to context menu (developer is Manouchehri)
install this reg entry,... Accept the warnings and import it.
===========================================
Setting up a Linux build environment
===========================================​
1) open “Bash on Ubuntu on Windows”
Code:
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install default-jdk
sudo apt-get install android-tools-adb android-tools-fastboot
Code:
sudo apt-get install git-core gnupg flex bison gperf build-essential \
zip curl zlib1g-dev gcc-multilib g++-multilib libc6-dev-i386 \
lib32ncurses5-dev x11proto-core-dev libx11-dev lib32z-dev ccache \
libgl1-mesa-dev libxml2-utils xsltproc unzip python-networkx
===========================================
How To's
===========================================​
warning 1: do not edit your linux files i.e. "C:\Users<username>\AppData\Local\lxss" in windows,... it will make the files useless in bash... never add files or edit files of linux subsystem from windows,....
Solution: copy the files out of linux sub system i.e. "lxss", edit them, then use bash to move the files back to "lxss"
---------------------------------------------------------------------
warning 2: Do not mnt and download android source,... download the source in linux subsystem (inside lxss) only...
---------------------------------------------------------------------
Problem: where are my ubuntu files
Solution: All your bash files are located in "C:\Users<username>\AppData\Local\lxss\rootfs". your home directory is located in "C:\Users<username>\AppData\Local\lxss\home"
---------------------------------------------------------------------
Problem: sudo: unable to resolve host
Solution: delete hosts file of ubuntu, it will auto generate the next time you open “Bash on Ubuntu on Windows" (C:\Users\<username>\AppData\Local\lxss\rootfs\etc\hosts)
---------------------------------------------------------------------
Problem: Java 8 doesn't install or work
Solution: know bug. use the following code. it will install java 7
Code:
sudo apt-get install default-jdk
---------------------------------------------------------------------
Problem: how to access windows files in bash
Solution: for example you want to navigate to downloads "C:\Users\<username>\Downloads"
Code:
cd /mnt/c/Users/<username>/Downloads
---------------------------------------------------------------------
Problem: repo not found or needs to be installed even after it was successful installed
Solution: use the following command
Code:
nano ~/.bashrc
add this at the end
Code:
PATH=~/bin:$PATH
press Ctrl+o & Ctrl+x
---------------------------------------------------------------------
Problem: can't mount my drive
Solution:: In order for a drive to show up under /mnt/ it must meet the following criteria:
1. The drive must be a fixed drive
2. The drive must be formatted to NTFS
---------------------------------------------------------------------
=======================================
*****still experimenting with bash, still have a few problems to successfully compile the rom,... will update if i find something
Move Home Ubuntu Directory
I can move ubuntu home directory from C to another drive?
@IacobIonut-DW
i am afraid you cant change it,.... there are duplicate files in ubuntu example lxss\text.txt & lxss Text.txt
if you try to copy the folder you will get a error message
It seems interesting I'm going to try it and will give you my feedback .
BTW , I've ubuntu installed along side with windows can I the files on ubuntu partition with the bash installed on windows ?
@LahKeda
No you can't read that drive
Nice to see that guide, great work!
But I am stuck at this point currently: stackoverflow | Bash on Ubuntu on Windows, Compile AOSP.
My strace file says about the same thing.
Did you find any solution to this?
@Spartaner25
did you try to edit files of linux or files of your build in windows???
Wow thanks!
But one question: Is it just another virtualization ? I mean is it faster than an Ubuntu installed inside a VM ?
For performance of bash on windows vs native Ubuntu read this
chiragkrishna said:
@Spartaner25
did you try to edit files of linux or files of your build in windows???
Click to expand...
Click to collapse
I did not touch any files of the linux base (lxss) in either the windows explorer or the bash and I did not modified anything inside the Windows Folder.
But I upgraded the system via apt update/upgrade which should not be destructive (I hope).
My target was a regular aosp build with the tag android-6.0.1_r58, I only changed a few linies in some files in frameworks/base via nano and added a device and kernel folder which was all done inside the bash.
Spartaner25 said:
I did not touch any files of the linux base (lxss) in either the windows explorer or the bash and I did not modified anything inside the Windows Folder.
But I upgraded the system via apt update/upgrade which should not be destructive (I hope).
My target was a regular aosp build with the tag android-6.0.1_r58, I only changed a few linies in some files in frameworks/base via nano and added a device and kernel folder which was all done inside the bash.
Click to expand...
Click to collapse
Try building only the kernel and see if it builds correctly!!
chiragkrishna said:
Try building only the kernel and see if it builds correctly!!
Click to expand...
Click to collapse
Thanks for the hint, the kernel builds fine.
By the way, building CyanogenMod gets stuck here for me.
Windows Insider Preview for those in Fast Ring
Ubuntu 16.04 Arrives With New Windows 10 Build 14936
change log
I'm currently on this version with ubuntu 16.04 and it's getting better.
Currently the build (aosp and cm) ist stuck on the bison binary which is a prebuilt 32-bit ELF, which can not be executed.
It might be possible to replace the prebuilts with their 64-bit variants.
@chiragkrishna upon using
Code:
sudo apt-get install git-core gnupg flex bison gperf build-essential \
zip curl zlib1g-dev gcc-multilib g++-multilib libc6-dev-i386 \
lib32ncurses5-dev x11proto-core-dev libx11-dev lib32z-dev ccache \
libgl1-mesa-dev libxml2-utils xsltproc unzip python-networkx
I get the following errors: Unable to locate package zip, lib32ncurses5-dev, libgl1-mesa-dev.
Edit: Fixed by removing the '\' from all lines.
does anyone know how to solve this error?
ionice: ioprio_set failed: Invalid argument
I have been able to successfully build cm-13.0 on Windows 10. I haven't been successful with cm-12.1, since it builds 32-bit binaries for the host executables for some reason.
The fixes I had to do:
Recompile flex and bison as 64-bit binaries according to the instructions in their source directory (github btongminh/android_prebuilts_misc)
Disable futexes in Art (github btongminh/android_art)
Disable v8 snapshots, since it is only possible to make snapshots for 32-bit targets on a 32-bit host (github btongminh/android_v8)
The build for Xiaomi Redmi 3 (ido) was successful, flashed it and it booted into Android Unfortunately after that the launcher kept on crashing, but is looks like I'm almost there.
Ayush1325 said:
does anyone know how to solve this error?
ionice: ioprio_set failed: Invalid argument
Click to expand...
Click to collapse
Build with "make bacon" instead of brunch or mka
btongminh said:
I have been able to successfully build cm-13.0 on Windows 10. I haven't been successful with cm-12.1, since it builds 32-bit binaries for the host executables for some reason.
Build with "make bacon" instead of brunch or mka
Click to expand...
Click to collapse
How do you make a user build signed with release keys instead of a userdebug build signed with testkeys??
EDIT: Well my normal make build failed
Please note I'm trying to compile Lineage OS 14.1
Code:
[ 1% 675/34224] Generating TOC: /root...core-all_intermediates/classes.jar.toc
FAILED: /bin/bash -c "(/root/out/host/linux-x86/bin/ijar /root/out/target/common/obj/JAVA_LIBRARIES/core-all_intermediates/classes.jar /root/out/target/common/obj/JAVA_LIBRARIES/core-all_intermediates/classes.jar.toc.tmp ) && (if cmp -s /root/out/target/common/obj/JAVA_LIBRARIES/core-all_intermediates/classes.jar.toc.tmp /root/out/target/common/obj/JAVA_LIBRARIES/core-all_intermediates/classes.jar.toc ; then rm /root/out/target/common/obj/JAVA_LIBRARIES/core-all_intermediates/classes.jar.toc.tmp ; else mv /root/out/target/common/obj/JAVA_LIBRARIES/core-all_intermediates/classes.jar.toc.tmp /root/out/target/common/obj/JAVA_LIBRARIES/core-all_intermediates/classes.jar.toc ; fi )"
ftruncate(fd_out, GetSize()): Invalid argument
/bin/bash: line 1: 7115 Aborted (core dumped) ( /root/out/host/linux-x86/bin/ijar /root/out/target/common/obj/JAVA_LIBRARIES/core-all_intermediates/classes.jar /root/out/target/common/obj/JAVA_LIBRARIES/core-all_intermediates/classes.jar.toc.tmp )
ninja: build stopped: subcommand failed.
build/core/ninja.mk:151: recipe for target 'ninja_wrapper' failed
make: *** [ninja_wrapper] Error 1
#### make failed to build some targets (13:50 (mm:ss)) ####
It looks like I'm having the same error as this person. https://forum.xda-developers.com/lineage/help/building-lineageos-cancro-xiaomi-mi3w-t3530766
What Java version are you using (java -v). LineageOS 14.1 requires Java 1.8.
Link_of_Hyrule said:
Code:
[ 1% 675/34224] Generating TOC: /root...core-all_intermediates/classes.jar.toc
FAILED: /bin/bash -c "(/root/out/host/linux-x86/bin/ijar /root/out/target/common/obj/JAVA_LIBRARIES/core-all_intermediates/classes.jar /root/out/target/common/obj/JAVA_LIBRARIES/core-all_intermediates/classes.jar.toc.tmp ) && (if cmp -s /root/out/target/common/obj/JAVA_LIBRARIES/core-all_intermediates/classes.jar.toc.tmp /root/out/target/common/obj/JAVA_LIBRARIES/core-all_intermediates/classes.jar.toc ; then rm /root/out/target/common/obj/JAVA_LIBRARIES/core-all_intermediates/classes.jar.toc.tmp ; else mv /root/out/target/common/obj/JAVA_LIBRARIES/core-all_intermediates/classes.jar.toc.tmp /root/out/target/common/obj/JAVA_LIBRARIES/core-all_intermediates/classes.jar.toc ; fi )"
ftruncate(fd_out, GetSize()): Invalid argument
/bin/bash: line 1: 7115 Aborted (core dumped) ( /root/out/host/linux-x86/bin/ijar /root/out/target/common/obj/JAVA_LIBRARIES/core-all_intermediates/classes.jar /root/out/target/common/obj/JAVA_LIBRARIES/core-all_intermediates/classes.jar.toc.tmp )
ninja: build stopped: subcommand failed.
build/core/ninja.mk:151: recipe for target 'ninja_wrapper' failed
make: *** [ninja_wrapper] Error 1
#### make failed to build some targets (13:50 (mm:ss)) ####
Click to expand...
Click to collapse
I've committed a fix to fix this problem, you can find it here:
https://github.com/imReker/bazel/commit/d2f16b573e0a77653454e64f124e0c4bab3b0fd7

Categories

Resources