Android compile from sources: различия между версиями

Материал из Toshiba AC100 wiki
Перейти к навигации Перейти к поиску
Строка 45: Строка 45:
Initialize jellybean repo:
Initialize jellybean repo:
<pre>
<pre>
repo init -u git://github.com/CyanogenMod/android.git -b cm-11.0
repo init -u git://github.com/CyanogenMod/android.git -b jellybean
curl --create-dirs -L -o .repo/local_manifests/local_manifest.xml -O -L https://raw.githubusercontent.com/cm-paz00/cm-paz00/jellybean/local_manifest.xml
curl --create-dirs -L -o .repo/local_manifests/local_manifest.xml -O -L https://raw.githubusercontent.com/cm-paz00/cm-paz00/jellybean/local_manifest.xml
</pre>
</pre>

Версия от 12:12, 24 апреля 2016

How to compile Android CM for AC100 from sources


Build Enviroment

I use openSUSE 13.1 x64 as build enviroment. When installing 13.1 dont forget to choose this software package patterns:

Base Development
C/C++ Development
Java Development
Linux Kernel Development
Python Development
Perl Development

Or install patterns from terminal:

sudo zypper install -t devel_basis pattern devel_C_C++ devel_java devel_kernel devel_perl devel_python

Also add some additional packages:

zip
lzop
libxml2-tools

Install Oracle JDK following this guide http://en.opensuse.org/SDB:Installing_Java [ TODO: try java-1_7_0-openjdk-devel ]

Get Sources

Download repo tool and place it into path, latest repo url is here: http://source.android.com/source/downloading.html

Set your name and e-mail in git:

git config --global user.name "John Doe"
git config --global user.email [email protected]

Create directory for source for example:

mkdir ~/src/cm-ac100
cd ~/src/cm-ac100

Initialize jellybean repo:

repo init -u git://github.com/CyanogenMod/android.git -b jellybean
curl --create-dirs -L -o .repo/local_manifests/local_manifest.xml -O -L https://raw.githubusercontent.com/cm-paz00/cm-paz00/jellybean/local_manifest.xml

Initialize 11.0 repo:

repo init -u git://github.com/zombah/android.git -b cm-11.0-ac100

for 10.2 use this:

repo init -u git://github.com/zombah/android.git -b cm-10.2-ac100

for 10.1 use this:

repo init -u git://github.com/zombah/android.git -b cm-10.1-ac100

After repo initialized download sources:

repo sync -j16

If you see "unable to connect to github.com" errors, disable firewall and try sync again.

Compile

After all sources downloaded, prepare android build enviroment:

source ./build/envsetup.sh

Download prebuilt packages:

cd vendor/cm
./get-prebuilts
cd ../..

Choose AC100 configuration:

lunch cm_ac100-userdebug

Start source compilation:

make -j16 otapackage 2>&1 | tee ~/src/my-compile-log

When you need to clean compiled binaries:

make -j16 clobber

Rebuild after code change

For example something is modified in device/toshiba/paz00-common/audio but rebuilding whole base is too long, here is how to rebuild only changed part

cd ~/src/cm-11.0
make installclean
cd device/toshiba/paz00-common/audio
mm -B
cd ~/src/cm-11.0
make otapackage