How to rebuild a package after full build for specific device? - Android

I've been racking my brain about this for a while now (whenever I've had some spare time over the past week or so) and scouring the internets in search of an answer but either I'm not very good at searching, or there aren't very many people doing what I'm doing that do not already know the answer to my question.
Here's what I would like to do. I have completed a full build of AOKP for my device (GSII Skyrocket). If I were to make an edit to a system app package, Contacts in particular, how can I rebuild the package without redoing an entire build? I am aware of the "mmm" command, but if I run
Code:
$ mmm packages/apps/Contacts
$ make packages/apps/Contacts
$ make Contacts
or any derivation of that command, it defaults to building:
PLATFORM_VERSION=4.0.4
TARGET_PRODUCT=full
TARGET_BUILD_VARIANT=eng
TARGET_BUILD_TYPE=release
TARGET_BUILD_APPS=
TARGET_ARCH=arm
TARGET_ARCH_VARIANT=armv7-a
HOST_ARCH=x86
HOST_OS=linux
HOST_BUILD_TYPE=release
BUILD_ID=IMM76I
which then immediately craps out because it's building for a generic product which has no kernel source configured:
Code:
make: Entering directory `/home/m4570d0n/AOKP'
build/core/tasks/kernel.mk:53: **********************************************************
build/core/tasks/kernel.mk:54: * Kernel source found, but no configuration was defined *
build/core/tasks/kernel.mk:55: * Please add the TARGET_KERNEL_CONFIG variable to your *
build/core/tasks/kernel.mk:56: * AndroidBoard.mk file *
build/core/tasks/kernel.mk:57: **********************************************************
build/core/tasks/kernel.mk:58: *** "NO KERNEL CONFIG". Stop
make: Leaving directory `/home/m4570d0n/AOKP'
When I was building CM9 it would actually make a Contacts.apk in /out/target/product/generic, but even then it was mdpi, odexed, and pretty much garbage.
What I'm trying to figure out (and rather surprised that I haven't found more info on it yet), is what configuration changes do I have to make or flags that I have to set so that I can just rebuild Contacts in the same way it would get built if I were doing a full build for the skyrocket so that I can incorporate the changes I made to the Contacts package? (Obviously this question would apply for any device, I'm just using the Skyrocket as an example since that's the device for which I'm building.)
On a similar note, if I can get that first question resolved, can I just add:
Code:
LOCAL_AAPT_FLAGS := -c xhdpi -x 10
to my Android.mk for Contacts if I wanted to build contacts with xhdpi resources? Would that work?
this is probably the most useful info I've come across (in addition to the stuff on developer.android.com) but it seems like some of it is now outdated and I'm not sure if it addresses my particular question.
http://www.jokersax.com/dev-guides/android-building-faqs/
http://elinux.org/Android_aapt
Any help would be much appreciated.

Just type.
make Contacts
Sent from my Galaxy Nexus using xda premium

As I mentioned in my post, I have tried that.

m4570d0n said:
As I mentioned in my post, I have tried that.
Click to expand...
Click to collapse
Well that's how you build just one app.
Sent from my Galaxy Nexus using xda premium

lithid-cm said:
Well that's how you build just one app.
Sent from my Galaxy Nexus using xda premium
Click to expand...
Click to collapse
I am aware. That was not my question though. That command by itself will build one app by looking to build/target/product/full.mk which has:
$(call inherit-product, $(SRC_TARGET_DIR)/product/full_base_telephony.mk)
$(call inherit-product, $(SRC_TARGET_DIR)/board/generic/device.mk)
PRODUCT_NAME := full
PRODUCT_DEVICE := generic
PRODUCT_BRAND := Android
PRODUCT_MODEL := Full Android on Emulator
That's not going to work. What I'm trying to do is build it so that it looks to my device configuration which would be this:
$(call inherit-product, $(SRC_TARGET_DIR)/product/full_base_telephony.mk)
$(call inherit-product, device/samsung/skyrocket/device.mk)
PRODUCT_NAME := full_skyrocket
PRODUCT_DEVICE := skyrocket
PRODUCT_BRAND := samsung
PRODUCT_MANUFACTURER := samsung
PRODUCT_MODEL := SAMSUNG-SGH-I727

Then use lunch and select your device. Maybe I'm just not understanding why you are doing so strange.
Sent from my Galaxy Nexus using xda premium

I'm not trying to do an entire build though. That's exactly what I'm trying to avoid. I just want to rebuild one package based on my device configuration and current built sources in /out. I am not trying to make an app for a generic device/board to run on an emulator, which is what the "make Contacts" command will try to do by default.

m4570d0n said:
I'm not trying to do an entire build though. That's exactly what I'm trying to avoid. I just want to rebuild one package based on my device configuration and current built sources in /out. I am not trying to make an app for a generic device/board to run on an emulator, which is what the "make Contacts" command will try to do by default.
Click to expand...
Click to collapse
I do what you are all the time. For example. I make clean and clobber. Use lunch to load my device and build a specific app. I like my Mms with the holo dark theme and built just that. IRS possible you will come into errors while building though if that app needs other files compiled. If you are trying to make an app more "universal" do a port and build it in eclipse against the framework you need to.
Sent from my Galaxy Nexus using xda premium

oh wow. I'm retarded. I usually use brunch or use lunch aokp_skyrocket-userdebug && mka bacon 2> warn.log
or something like that. For some reason I was thinking that after I used lunch and selected my device it would automatically start doing an entire build. That worked though. Thank you!
Now, I had that LOCAL_AAPT_FLAG in the Android.mk for Contacts, but it still built the apk with hdpi resources. How might I be able to flag it to use xhdpi instead? The reason I ask is that I know that this build will work on the Galaxy Note even with the hdpi images, but would like to build a version with xhdpi instead.

I am not sure I understand clearly, but how exactly did you manage to go past
Code:
build/core/tasks/kernel.mk:68: **********************************************************
build/core/tasks/kernel.mk:69: * Kernel source found, but no configuration was defined *
build/core/tasks/kernel.mk:70: * Please add the TARGET_KERNEL_CONFIG variable to your *
build/core/tasks/kernel.mk:71: * BoardConfig.mk file *
build/core/tasks/kernel.mk:72: **********************************************************

toxicthunder said:
I am not sure I understand clearly, but how exactly did you manage to go past
Code:
build/core/tasks/kernel.mk:68: **********************************************************
build/core/tasks/kernel.mk:69: * Kernel source found, but no configuration was defined *
build/core/tasks/kernel.mk:70: * Please add the TARGET_KERNEL_CONFIG variable to your *
build/core/tasks/kernel.mk:71: * BoardConfig.mk file *
build/core/tasks/kernel.mk:72: **********************************************************
Click to expand...
Click to collapse
Let's say I want to build Contacts.apk from CM10 for the Skyrocket. The commands would be:
Code:
. /build/envsetup.sh
lunch cm_skyrocket-userdebug
make Contacts
It will build Contacts.apk and put it in the /out/target/produce/skyrocket/system/app/ directory.
My confusion when I created this thread was that I thought the lunch [device] command would start the build like the brunch command does, but all it does is essentially load the build configuration for the device. The "mka bacon" command is what will start a full build. The lunch command is the same as the breakfast command, except you can select devices that are not officially supported. The brunch command is the equivalent of "breakfast [device] && mka bacon".
That said, I'm not sure if the squisher and opticharger scripts are run when you build just one package this way, but my guess is that they are not.

glad its all working out

Related

[Q] Changing/Compiling Cyanogenmod 9 Lockscreen

So I'm working on some lock screen stuff in frameworks/base/policy/src/com/android/internal/policy/impl/ for CyanogenMod 9, and I was wondering how I would go about compiling it? Would I just run something like `make -j4 impl`, like I would for something like SystemUI? Then how would I go about applying it to my device?
Sorry for the noob question, but thanks for the help!
Chiggins said:
So I'm working on some lock screen stuff in frameworks/base/policy/src/com/android/internal/policy/impl/ for CyanogenMod 9, and I was wondering how I would go about compiling it? Would I just run something like `make -j4 impl`, like I would for something like SystemUI? Then how would I go about applying it to my device?
Sorry for the noob question, but thanks for the help!
Click to expand...
Click to collapse
If you look here:
https://github.com/CyanogenMod/android_frameworks_base/tree/gingerbread/policy
You will see Android.mk
Code:
LOCAL_PATH:= $(call my-dir)
# the library
# ============================================================
include $(CLEAR_VARS)
LOCAL_SRC_FILES := $(call all-java-files-under, src)
LOCAL_MODULE := android.policy
include $(BUILD_JAVA_LIBRARY)
# additionally, build unit tests in a separate .apk
include $(call all-makefiles-under,$(LOCAL_PATH))
The local module you will need to call this is "android.policy"
It will build what it needs to. When it finishes compiling you will see a list of "Install:" Push those to your phone.
Code:
make -j$ android.policy
So to my understanding, if something that I'm working on has an Android.mk by it, I could build JUST that thing using the name defined by LOCAL_MODULE, right?
Chiggins said:
So to my understanding, if something that I'm working on has an Android.mk by it, I could build JUST that thing using the name defined by LOCAL_MODULE, right?
Click to expand...
Click to collapse
Yup just about. There might be issues at some point... but I have never had issues testing bits like this.
Alright sweet deal, thanks mate!

[Q] Problem with CWM recovery when building AOKP from source

So I decided to lean how to build AOKP from source. I referenced other developers Github's and multiple tutorials. I finally manged to create a good device and vendor tree and successfully build AOKP from source. All is good, or so I thought. When I attempted to perform my first CWM backup, I was prompted (at the end) with the error message "MD5 error". Looking into the recovery log shows that the script nandroid-md5.sh was not found.
So, I check my build output, "out/target/product/i777/recovery/root/sbin" and discover that the script is missing. Next I start to dig into the bootable/recovery project. I evaluate the Android.mk file and I find the following:
Code:
include $(CLEAR_VARS)
LOCAL_MODULE := nandroid-md5.sh
LOCAL_MODULE_TAGS := optional
LOCAL_MODULE_CLASS := RECOVERY_EXECUTABLES
LOCAL_MODULE_PATH := $(TARGET_RECOVERY_ROOT_OUT)/sbin
LOCAL_SRC_FILES := nandroid-md5.sh
include $(BUILD_PREBUILT)
So the make file should include the script in the build, but I can't figure out what is missing. I've done the following without success.
Rebuilt with an earlier version (6.0.1.5) of CWM recovery.
Evaluated other devices to see if I'm missing something in my device/vendor trees.
Checked AOKP & CM forums for anyone reporting similar issues.
Built a supported device i9100 and the same problem occurs.
Now, I've found a workaround, but it seems more like a hack. If I include the following line in one of my make files, then the file will get copied.
Code:
PRODUCT_COPY_FILES += \
bootable/recovery/nandroid-md5.sh:recovery/root/sbin/nandroid-md5.sh
I'm hoping that someone can help me understand why my build is having this problem.

[GUIDE] How to build a kernel for the Galaxy Player

After numerous requests I've received from users concerning how-to build kernels, this guide will mostly answer your need to do so.
This guide will be separated in 3 distinct parts: Downloading sources, Building the actual kernel and making a working boot image and or zImage. So let's begin!!
Requirements: A linux computer
Part 1: Downloading sources
Before bulding any kernels, you must have it's source code. Every Android device manufacturers have the OBLIGATION to post them in order to comply with the GPL (GNU General Public License). You can mostly find them in their developpers specified site. You have two ways of download the required source in order to build a kernel: The manufacturer website or git.
1.1: Downloading using the manufacturer's website
You can download your Galaxy Player kernel source using mostly this website: opensource.samsung.com
When you're in it, you can go to the MP3 players section and take the source according to your device. To get the kernel source, unzip the xxxopensource.zip and you should see 2 separate files. Unzip the one with the mention KERNEL in it, it is your kernel.
1.2: Using git
Some of you may know it, some others not. For those who don't know what git is, here's a little explication from it's website
Git is a free and open source distributed version control system designed to handle everything from small to very large projects with speed and efficiency.
Click to expand...
Click to collapse
A lot of developpers from around the world do use git because of it ease of use. There are several websites that uses the git protocol. The two most known are github and gitbucket. In order to download your kernel source, you must have found someone who uploaded it into these websites. For this example we will use the Cyanogenmod github's profile. You can download the source with 2 ways:
First way
1. Go into a existing kernel source repository (for example this one: https://github.com/CyanogenMod/android_kernel_samsung_aries)
2. Click the Download zip button situated at the mid-right
3. Unzip the zip and you should find your kernel source.
Note: When using this method, you must be sure of the branch choosen. Problems can happen if the wrong branch is used.
Second way
Note: You must have the git dependencies for linux. To download them for Debian, Ubuntu, please run this command: sudo apt-get install git-core, gnupg, flex, bison, gperf, libsdl-dev, libesd0-dev, libwxgtk2.6-dev, build-essential, zip, curl, libncurses5-dev, zlib1g-dev, ia32-libs, lib32z1-dev, lib32ncurses5-dev, gcc-multilib, g++-multilib
1. Go into a existing kernel source repository (https://github.com/CyanogenMod/android_kernel_samsung_aries)
2. We're going to "clone" the repository, to do so you will so this particular command:
Code:
git clone https://github.com/CyanogenMod/android_kernel_samsung_aries.git aries
(the second aries word will be the name of the actual folder)
If you want to download another branch (because the one downloaded is the one shown in the website)
Code:
git clone https://github.com/CyanogenMod/android_kernel_samsung_aries.git -b jellybean aries
(where's the -b means branch)
You should have your kernel source named aries output in the folder you specified.
Second part will cover mostly how to build a kernel.
Part 2 Building an actual kernel
In order to build a kernel, you must use an arm toolchain.
The GNU toolchain is a blanket term for a collection of programming tools produced by the GNU Project.
Click to expand...
Click to collapse
Here's a zip containing the arm-eabi-4.4.3 and arm-androideabi-4.6 toolchains
Toolchains Download
2.1 Exporting the toolchain path
Once you've downloaded a toolchain and are ready to build the kernel source into a kernel binary, enter to the directory of that said kernel, (cd aries in this case). You must export the location of your toolchain so the kernel source can know from where it has to build. To do so:
For arm-eabi-4.4.3
Code:
"export CROSS_COMPILE=~/home/yourusername/toolchains/arm-eabi-4.4.3/bin/arm-eabi-"
"export ARCH=arm"
For arm-linux-androideabi-4.6
Code:
"export CROSS_COMPILE=~/home/yourusername/toolchains/arm-linux-androideabi-4.6/bin/arm-linux-androideabi-"
"export ARCH=arm"
2.2 Using a config file
In order to build a kernel, you MUST use a config file which defines the device's components. The easiest way of doing so is to take the manufacturer's stock configuration file (generaly it's a defconfig file found in arch/arm/configs). To create one, you use the make menuconfig command while in your kernel root directory. If you use a different source than your manufacturer one, You have to either ask the developper or to search for this file. (I can't say really much about it ).
2.3 Building the kernel
Once you've your config file and toolchain set up, you can begin the build. To do so you execute these command:
Code:
make cyanogenmod_galaxys_defconfig (This is just as a example, replace it by whatever your defconfig is)
make -jx (x is the number of jobs your computer can do a the same time. The recommended way to know how many to use is to take the number of cores in your CPU +1
Depending on the number of threads (jobs) used, it will be either long or not to compile your kernel. (Generally it takes between 5-15 minutes to compile a single kernel).
Once your kernel have been built, you will have it into the form of a file named zImage situated in arch/arm/boot. This kernel is usable for some devices, however it is not usable for ours. DO NOT EVER EVER FLASH THIS BINARY. I'M NOT RESPONSIBLE FOR ANY BRICKS!!
The third part will help you getting a bootable kernel for your device.
Part 3: Making a bootable kernel
Note: This is a in-progress part so it may be unclear to some people. I will try to do it as much as understandable for everybody.
The kernel binary obtained at the second post is mostly not bootable due to the the fact that the initramfs isn't inclued. The initramfs is the actual ramdisk of your device. To find one... well you must find it (I can't really do anything for you). If you do have one initramfs in a folder, you must specify it in the config file with this current line:
Code:
CONFIG_INITRAMFS_SOURCE=""
Once this has been applied, you can make build this kernel and it should boot
Note that this applies mostly to the model of the 4.0 and 5.0 (and for GB as well). 3.6 and 4.2 uses a different method of using a boot image
One last time...
thanks!! really gonna try this sometimes!!! (once you get part two and three out of the tutorial XD )
If someone is interested in the config file for the Galaxy Player 3.6, he can find it on my GitHub: http://www.github.com/team-hurricane-xda.
How to set it up:
0. Download the config file
1. Rename the config file to aalto-deconfig
2. Copy the file to <kernelsource>/arch/arm/config
3. cd ~/path/to/kernel
4. make aalto-deconfig
5. make
MrBrubble
Sent from my YP-GS1 using xda app-developers app
Build_Error
I've searched and haven't found a straight answer, i get the same build error on every kernel i try to build. Even on this one. Any help is appreciated.
Code:
make: /home/alex/home/alexandroid_toolchains/arm-eabi-linaro-4.6.2gcc: Command not found
scripts/kconfig/conf --silentoldconfig Kconfig
make: /home/alex/home/alexandroid_toolchains/arm-eabi-linaro-4.6.2gcc: Command not found
CHK include/linux/version.h
UPD include/linux/version.h
CC scripts/mod/empty.o
/bin/sh: 1: /home/alex/home/alexandroid_toolchains/arm-eabi-linaro-4.6.2gcc: not found
make[2]: *** [scripts/mod/empty.o] Error 127
make[1]: *** [scripts/mod] Error 2
make[1]: *** Waiting for unfinished jobs....
HOSTCC scripts/selinux/genheaders/genheaders
HOSTCC scripts/selinux/mdp/mdp
make: *** [scripts] Error 2
make: *** Waiting for unfinished jobs..
This is in: file system/usr/include/linux>version.h
#define LINUX_VERSION_CODE 197895
#define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))
Anything in particular that should be here?
Also I have tried to use the linaro toolchains and the one included in the ndk.
2.1 Exporting the toolchain path
Once you've downloaded a toolchain and are ready to build the kernel source into a kernel binary, enter to the directory of that said kernel, (cd aries in this case). You must export the location of your toolchain so the kernel source can know from where it has to build. To do so:
For arm-eabi-4.4.3
Code:
"export CROSS_COMPILE=~/home/yourusername/toolchains/arm-eabi-4.4.3/bin/arm-eabi-"
"export ARCH=arm"
For arm-linux-androideabi-4.6
Code:
"export CROSS_COMPILE=~/home/yourusername/toolchains/arm-linux-androideabi-4.6/bin/arm-linux-androideabi-"
"export ARCH=arm"
2.2 Using a config file
Can you please explain where I need to put the folders/files to make this cmd work. I am using windows7 if that helps. I currently have them in the C:\ thanks. I am hung up here and would greatly appreciate some extra guidance.
po8pimp said:
2.1 Exporting the toolchain path
Once you've downloaded a toolchain and are ready to build the kernel source into a kernel binary, enter to the directory of that said kernel, (cd aries in this case). You must export the location of your toolchain so the kernel source can know from where it has to build. To do so:
For arm-eabi-4.4.3
Code:
"export CROSS_COMPILE=~/home/yourusername/toolchains/arm-eabi-4.4.3/bin/arm-eabi-"
"export ARCH=arm"
For arm-linux-androideabi-4.6
Code:
"export CROSS_COMPILE=~/home/yourusername/toolchains/arm-linux-androideabi-4.6/bin/arm-linux-androideabi-"
"export ARCH=arm"
2.2 Using a config file
Can you please explain where I need to put the folders/files to make this cmd work. I am using windows7 if that helps. I currently have them in the C:\ thanks. I am hung up here and would greatly appreciate some extra guidance.
Click to expand...
Click to collapse
zaclimon said:
...
Requirements: A linux computer
...
Click to expand...
Click to collapse
It's in the OP
seriously I must have totally missed that, I read it over again just to make sure. I will try it again in Ubuntu. Thanks for such a quick reply and apologize for my ignorance. Most things are compiled using Linux, however some I have been doing with windows lately so my assumptions got the best of me it seems. Thanx again
Ok so I am at the point where I need to make the Kernel. I am at this point:
make cyanogenmod_galaxys_defconfig (This is just as a example, replace it by whatever your defconfig is)
My question is which .defconfig do I use and how can I find the current one running on my device? I am assuming the best to fit all different platforms would be to chose the "android_hugo_r03_eng_defcongfig". Is this correct. I currently own the USA model if that helps. However I want to be able to help out all models without building 3 different kernels. Thank you in advance.
Here are the options available:
android_hugop2p_r01_eng_defcongfig
android_hugop2p_r01_user_defcongfig
android_hugop2p_r02_eng_defcongfig
android_hugop2p_r02_user_defcongfig
android_hugop2p_r03_eng_defcongfig
android_hugop2p_r03_user_defcongfig
android_hugo_r01_eng_defcongfig
android_hugo_r01_user_defcongfig
android_hugo_r02_eng_defcongfig
android_hugo_r02_user_defcongfig
android_hugo_r03_eng_defcongfig
android_hugo_r03_user_defcongfig
android_hugo_r03_eng_EUR_defcongfig
android_hugo_r03_user_EUR_defcongfig
android_hugo_r03_eng_KOR_defcongfig
android_hugo_r03_user_KOR_defcongfig
android_hugo_r03_eng_USA_defcongfig
android_hugo_r03_user_USA_defcongfig
po8pimp said:
Ok so I am at the point where I need to make the Kernel. I am at this point:
make cyanogenmod_galaxys_defconfig (This is just as a example, replace it by whatever your defconfig is)
My question is which .defconfig do I use and how can I find the current one running on my device? I am assuming the best to fit all different platforms would be to chose the "android_hugo_r03_eng_defcongfig". Is this correct. I currently own the USA model if that helps. However I want to be able to help out all models without building 3 different kernels. Thank you in advance.
Here are the options available:
android_hugop2p_r01_eng_defcongfig
android_hugop2p_r01_user_defcongfig
android_hugop2p_r02_eng_defcongfig
android_hugop2p_r02_user_defcongfig
android_hugop2p_r03_eng_defcongfig
android_hugop2p_r03_user_defcongfig
android_hugo_r01_eng_defcongfig
android_hugo_r01_user_defcongfig
android_hugo_r02_eng_defcongfig
android_hugo_r02_user_defcongfig
android_hugo_r03_eng_defcongfig
android_hugo_r03_user_defcongfig
android_hugo_r03_eng_EUR_defcongfig
android_hugo_r03_user_EUR_defcongfig
android_hugo_r03_eng_KOR_defcongfig
android_hugo_r03_user_KOR_defcongfig
android_hugo_r03_eng_USA_defcongfig
android_hugo_r03_user_USA_defcongfig
Click to expand...
Click to collapse
In your case, it is more than just using different configs, sometimes there are more than one config because the different variants of the device uses drivers for other components. If you want to make 1 kernel for all the device, you need to modify it's source so that you can include all the variants drivers. Things like this requires a bit of comparing and programming skills.
I have the zImage created, now I need to make it bootable, can someone please fill me in on what is the next step. I have a bootable kernel to use as a shell if need be. Thank you in advance. This is for the 4.2 by the way.
EDIT: Figured it out I think. I am now running off a new kernel. How do I tell what the actual Kernel Version is? I used the toolchain provided here arm-eabi-4.4.3 to build it. Is there a way to know what the kernel version is from the toolchain?
---------- Post added at 11:04 AM ---------- Previous post was at 10:22 AM ----------
Looking at the readme in the folder for the toolchain, it says this is for ICS. If that is correct, then it is a step in the right direction. Here is the download link to the recovery/kernel
EDIT: removed link to kernel as it does not have wifi working.
po8pimp said:
I have the zImage created, now I need to make it bootable, can someone please fill me in on what is the next step. I have a bootable kernel to use as a shell if need be. Thank you in advance. This is for the 4.2 by the way.
EDIT: Figured it out I think. I am now running off a new kernel. How do I tell what the actual Kernel Version is? I used the toolchain provided here arm-eabi-4.4.3 to build it. Is there a way to know what the kernel version is from the toolchain?
---------- Post added at 11:04 AM ---------- Previous post was at 10:22 AM ----------
Looking at the readme in the folder for the toolchain, it says this is for ICS. If that is correct, then it is a step in the right direction.
Click to expand...
Click to collapse
Code:
cat /proc/version
Meticulus said:
Code:
cat /proc/version
Click to expand...
Click to collapse
thanks I will try that
EDIT: Linux version 2.6.35.7 (gcc version 4.4.3 (GCC))

[HOWTO][STEPBYSTEP] Build Rom From Source

I put this tutorial together in an attempt to create the most complete and easy to follow guide for building a ROM from source. Including steps for adding apps to your build, changing toolchains and more... The entire guide uses a single Linux terminal window from start to finish in an attempt to keep everything as user friendly as possible. Please feel free to PM me suggestions on where changes need be made.
If you find this guide helpful please press the Thanks button on my posts and rate the thread a 5.​
Prerequisites​1. This guide is for 64-bit, 32-bit machines will not work for building newer android versions, Ubuntu 12+ based machine, I run Linux Mint 15. Follow links at end of OP for alternate directions
Windows Users: Setup Ubuntu in Virtualbox Instructions
2. You need to know the location for your device, vendor, and kernel repos. This can be found fairly easily in the forum for your phone. Also take note of your phones codename.
For example the Optimus G is the e970 and its device repo can be found here https://github.com/CyanogenMod/android_device_lge_e970
Note*All terminal commands will be in Code boxes*
Part 1 - Setting Up The Build Environment​
Install Java JDK
Code:
sudo add-apt-repository ppa:webupd8team/java
Code:
sudo apt-get update
Lollipop Roms:
Code:
sudo apt-get install oracle-java7-installer
Kit-Kat Roms:
Code:
sudo apt-get install oracle-java6-installer
Installing required packages
Ubuntu 14 based:
Code:
sudo apt-get install bison g++-multilib git gperf libxml2-utils
Ubuntu 12 based:
Code:
sudo apt-get install git gnupg flex bison gperf build-essential \
zip curl libc6-dev libncurses5-dev:i386 x11proto-core-dev \
libx11-dev:i386 libreadline6-dev:i386 libgl1-mesa-glx:i386 \
libgl1-mesa-dev g++-multilib mingw32 tofrodos \
python-markdown libxml2-utils xsltproc zlib1g-dev:i386
Code:
sudo ln -s /usr/lib/i386-linux-gnu/mesa/libGL.so.1 /usr/lib/i386-linux-gnu/libGL.so
Set-up ccache This Is Optional
Code:
nano ~/.bashrc
Add these two lines
export USE_CCACHE=1
export CCACHE_DIR=<path-to-your-cache-directory>
Click to expand...
Click to collapse
Save and exit by pressing ctrl+x, selecting Y then enter.
Install ADB & Fastboot This is optional, as you may already have them working. If not, they're a good thing to have.
Code:
sudo add-apt-repository ppa:nilarimogard/webupd8
Code:
sudo apt-get update
Code:
sudo apt-get install android-tools-adb android-tools-fastboot
Setup Repo
Code:
mkdir ~/bin
Code:
PATH=~/bin:$PATH
Code:
curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
Code:
chmod a+x ~/bin/repo
Create working directory
Code:
mkdir [I][B]working-dir[/B][/I]
(Replace working-dir with whatever you'd like to call it, ie. aokp)
Code:
cd working-dir
Part 2 - Get Source​ROM Source
Choose which custom rom you are going to build and initialize the repo for it
Code:
repo init -u [I][B]chosen-manifest[/B][/I]
(Replace chosen-manifest appropriately from the list below)
AOKP: https://github.com/AOKP/platform_manifest.git -b Branch
Cyanogenmod: https://github.com/CyanogenMod/android.git -b Branch
CarbonDev: https://github.com/CarbonDev/android.git -b Branch
Liquid Smooth: https://github.com/LiquidSmooth/android.git -b Branch
Replace Branch with appropriate branch from github repo ie cm-10.2 or jb3
If unsure which branch click the link above to locate appropriate branch
Click to expand...
Click to collapse
Device Source
Go HERE and follow instructions on obtaining your device specific repos.
Sync the repo
Code:
repo sync
This will take a while as it downloads all the required source
Part 3 - Preparing Source​Before you're ready to build your source needs to be configured to include your device. This preparation varies slightly for different custom Roms.
Go HERE and follow instructions for your ROM choice
Part 4 - Edit Source​This Is Optional​This is where you can make edits to the source before building to suit your needs.
Go HERE and follow the instructions to tweak source
Part 5 - Building ROM​
Code:
. build/envsetup.sh
Code:
lunch
Locate your device on the list and enter appropriate number
Code:
make -j[B][I]# [/I][/B]otapackage
Replace # with the number of cores in your system (Is the number of jobs that will be done at once, more cores means more jobs)
Build Errors​
This can be hard, especially if you're new to programming languages and building. Meet Google your new best friend.
Here is a basic overview to get you started, and if no more at least googling in the right direction.
Finished​When it's done you're rom will be in working-dir/out/target/product/codename/
Enjoy.
I used these sites while making this guide
http://source.android.com/source/initializing.html
http://www.webupd8.org/2012/11/oracle-sun-java-6-installer-available.html
http://www.webupd8.org/2012/08/install-adb-and-fastboot-android-tools.html
Device Source​ As stated in the prerequisites you will need a device specific Device repo, Vendor repo, and Kernel repo. You can find links to them in the threads for your devices. Also take note of your device codename ie Nexus 4 is mako, Optimus G is gee.
There are two options for adding in device specific source, local manifest and git clone.
Local manifest syncs the device repos each time a repo sync is run. This is probably the better choice if you don't make edits and rely on the repo's maintainer for changes.
Git clone is a one time download of a specific repo to the directory indicated and is not affected by repo sync. This is probably the better choice if you make edits to the device source as they won't be over written or cause conflicts when syncing.
The local path for your phone's repos be device/manufacturer/codename, vendor/manufacturer/codename, kernel/manufacturer/codename regardless of method chosen.
Git Clone
Code:
git clone [B][COLOR="DarkOrange"]repo[/COLOR][/B] -b [B][COLOR="Magenta"]branch[/COLOR][/B] [B][COLOR=Lime]destination-path[/COLOR][/B]
here is and example for the vendor repo for the E973 from TeamPlaceHolder
git clone https://github.com/TeamPlaceholder/proprietary_vendor_lge_gee -b cm-10.2 vendor/lge/gee
Click to expand...
Click to collapse
Local Manifest
Code:
mkdir .repo/local_manifests
Code:
touch .repo/local_manifests/local_manifest.xml
Code:
nano .repo/local_manifests/local_manifest.xml
Add these lines replacing path, name and revision according to the repo's you are using.
This example is for E973 using TeamPlaceHolder repos, adding all device/vendor/kernel repos.
<?xml version="1.0" encoding="UTF-8"?>
<manifest>
<remote name="gh"
fetch="git://github.com/" />
<project path="kernel/lge/gee" name="TeamPlaceholder/android_kernel_lge_gee" remote="gh" revision="cm-10.2-merge" />
<project path="device/lge/geeb" name="TeamPlaceholder/android_device_lge_geeb" remote="gh" revision="cm-10.2" />
<project path="device/lge/gee-common" name="TeamPlaceholder/android_device_lge_gee-common" remote="gh" revision="cm-10.2" />
<project path="vendor/lge/gee" name="TeamPlaceholder/proprietary_vendor_lge_gee" remote="gh" revision="cm-10.2" />
</manifest>
Click to expand...
Click to collapse
Preparing Source​ROM specific setup instructions prior to building. All source should be downloaded already.
Manufacturer and codename MUST be updated to reflect your device.
Cyanogenmod
Add this line to vendor/cm/vendorsetup.sh
cm_device-userdebug
Click to expand...
Click to collapse
device - The codename for your device. ie. mako for the Nexus 4
Code:
touch [COLOR="Purple"]path-to-device-tree[/COLOR]/cm.mk
path-to-device-tree - Example device/lge/mako for the Nexus 4
Code:
nano [COLOR="Purple"]path-to-device-tree[/COLOR]/cm.mk
Add these lines **This example is for the Nexus 4 Mako, change mako references to reflect your device**
## Specify phone tech before including full_phone
$(call inherit-product, vendor/cm/config/gsm.mk)
# Inherit some common CM stuff.
$(call inherit-product, vendor/cm/config/common_full_phone.mk)
# Enhanced NFC
$(call inherit-product, vendor/cm/config/nfc_enhanced.mk)
# Inherit device configuration
$(call inherit-product, device/lge/mako/full_mako.mk)
## Device identifier. This must come after all inclusions
PRODUCT_DEVICE := mako
PRODUCT_NAME := cm_mako
PRODUCT_BRAND := google
PRODUCT_MODEL := Nexus 4
PRODUCT_MANUFACTURER := LGE
# Enable Torch
PRODUCT_PACKAGES += Torch
Click to expand...
Click to collapse
Save and exit by pressing ctrl+x, selecting Y then enter.
Now you're ready to build! Go back to the OP and complete the guide from where you left off.
AOSP
AOSP requires a prebuilt kernel for your device. HERE is a guide for building a kernel if you do not have a prebuilt kernel for your device
The rest coming soon...
Liquid Smooth
Coming soon...
AOKP
Code:
nano vendor/aokp/vendorsetup.sh
Add this line
add_lunch_combo aokp_geeb-userdebug
Click to expand...
Click to collapse
Save and exit by pressing ctrl+x, selecting Y then enter.
Code:
touch vendor/aokp/products/geeb.mk
Code:
nano vendor/aokp/products/geeb.mk
Add these lines
If building for CDMA network change gsm.mk to cdma.mk
# Inherit AOSP device configuration for geeb
$(call inherit-product, device/lge/geeb/full_geeb.mk)
# Inherit AOKP common bits
$(call inherit-product, vendor/aokp/configs/common.mk)
# Inherit GSM common stuff
$(call inherit-product, vendor/aokp/configs/gsm.mk)
# Setup device specific product configuration
PRODUCT_NAME := aokp_geeb
PRODUCT_BRAND := google
PRODUCT_DEVICE := geeb
PRODUCT_MODEL := Optimus G
PRODUCT_MANUFACTURER := LGE
Click to expand...
Click to collapse
Save and exit by pressing ctrl+x, selecting Y then enter.
Code:
nano vendor/aokp/products/AndroidProducts.mk
Add this line
$(LOCAL_DIR)/geeb.mk \
Click to expand...
Click to collapse
Save and exit by pressing ctrl+x, selecting Y then enter.
Now you're ready to build! Go back to the OP and complete the guide from where you left off.
CarbonDev
Coming soon...
Now you're ready to build! Go back to the OP and complete the guide from where you left off.
Edit Source​
If you plan to edit the device/kernel repos for your phone you should either have used git clone to obtain your repos, or created forks of the repos to your own Github account to use in your local manifest. This way you can still do a repo sync to update the source without overwriting your changes or creating conflicts.
That being said these are the items disscused so far:
Adding Prebuilt APK's to Build
Adding Apps Via Source Code
Changing Toolchain
Cherry Picking Commits
Fixing Conflicts From Cherry Picks
Syncing Repo with Upstream Repo
Syncing Your Local Changes to Your Github Repo
Click to expand...
Click to collapse
Adding Prebuilt APK's to Build
Open the device folder for your phone. ie device/lge/geeb
Add these lines to android.mk
include $(CLEAR_VARS)
LOCAL_MODULE := Name
LOCAL_SRC_FILES := $(LOCAL_MODULE).apk
LOCAL_MODULE_TAGS := optional
LOCAL_MODULE_SUFFIX := .apk
LOCAL_MODULE_CLASS := APPS
LOCAL_CERTIFICATE := PRESIGNED
include $(BUILD_PREBUILT)
Click to expand...
Click to collapse
Name - Any name you want to asign to this apk to call for it in the build process
**NOTE** LOCAL_SRC_FILES is the location of the apk file. Above assumes it is in the root of your device folder**
Then edit your device.mk to call for your newly assigned apk
PRODUCT_PACKAGES += \
name
Click to expand...
Click to collapse
If the apk you want to add requires additional files to be added along with it, also add this
PRODUCT_COPY_FILES += \
Path-to-additional-file:Destination-path-in-finished-build
Click to expand...
Click to collapse
Path-to-additional-file - Where the file is located in your device tree that you need to add to your build
Destination-path-in-finished-build - Where in the final rom structure this file needs to be
Here is an example for adding required libs for Terminal Emulator to the geeb device tree:
PRODUCT_COPY_FILES += \
device/lge/geeb/libjackpal-androidterm3.so:system/lib/libjackpal-androidterm3.so \
device/lge/geeb/libjackpal-androidterm4.so:system/lib/libjackpal-androidterm4.so
Click to expand...
Click to collapse
Adding Apps Via Source Code
Adding apps to your build using source code is easier then adding prebuilt apks.
Example given is using Gallery2(I realize this is included with builds by default, just using it as an example)
Copy or clone your app's source code to working-dir/packages/apps in its own folder. ie. aokp/packages/Gallery2
Go into the source code folder for your app and open Android.mk
Look for this line LOCAL_PACKAGE_NAME , This will tell you what the call name for your app is
LOCAL_AAPT_FLAGS := --auto-add-overlay
LOCAL_PACKAGE_NAME := Gallery2
LOCAL_OVERRIDES_PACKAGES := Gallery Gallery3D GalleryNew3D
Click to expand...
Click to collapse
Then open device.mk from your phones device tree and add the call name for the app.
Add these lines:
PRODUCT_PACKAGES += \
Gallery2
Click to expand...
Click to collapse
Changing Toolchain
Download a new prebuilt toolchain that you wish to use
Example: Linaro 4.7 toolchain
Copy unziped prebuilt toolchain folder to working-folder/prebuilt/gcc/linux-x86/arm
Open build/envsetup.sh
Find this block of code:
# The gcc toolchain does not exists for windows/cygwin. In this case, do not reference it.
export ANDROID_EABI_TOOLCHAIN=
local ARCH=$(get_build_var TARGET_ARCH)
case $ARCH in
x86) toolchaindir=x86/i686-linux-android-$targetgccversion/bin
;;
arm) toolchaindir=arm/android-toolchain-eabi/bin
;;
mips) toolchaindir=mips/mipsel-linux-android-$targetgccversion/bin
;;
*)
echo "Can't find toolchain for unknown architecture: $ARCH"
toolchaindir=xxxxxxxxx
;;
esac
if [ -d "$gccprebuiltdir/$toolchaindir" ]; then
export ANDROID_EABI_TOOLCHAIN=$gccprebuiltdir/$toolchaindir
fi
unset ARM_EABI_TOOLCHAIN ARM_EABI_TOOLCHAIN_PATH
case $ARCH in
arm)
toolchaindir=arm/android-toolchain-eabi/bin
if [ -d "$gccprebuiltdir/$toolchaindir" ]; then
export ARM_EABI_TOOLCHAIN="$gccprebuiltdir/$toolchaindir"
ARM_EABI_TOOLCHAIN_PATH=":$gccprebuiltdir/$toolchaindir"
fi
Click to expand...
Click to collapse
Replace bold text with your toolchain folder name
The following group of instructions are for making edits to your own repo. Before using any of the info below PLEASE create your own GitHub account and Fork the repo you'd like to edit. Then clone YOUR forked repo from YOUR github account and make edits to it.
If that didn't make sence then you may want to refrain from using this for the time being.
Cherry Picking Commits
Move to the directory for the git repo you wish to add the commit to. ie kernel/lge/geeb
Code:
cd path-to-git-repo
Add the remote repo that holds the commit - This only needs to be done the first time
Code:
git remote add [COLOR="Red"]name[/COLOR] [COLOR="SeaGreen"]url[/COLOR]
name - a name you choose to identify that remote repo
url - the location of the repo ie. https://github.com/TeamPlaceholder/android_kernel_lge_gee.git
Fetch the repo
Code:
git fetch [COLOR="Red"]name[/COLOR]
Cherry pick commit
Code:
git cherry-pick [COLOR="DarkOrange"]commit-id[/COLOR]
commit-id - An unique id given to every commit. It's a long alphanumeric id shown on the commit page of your repo. ie. cc3581ff8692b517ddda8baad73a5d110568f0da
Fixing Conflicts From Cherry Picks
Somtimes when you cherry pick a commit to your repo you'll have a conflict. This is just saying that it did not see what it expected to see when adding the commit to a certain file. To fix a conflict and commit the cherry pick do as follows:
Determine which file(s) contain conflicts.
Code:
git status
This will show you edits waiting to be commited from the cherry-pick. The files shown in green accepted the changes without conflict, the files listed in red contain conflicts that need to be addressed.
Open the file in red
Code:
gedit [COLOR="DarkOrange"]Path-To-File-In-Red[/COLOR]
Press crtl+f to bring up a find window and search for head. Conflicts will be shown in the file using the following structure
<<<<<Head
<Original Code>
=======
<Code from Cherry-pick>
>>>>>Name Of Cherry Pick Commit
Click to expand...
Click to collapse
Compare the original code to the code from the cherry pick and see if anything needs to be saved. If so, merge what needs to be saved into the code from the cherry pick. Then delete the original code and the <<<< ===== >>>>> lines(everything shown in red above). In the end you should be left only with the code from the cherry pick, plus anything you may have merged to it.
Search again for 'head' to see if there are any further conflicts within that file. If there is use the same method to resolve them, if there is not save and exit the file.
Add the newly edited file to the pending commit
Code:
git add [COLOR="DarkOrange"]Path-To-File-In-Red[/COLOR]
Check for any more files that need to be addressed
Code:
git status
If you still have files in red, repeat the process above for those files.
Once all files from git status are shown in green you are ready to commit the cherry pick.
Code:
git commit
Save and exit the commit log by pressing ctrl+x
Done. That cherry pick is now commited to your repo, you can move on to the next cherry pick you wish to add.
Sync Forked Repo with Upstream(Parent) Repo
If you would like to commit to your forked repo all the commits made upstream since you forked(or previously sync'd)
Add the upstream repo - This only needs to be done the first time
Code:
git remote add [COLOR="Red"]name[/COLOR] [COLOR="SeaGreen"]url[/COLOR]
name - a name you choose to identify that remote repo
url - the location of the repo ie. https://github.com/TeamPlaceholder/android_kernel_lge_gee.git
Fetch the upstream repo
Code:
git fetch [COLOR="Red"]name[/COLOR]
Merge upstream commits
Code:
git merge [COLOR="Red"]name[/COLOR]/[COLOR="DarkOrange"]branch[/COLOR]
branch - The branch from the upstream repo you are syncing up
Syncing Your Local Changes to Your Github Repo
Check to ensure you have everything in order to push your changes
Code:
git status
If there are no conflicts/changes that need to be commited you are ready to push. If everything is good it will simply state your are x number of commits ahead
Push your commits to your GitHub account
Code:
git push
Enter your github user name then password. All your local commits will then be applied to your github repo.
More to Come...
Build Errors
Build Errors​
This is way to broad a subject to cover in a post, but here are some steps to take to help get you building again.
When your build output stops without clearly saying it's finished or directing you to the created zip file, it Failed.
Sometimes it will stop with the error right at the end of the output, but not very often. Most of the time you must look up through the build output in order to locate the actual error. Sometimes they can be buried very far up, depending on the number of jobs being built.
Here is an example of what you are looking for:
hardware/qcom/display-caf/libgralloc/framebuffer.cpp:116:39: error: 'MSMFB_DISPLAY_COMMIT' was not declared in this scope
Click to expand...
Click to collapse
File having the error
Line in the file where the error occurs
Error that has occured
The quickest way to locate the errors in the build output is the search 'ctrl+shfit+F' for ': error:'
Once you have located your error(s), you can begin troubleshooting to get past them. Start by opening the File having the error and going to the Line in the file where the error occurs. Though without programing knowledge you may not make much sense of it, it's always good to start familiarizing yourself with the code. If you're not able to correct the issue this is where google will come in very handy.
Quite often if you search simply for the Error that has occured exactly as it appears, you'll find its an error that has been encountered many times over and solutions are availible within the first couple of results in a google search.
Should all else fail Post a question and see what suggestions come up.
Here are a few common build errors that I have come across and some solutions for them, again this is by no means a one stop for build erros. Google...Google...Then try to post your error and see who can help if your still stuck. The more you fix by yourself the more it feels like YOUR build.
make: *** No rule to make target `Example_File'. Stop.
Click to expand...
Click to collapse
It can't find the file in question. This can be a incorrect path in a makefile, a missing file or a typo.
last one
Finally usefull guide! not only theory. Thank you very much!
Nice job. Just one thing: when using our sources, the cm-10.2-merge is the best kernel branch. Msm-3.10 is our bleeding edge and hopefully will be fully working soon (just got it to build today, so we'll see). The update branch is broken though. Let me know if you want to contribute to our Git so I can add you to the team, or if you have any suggestions on how to make our rom and kernel better.
Sent from my LG-LS970 using xda app-developers app
xboxfanj said:
Nice job. Just one thing: when using our sources, the cm-10.2-merge is the best kernel branch. Msm-3.10 is our bleeding edge and hopefully will be fully working soon (just got it to build today, so we'll see). The update branch is broken though. Let me know if you want to contribute to our Git so I can add you to the team, or if you have any suggestions on how to make our rom and kernel better.
Sent from my LG-LS970 using xda app-developers app
Click to expand...
Click to collapse
Thanks for the info, updated quide to reflect.
i have a cherry mobile burst phone its running ics,i a generic phone a clone i dont know where it came from i mean the build i cant find a source or a build repo , i really want to build a rom for my phone cause it seems ics is not compatible for the phone..it only has 512 ram and 1ghz dualcore processor..it could run smoothly i think with gingerbread but i cant find a tutorial to donwgrade it to gingerbread it seems impossible because of lack of support for the device and it came up with ics..i just dont know what to do any more my computer is linux mint 13 2gb ram 1ghz amd anthlon 2 ,70gb hd..i cant build a rom to this computer..
Changing Toolchain
Download a new prebuilt toolchain that you wish to use
Example: Linaro 4.7 toolchain
Copy unziped prebuilt toolchain folder to working-folder/prebuilt/gcc/linux-x86/arm
Open build/envsetup.sh
Find this block of code:
Quote:
# The gcc toolchain does not exists for windows/cygwin. In this case, do not reference it.
export ANDROID_EABI_TOOLCHAIN=
local ARCH=$(get_build_var TARGET_ARCH)
case $ARCH in
x86) toolchaindir=x86/i686-linux-android-$targetgccversion/bin
;;
arm) toolchaindir=arm/android-toolchain-eabi/bin
;;
mips) toolchaindir=mips/mipsel-linux-android-$targetgccversion/bin
;;
*)
echo "Can't find toolchain for unknown architecture: $ARCH"
toolchaindir=xxxxxxxxx
;;
esac
if [ -d "$gccprebuiltdir/$toolchaindir" ]; then
export ANDROID_EABI_TOOLCHAIN=$gccprebuiltdir/$toolchaindir
fi
unset ARM_EABI_TOOLCHAIN ARM_EABI_TOOLCHAIN_PATH
case $ARCH in
arm)
toolchaindir=arm/android-toolchain-eabi/bin
if [ -d "$gccprebuiltdir/$toolchaindir" ]; then
export ARM_EABI_TOOLCHAIN="$gccprebuiltdir/$toolchaindir"
ARM_EABI_TOOLCHAIN_PATH=":$gccprebuiltdir/$toolchaindir"
fi
Replace bold text with your toolchain folder name
Click to expand...
Click to collapse
Click to expand...
Click to collapse
I did what you said and i keep getting this error
"/arm-eabi-gcc: No such file or directory
make[4]: *** [scripts/mod/empty.o] Error 1
make[3]: *** [scripts/mod] Error 2
make[2]: *** [scripts] Error 2
make[2]: *** Waiting for unfinished jobs...."
Here's what my envsetup.sh looks like
# The gcc toolchain does not exists for windows/cygwin. In this case, do not reference it.
export ANDROID_EABI_TOOLCHAIN=
local ARCH=$(get_build_var TARGET_ARCH)
case $ARCH in
x86) toolchaindir=x86/i686-linux-android-$targetgccversion/bin
;;
arm) toolchaindir=arm/arm-eabi-linaro-4.6.2/bin
;;
mips) toolchaindir=mips/mipsel-linux-android-$targetgccversion/bin
;;
*)
echo "Can't find toolchain for unknown architecture: $ARCH"
toolchaindir=xxxxxxxxx
;;
esac
if [ -d "$gccprebuiltdir/$toolchaindir" ]; then
export ANDROID_EABI_TOOLCHAIN=$gccprebuiltdir/$toolchaindir
fi
unset ARM_EABI_TOOLCHAIN ARM_EABI_TOOLCHAIN_PATH
case $ARCH in
arm)
toolchaindir=arm/arm-eabi-linaro-4.6.2/bin
if [ -d "$gccprebuiltdir/$toolchaindir" ]; then
export ARM_EABI_TOOLCHAIN="$gccprebuiltdir/$toolchaindir"
ARM_EABI_TOOLCHAIN_PATH=":$gccprebuiltdir/$toolchaindir"
fi
Click to expand...
Click to collapse
my linaro folder is called "arm-eabi-linaro-4.6.2" and it is placed under "/prebuilts/gcc/linux-x86/arm/arm-eabi-linaro-4.6.2"
what am i doing wrong?
thanks!
ryukiri said:
I did what you said and i keep getting this error
"/arm-eabi-gcc: No such file or directory
make[4]: *** [scripts/mod/empty.o] Error 1
make[3]: *** [scripts/mod] Error 2
make[2]: *** [scripts] Error 2
make[2]: *** Waiting for unfinished jobs...."
Click to expand...
Click to collapse
Where did you get your linaro toolchain from?
go into your linaro directory/bin do you see arm-eabi**** files?
Sounds like it's only the arm-linux-androideabi*** files in there.
Get the prebuilt toolchains right from Linaro It will take a little looking around to find the 4.6. The prebuilt toolchains for each release are in Components>Android>Toolchain Most of them are 4.7 and 4.8 so like I said, it may take some looking around.
I believe(though not 100%) the arm-eabi are used for the kernel, the arm-linux-androideabi for the rom.
The top line you change in envsetup.sh is for the rom toolchain, second place you change is for the kernel toolchain. You can use two different toolchains here. I use sabermod 4.9 for my rom and linaro 4.7 for the kernel
Haze028 said:
Where did you get your linaro toolchain from?
go into your linaro directory/bin do you see arm-eabi**** files?
Sounds like it's only the arm-linux-androideabi*** files in there.
Get the prebuilt toolchains right from Linaro It will take a little looking around to find the 4.6. The prebuilt toolchains for each release are in Components>Android>Toolchain Most of them are 4.7 and 4.8 so like I said, it may take some looking around.
I believe(though not 100%) the arm-eabi are used for the kernel, the arm-linux-androideabi for the rom.
The top line you change in envsetup.sh is for the rom toolchain, second place you change is for the kernel toolchain. You can use two different toolchains here. I use sabermod 4.9 for my rom and linaro 4.7 for the kernel
Click to expand...
Click to collapse
hmm, i forgot where i got it from, i might have gotten it by following this http://forum.xda-developers.com/showthread.php?t=1988315
Can I use 4.7 or 4.8 though?
Ok so inside my linaro directory/bin, i see many arm-eabi**** files (attached screenshot)
Do you think you can link to me the exact toolchains you used so I can start with something that works and then start trying different ones later?
ryukiri said:
Can I use 4.7 or 4.8 though?
Do you think you can link to me the exact toolchains you used so I can start with something that works and then start trying different ones later?
Click to expand...
Click to collapse
I would stick with 4.7 toolchain. 4.6 is quite old, and 4.8 doesn't seem to play very nice. (i'm probably too noob to get it working)
This is the linaro 4.7 toolchain I use.
Hopefully that'll help ya get going.
Haze028 said:
I would stick with 4.7 toolchain. 4.6 is quite old, and 4.8 doesn't seem to play very nice. (i'm probably too noob to get it working)
This is the linaro 4.7 toolchain I use.
Hopefully that'll help ya get going.
Click to expand...
Click to collapse
alright thanks. Ill test it out and report back later
I got the same error.. D:
"/arm-eabi-gcc: No such file or directory
make[4]: *** [scripts/mod/empty.o] Error 1
make[3]: *** [scripts/mod] Error 2
make[2]: *** [scripts] Error 2
make[2]: *** Waiting for unfinished jobs...."
# The gcc toolchain does not exists for windows/cygwin. In this case, do not reference it.
export ANDROID_EABI_TOOLCHAIN=
local ARCH=$(get_build_var TARGET_ARCH)
case $ARCH in
x86) toolchaindir=x86/i686-linux-android-$targetgccversion/bin
;;
arm) toolchaindir=arm/android-toolchain-eabi/bin
;;
mips) toolchaindir=mips/mipsel-linux-android-$targetgccversion/bin
;;
*)
echo "Can't find toolchain for unknown architecture: $ARCH"
toolchaindir=xxxxxxxxx
;;
esac
if [ -d "$gccprebuiltdir/$toolchaindir" ]; then
export ANDROID_EABI_TOOLCHAIN=$gccprebuiltdir/$toolchaindir
fi
unset ARM_EABI_TOOLCHAIN ARM_EABI_TOOLCHAIN_PATH
case $ARCH in
arm)
toolchaindir=arm/android-toolchain-eabi/bin
if [ -d "$gccprebuiltdir/$toolchaindir" ]; then
export ARM_EABI_TOOLCHAIN="$gccprebuiltdir/$toolchaindir"
ARM_EABI_TOOLCHAIN_PATH=":$gccprebuiltdir/$toolchaindir"
fi
Click to expand...
Click to collapse
EDIT: after some research, i found out that all the files in my bin folder are 32 bit executable files. So i believe i need a 64 bit toolchain. Do you know where I could find one?
EDIT2: I found that for linux they need to install "ia32-libs" to run 32bit executables source. But the thing is, I'm using a mac...
EDIT3: nevermind, i got it to work. thanks anyway
aokp build error
Can you point me in the right direction to fix this error http://pastebin.com/GZmteWUu.
Recon Freak said:
Can you point me in the right direction to fix this error http://pastebin.com/GZmteWUu.
Click to expand...
Click to collapse
http://forum.xda-developers.com/showpost.php?p=47947423&postcount=175
Try this....
CarbonDev
Coming soon...
.
Click to expand...
Click to collapse
Thanks for the guide so far. Is there an eta for Carbon roms as I'm struggling to get my to build. Or AOSP?
Haze, to change tool chains, you can also set TARGET_TOOLS_PREFIX ?= prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.8-linaro/bin/arm-linux-androideabi- in boardconfig (sub in the right path obviously).
Sent from my Optimus G using xda app-developers app

Problems compiling PAC for nypon

Hi all,
I used the device, hardware, and kernel trees as given in the pastebin link in the legacy-xperia github
After applying munjeni's patches, I tried to compile. I got this error.
bootable/recovery/ui.c: In function 'update_leds':
bootable/recovery/ui.c:768:42: error: 'RED_LED_FILE' undeclared (first use in this function)
bootable/recovery/ui.c:768:42: note: each undeclared identifier is reported only once for each function it appears in
bootable/recovery/ui.c:769:42: error: 'GREEN_LED_FILE' undeclared (first use in this function)
make: *** [/home/fadhil/android/pac/out/target/product/nypon/obj/EXECUTABLES/recovery_intermediates/ui.o] Error 1
Click to expand...
Click to collapse
From what I saw in ui.c, the affected section is telling the colour of the charging led to change from red to green when battery level increases above 90%.
How do I resolve this error?
I think I have found the reason for the error. When the patches were applied, they produced errors.
What is the cause of this? Does another working set of patches exist?
MuffinIsCute said:
I think I have found the reason for the error. When the patches were applied, they produced errors.
What is the cause of this? Does another working set of patches exist?
Click to expand...
Click to collapse
see here
https://github.com/munjeni/android_hardware_semc/blob/master/patches/bootable_recovery.patch#L30
this is the line causing problem.
alwaysadeel said:
see here
https://github.com/munjeni/android_hardware_semc/blob/master/patches/bootable_recovery.patch#L30
this is the line causing problem.
Click to expand...
Click to collapse
You mean it should be changed to pac_nypon?
One more question here: I tried to use the device hardware and kernel trees from the aosx project instead. However, it was unable to compile as the file cm.mk was missing. Is it alright to just copy the cm.mk file over from the sources suggested in percy's pastebin? Or do I have to modify it to point somewhere else?
MuffinIsCute said:
You mean it should be changed to pac_nypon?
One more question here: I tried to use the device hardware and kernel trees from the aosx project instead. However, it was unable to compile as the file cm.mk was missing. Is it alright to just copy the cm.mk file over from the sources suggested in percy's pastebin? Or do I have to modify it to point somewhere else?
Click to expand...
Click to collapse
xperiaste github is already setup to build cm, it uses aosx trees. use it!
github.com/XperiaSTE
Sent from my Nexus 7
Cherrypick this- https://github.com/XperiaSTE/androi...mmit/bf7216061b2da51c18ecbe4d8f980e8a7c85be01
Cheers,
AJ
Abhinav2 said:
Cherrypick this- https://github.com/XperiaSTE/androi...mmit/bf7216061b2da51c18ecbe4d8f980e8a7c85be01
Cheers,
AJ
Click to expand...
Click to collapse
Stupid question here: How do I cherry pick?
Never mind. I'm still wondering why the change got reverted.
alwaysadeel: You're a lifesaver. I didn't know that XperiaSTE existed. Here's a thank you.
MuffinIsCute said:
Stupid question here: How do I cherry pick?
Never mind. I'm still wondering why the change got reverted.
Click to expand...
Click to collapse
Because when I was part of that team, I told i4g to do that since we were testing something.
AJ
Abhinav2 said:
Because when I was part of that team, I told i4g to do that since we were testing something.
AJ
Click to expand...
Click to collapse
Noob question: The only trees needed are the nypon, the montblanc, the kernel and hardware sources and the vendor tree right? Is that correct?
MuffinIsCute said:
Noob question: The only trees needed are the nypon, the montblanc, the kernel and hardware sources and the vendor tree right? Is that correct?
Click to expand...
Click to collapse
Yeah, more or less.
Cheers,
AJ
Abhinav2 said:
Yeah, more or less.
Cheers,
AJ
Click to expand...
Click to collapse
I tried compiling with the XperiaSTE trees and got this error
[email protected]:~/android/zz$ ./build-pac.sh nypon
No external out, using default (/home/fadhil/android/zz/out)
./build-pac.sh: command substitution: line 117: syntax error near unexpected token `fi'
./build-pac.sh: command substitution: line 117: `shellif[-s~/PACname];thencat~/PACname;elseecho"Beta-1.0";fi)'
Building P A C v..
Looking for PAC product dependencies
Check for XperiaSTE/android_device_sony_nypon in local_manifest
XperiaSTE/android_device_sony_nypon already in local_manifest
Check for XperiaSTE/android_device_sony_montblanc-common in local_manifest
XperiaSTE/android_device_sony_montblanc-common already in local_manifest
Check for XperiaSTE/android_kernel_sony_u8500 in local_manifest
XperiaSTE/android_kernel_sony_u8500 already in local_manifest
Check for XperiaSTE/android_hardware_ste-sony in local_manifest
XperiaSTE/android_hardware_ste-sony already in local_manifest
Check for XperiaSTE/android_vendor_sony in local_manifest
XperiaSTE/android_vendor_sony already in local_manifest
Downloading prebuilts
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 178 100 178 0 0 456 0 --:--:-- --:--:-- --:--:-- 656
100 502k 100 502k 0 0 413k 0 0:00:01 0:00:01 --:--:-- 413k
Archive: vendor/cm/proprietary/Term.apk
inflating: vendor/cm/proprietary/lib/armeabi/libjackpal-androidterm4.so
inflating: vendor/cm/proprietary/lib/mips/libjackpal-androidterm4.so
inflating: vendor/cm/proprietary/lib/x86/libjackpal-androidterm4.so
Setting up environment
including device/generic/armv7-a-neon/vendorsetup.sh
including device/generic/goldfish/vendorsetup.sh
including device/generic/mips/vendorsetup.sh
including device/generic/x86/vendorsetup.sh
including device/sony/nypon/vendorsetup.sh
including vendor/cm/vendorsetup.sh
including vendor/pac/vendorsetup.sh
including vendor/pa/vendorsetup.sh
including sdk/bash_completion/adb.bash
including vendor/cm/bash_completion/git.bash
including vendor/cm/bash_completion/repo.bash
Lunching device
Looking for dependencies
Dependencies file not found, bailing out.
============================================
PLATFORM_VERSION_CODENAME=REL
PLATFORM_VERSION=4.4.2
CM_VERSION=11-20140606-UNOFFICIAL-nypon
TARGET_PRODUCT=pac_nypon
TARGET_BUILD_VARIANT=userdebug
TARGET_BUILD_TYPE=release
TARGET_BUILD_APPS=
TARGET_ARCH=arm
TARGET_ARCH_VARIANT=armv7-a-neon
TARGET_CPU_VARIANT=cortex-a9
HOST_ARCH=x86
HOST_OS=linux
HOST_OS_EXTRA=Linux-3.8.0-41-generic-x86_64-with-Ubuntu-12.04-precise
HOST_BUILD_TYPE=release
BUILD_ID=KVT49L
OUT_DIR=/home/fadhil/android/zz/out
============================================
Starting compilation
Using the default GCC Optimization Level, O2
============================================
PLATFORM_VERSION_CODENAME=REL
PLATFORM_VERSION=4.4.2
CM_VERSION=11-20140606-UNOFFICIAL-nypon
TARGET_PRODUCT=pac_nypon
TARGET_BUILD_VARIANT=userdebug
TARGET_BUILD_TYPE=release
TARGET_BUILD_APPS=
TARGET_ARCH=arm
TARGET_ARCH_VARIANT=armv7-a-neon
TARGET_CPU_VARIANT=cortex-a9
HOST_ARCH=x86
HOST_OS=linux
HOST_OS_EXTRA=Linux-3.8.0-41-generic-x86_64-with-Ubuntu-12.04-precise
HOST_BUILD_TYPE=release
BUILD_ID=KVT49L
OUT_DIR=/home/fadhil/android/zz/out
============================================
Checking build tools versions...
/home/fadhil/android/zz/out/target/product/nypon/obj/APPS/SignatureTest_intermediates
external/chromium_org/GypAndroid.linux-arm.mk:109: external/chromium_org/third_party/WebKit/Source/bindings/bindings_sources.target.linux-arm.mk: No such file or directory
external/chromium_org/GypAndroid.linux-arm.mk:120: external/chromium_org/third_party/WebKit/Source/core/make_core_derived_sources.target.linux-arm.mk: No such file or directory
external/chromium_org/GypAndroid.linux-arm.mk:135: external/chromium_org/third_party/WebKit/Source/devtools/concatenated_devtools_layers_js.target.linux-arm.mk: No such file or directory
external/chromium_org/GypAndroid.linux-arm.mk:147: external/chromium_org/third_party/WebKit/Source/heap/blink_heap.target.linux-arm.mk: No such file or directory
external/chromium_org/GypAndroid.linux-arm.mk:148: external/chromium_org/third_party/WebKit/Source/heap/blink_heap_asm_stubs.target.linux-arm.mk: No such file or directory
external/chromium_org/GypAndroid.linux-arm.mk:150: external/chromium_org/third_party/WebKit/Source/platform/blink_arm_neon.target.linux-arm.mk: No such file or directory
external/chromium_org/GypAndroid.linux-arm.mk:151: external/chromium_org/third_party/WebKit/Source/platform/blink_common.target.linux-arm.mk: No such file or directory
external/chromium_org/GypAndroid.linux-arm.mk:152: external/chromium_org/third_party/WebKit/Source/platform/blink_platform.target.linux-arm.mk: No such file or directory
external/chromium_org/GypAndroid.linux-arm.mk:153: external/chromium_org/third_party/WebKit/Source/platform/blink_prerequisites.target.linux-arm.mk: No such file or directory
external/chromium_org/GypAndroid.linux-arm.mk:154: external/chromium_org/third_party/WebKit/Source/platform/make_platform_derived_sources.target.linux-arm.mk: No such file or directory
external/chromium_org/GypAndroid.linux-arm.mk:159: external/chromium_org/third_party/WebKit/public/blink_generate_devtools_grd.target.linux-arm.mk: No such file or directory
external/chromium_org/GypAndroid.linux-arm.mk:161: external/chromium_org/third_party/angle/src/preprocessor.target.linux-arm.mk: No such file or directory
external/chromium_org/GypAndroid.linux-arm.mk:162: external/chromium_org/third_party/angle/src/translator.target.linux-arm.mk: No such file or directory
external/chromium_org/GypAndroid.linux-arm.mk:228: external/chromium_org/v8/tools/gyp/generate_trig_table.host.linux-arm.mk: No such file or directory
"ebtables is disabled on this build"
find: `src': No such file or directory
build/core/base_rules.mk:134: *** prebuilts/misc/common/ub-uiautomator: MODULE.TARGET.JAVA_LIBRARIES.ub-uiautomator already defined by frameworks/uiautomator. Stop.
/home/fadhil/android/zz/out/target/product/nypon/pac_nypon-ota-eng.fadhil.zip doesn't exist!
Click to expand...
Click to collapse
I have no idea what happened.
MuffinIsCute said:
I tried compiling with the XperiaSTE trees and got this error
I have no idea what happened.
Click to expand...
Click to collapse
there are changes in uiautomator in 4.4.3 . repo sync again maybe u have a broken sync
Sent from my Nexus 7
MuffinIsCute said:
I tried compiling with the XperiaSTE trees and got this error
I have no idea what happened.
Click to expand...
Click to collapse
We(PAC team) are currently merging 4.4.3 changes so please don't build until repos are stable.
Cheers,
AJ
MuffinIsCute said:
I tried compiling with the XperiaSTE trees and got this error
I have no idea what happened.
Click to expand...
Click to collapse
from base source directory
cd prebuilts/misc
git revert -m1 490e397ee8b37485ac19967974758dee1db28673
or
rm frameworks/uiautomator
the issue is CM is using a prebuilt version and PAC still has the AOSP from source method in place. I'm using git revert because I prefer the from source method over a prebuilt method. Haven't tested either, but both are technically correct....
skeevydude said:
from base source directory
cd prebuilts/misc
git revert -m1 490e397ee8b37485ac19967974758dee1db28673
or
rm frameworks/uiautomator
the issue is CM is using a prebuilt version and PAC still has the AOSP from source method in place. I'm using git revert because I prefer the from source method over a prebuilt method. Haven't tested either, but both are technically correct....
Click to expand...
Click to collapse
Same error appeared after I used rm -rf frameworks/uiautomator.Resyncing repo.
MuffinIsCute said:
Same error appeared after I used rm -rf frameworks/uiautomator.Resyncing repo.
Click to expand...
Click to collapse
Even after you do that, a crap ton of things need to be merged. Check the gerrit, but all the 4.4.3 merges need to be picked in as well as the main repo manifest being majorly updated. Just got a build error 192 mins in with frameworks/base, that's with all the 4.4.3 picks, Archidroid, gcc 4.8, and the main manifest updates. I normally suck with Java, but I actually figured the error out on my own -- illegal statement start -- CM had the same fix my non-programming self came up with...removing a ")". Time to clean and start a new build.
I'm also doing my builds with Archidroid's Optimizations. Once I get it successfully building, I'm gonna submit that to gerrit along with builder selectable GCC (4.6 to 4.10 with some linaros too) versions (I'm currently hiding his Optimizations in the -o3 option, but I'll make his o4 because I can
If you resync the repo after doing the rm -rf command, it'll add that right back in and you'll still get that error...oh, and rm -rf is the fix in PAC's gerrit right now...sync, do modifications, compile,,,,not mod, sync, compile (I made that mistake plenty of times when I first started out kanging)
skeevydude said:
Even after you do that, a crap ton of things need to be merged. Check the gerrit, but all the 4.4.3 merges need to be picked in as well as the main repo manifest being majorly updated. Just got a build error 192 mins in with frameworks/base, that's with all the 4.4.3 picks, Archidroid, gcc 4.8, and the main manifest updates. I normally suck with Java, but I actually figured the error out on my own -- illegal statement start -- CM had the same fix my non-programming self came up with...removing a ")". Time to clean and start a new build.
I'm also doing my builds with Archidroid's Optimizations. Once I get it successfully building, I'm gonna submit that to gerrit along with builder selectable GCC (4.6 to 4.10 with some linaros too) versions (I'm currently hiding his Optimizations in the -o3 option, but I'll make his o4 because I can
If you resync the repo after doing the rm -rf command, it'll add that right back in and you'll still get that error...oh, and rm -rf is the fix in PAC's gerrit right now...sync, do modifications, compile,,,,not mod, sync, compile (I made that mistake plenty of times when I first started out kanging)
Click to expand...
Click to collapse
Wow... that scared me. If I wait a month, do I still have to do this?
MuffinIsCute said:
Wow... that scared me. If I wait a month, do I still have to do this?
Click to expand...
Click to collapse
Maybe for the next week or two, it usually doesn't take that long in-between minor Android version updates...
All the 4.4.3 gerrit picks can be done inside a half an hour, so it's not like it's that hard.
Try a build now.
AJ
Abhinav2 said:
Try a build now.
AJ
Click to expand...
Click to collapse
While I wait for the repo to sync, let me ask a question, regarding ROMs in general. Besides PA, which ROMs allow you to launch an app in floating mode from the recents list? Does PAC have it yet?

Categories

Resources