How-to build Roms (crDroid) for the ZTE Axon 7 - ZTE Axon 7 Guides, News, & Discussion

Quite a while ago I promised to make a How-to on how to build Roms for the Axon 7.
Well, here we are... 84 years later.
It's a bit quick & dirty, but all the basics should be there.
Thanks to raystef66 & tprfd for all the help.
Code:
Complete How-to for building LineageOS:
https://wiki.lineageos.org/devices/axon7/build#prepare-the-device-specific-code
I'd start there and then check this How-to for the rest.
( pre-building )
Start in your home directory.
Get the latest platform tools:
wget https://dl.google.com/android/repository/platform-tools-latest-linux.zip
Unzip them:
unzip platform-tools-latest-linux.zip -d ~
Add adb and fastboot as well as ~/bin to your path by editing ~/.profile and adding these lines (~/bin may already be there):
# add Android SDK platform tools to path
if [ -d "$HOME/platform-tools" ] ; then
PATH="$HOME/platform-tools:$PATH"
fi
# set PATH so it includes user's private bin if it exists
if [ -d "$HOME/axon7-build/bin" ] ; then
PATH="$HOME/axon7-build/bin:$PATH"
fi
Update your environment by running
[CODE]source ~/.profile
Install the required packages:
Code:
sudo apt-get install bc bison build-essential ccache curl flex g++-multilib gcc-multilib git gnupg gperf imagemagick lib32ncurses5-dev lib32readline-dev lib32z1-dev liblz4-tool libncurses5-dev libsdl1.2-dev libssl-dev libwxgtk3.0-dev libxml2 libxml2-utils lzop pngcrush rsync schedtool squashfs-tools xsltproc zip zlib1g-dev openjdk-8-jdk
( First Build / crDroid )
cd /home
mkdir crDroid
cd crDroid
repo init -u git://github.com/crdroidandroid/android.git -b 9.0
repo sync
git clone https://github.com/Jake-Armitage/android_device_zte_axon7-1.git -b crdroid-pie device/zte/axon7
git clone https://github.com/Jake-Armitage/proprietary_vendor_zte-1.git -b lineage-16.0 vendor/zte
git clone https://github.com/Jake-Armitage/caf_kernel_zte_msm8996.git -b axon7-stable kernel/zte/msm8996
[When rebuilding]
( cd /home/[username]/axon7-build/android/crDroid && make clean && source build/envsetup.sh && breakfast axon7 && repo sync --force-sync )
[/(When rebuilding)]
source build/envsetup.sh #(don't do this again if you already did the step --> (When rebuilding)
breakfast axon7 #(don't do this again if you already did the step --> (When rebuilding)
cd /home/[username]/axon7-build/android/crDroid/device/zte/axon7
./setup-makefiles.sh
cd /home/[udername]/axon7-build/android/crDroid
croot
brunch axon7
[/CODE]

Testing the instructions now
Update:
First attempt and working, I just flashed my own compiled build thanks for the instructions! (Now let's git clone all and fix all issues (Wish))

Very new to android development (?)... How do you get the latest security patches and apply them to a rom?

randomUsername1 said:
Very new to android development (?)... How do you get the latest security patches and apply them to a rom?
Click to expand...
Click to collapse
The developers for lineage, crdroid, etc. do this. If you build with instructions from OP you will pull in the latest security patches. You can sync every month to get the latest. I am doing this with my own build of lineage 16 using a mix and match of sources for this phone.

Hi. Could anyone give me advice. I am trying to follow instructions and on step
Code:
repo init -u git://github.com/crdroidandroid/android.git -b 9.0
I'm getting error:
Code:
warning: gpg (GnuPG) is not available.
warning: Installing it is strongly encouraged.
warning: templates not found /build/git-repo-publish/parts/git/install/usr/share/git-core/templates
Get https://gerrit.googlesource.com/git-repo/clone.bundle
Get https://gerrit.googlesource.com/git-repo
remote: Counting objects: 3, done
remote: Finding sources: 100% (16/16)
remote: Total 16 (delta 5), reused 15 (delta 5)
Unpacking objects: 100% (16/16), done.
From https://gerrit.googlesource.com/git-repo
2a2da80..0286e31 main -> origin/main
File "/home/rnb/crDroid/.repo/repo/main.py", line 79
file=sys.stderr)
^
SyntaxError: invalid syntax
I am using Ubuntu 20.04.2 LTS 64 bit.

rnb.001 said:
Hi. Could anyone give me advice. I am trying to follow instructions and on step
Code:
repo init -u git://github.com/crdroidandroid/android.git -b 9.0
I'm getting error:
Code:
warning: gpg (GnuPG) is not available.
warning: Installing it is strongly encouraged.
warning: templates not found /build/git-repo-publish/parts/git/install/usr/share/git-core/templates
Get https://gerrit.googlesource.com/git-repo/clone.bundle
Get https://gerrit.googlesource.com/git-repo
remote: Counting objects: 3, done
remote: Finding sources: 100% (16/16)
remote: Total 16 (delta 5), reused 15 (delta 5)
Unpacking objects: 100% (16/16), done.
From https://gerrit.googlesource.com/git-repo
2a2da80..0286e31 main -> origin/main
File "/home/rnb/crDroid/.repo/repo/main.py", line 79
file=sys.stderr)
^
SyntaxError: invalid syntax
I am using Ubuntu 20.04.2 LTS 64 bit.
Click to expand...
Click to collapse
Never mind. It is working now. Had to install Ubuntu 20.10 on vitual machine and start all over again.
Note for those who has clean OS and had never build ROM. Consult to article how to build Lineageos. There some extra tweaks and tricks that has to be done initialy to your machine before building ROMs.

Related

[AS AT 04/08][AOSP/CM7/ICS/CM9][GUIDE]Wanna try compiling for Galaxy Ace?

Hello everyone yet again
Info: This also works for CM7 , just that the Cooper repo is already natively included in the files and folders , so you can skip step 2.5
I'm creating a new thread for all those people who know a little bit of code but don't know what to do to compile for Galaxy Ace (AOSP or CM7).
THANKS TO http://source.android.com and http://wiki.cyanogenmod.com
32-bit computers are not recommended to compile Gingerbread and above versions!
For now, I'll cover AOSP. (I'll show a CM7 guide once I learn how to compile it)
Alright, to compile Gingerbread AOSP you'll need a computer that has:
-At least an Intel Core i3 at 2.4Ghz or a similar AMD processor
-4GB RAM (my RAM speeds are at 1333Mhz). If lesser RAM, then swap is needed (for 2GB RAM use 15GB swap, that what I used before)
-40GB Partition for single compilation or 80GB for multiple versions (NOT including Ubuntu installation)
-Ubuntu 10.04 LTS OR Mac OSX 10.6 (other versions of Ubuntu, including 09.10 or lower or 10.10 or higher, may not work as well as 10.04)(Same thing goes for Snow Leopard, Lion has certain problems)
Here's how to compile for Gingerbread:
Step 1: Setting up the build environment.
Linux:
In general you will need:
-Python 2.4 - 2.7
-JDK 6 if you wish to build Gingerbread or newer; JDK 5 for Froyo or older.
-Git 1.7 or newer.
To install Sun JDK 6 do the following:
Code:
$ sudo add-apt-repository "deb http://archive.canonical.com/ lucid partner"
$ sudo apt-get update
$ sudo apt-get install sun-java6-jdk
You will also need to install certain packages:
For 64-bit computers:
Code:
$ sudo apt-get install git-core gnupg flex bison gperf build-essential \
zip curl zlib1g-dev libc6-dev lib32ncurses5-dev ia32-libs \
x11proto-core-dev libx11-dev lib32readline5-dev lib32z-dev \
libgl1-mesa-dev g++-multilib mingw32 tofrodos python-markdown \
libxml2-utils
For 32-bit computers (experimental):
Code:
$ sudo 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
(***NOTE: I've gotten errors when trying to apt-get install lib32ncurses5-dev.)
IF you're on Ubuntu 11.10 you might need to do this:
Code:
$ sudo ln -s /usr/lib/i386-linux-gnu/libX11.so.6 /usr/lib/i386-linux-gnu/libX11.so
Now for OSX (taken from http://source.android.com):
To build the Android files in a Mac OS environment, you need an Intel/x86 machine running MacOS 10.6 (Snow Leopard).
Android must be built on a case-sensitive file system because the sources contain files that differ only in case. We recommend that you build Android on a partition that has been formatted with the journaled file system HFS+. HFS+ is required to successfully build Mac OS applications such as the Android Emulator for OSX.
If you want to avoid partitioning/formatting your hard drive, you can use a case-sensitive disk image instead. To create the image, launch Disk Utility and select "New Image". A size of 25GB is the minimum to complete the build, larger numbers are more future-proof. Using sp**** images saves space while allowing to grow later as the need arises. Be sure to select "case sensitive, journaled" as the volume format.
You can also create it with this:
Code:
# hdiutil create -type SP**** -fs 'Case-sensitive Journaled HFS+' -size Xg ~/android.dmg
Where "X" is how big your image will be (in GB).
This will create a .dmg (or possibly a .dmg.sp****file) file which, once mounted, acts as a drive with the required formatting for Android development. For a disk image named "android.dmg" stored in your home directory, you can add the following to your ~/.bash_profile to mount the image when you execute "mountAndroid":
Code:
# mount the android file image
function mountAndroid { hdiutil attach ~/android.dmg -mountpoint /Volumes/android; }
Once mounted, you'll do all your work in the "android" volume. You can eject it (unmount it) just like you would with an external drive.
Installing required packages:
-Install XCode from the Apple developer site. We recommend version 3.1.4 or newer, i.e. gcc 4.2. Version 4.x could cause difficulties. If you are not already registered as an Apple developer, you will have to create an Apple ID in order to download.
-MacPorts from http://macports.org
Note: Make sure that /opt/local/bin appears in your path BEFORE /usr/bin. If not, add:
Code:
export PATH=/opt/local/bin:$PATH
to your ~/.bash_profile.
-Get make, git, and GPG packages from MacPorts:
Code:
$ POSIXLY_CORRECT=1 sudo port install gmake libsdl git-core gnupg
If you're on MacOS 10.4, install bison too:
Code:
$ POSIXLY_CORRECT=1 sudo port install bison
Bugs and fixes:
-Reverting from gmake3.82:
There is a bug in gmake 3.82 that prevents android from building. You can install version 3.81 using MacPorts by taking the following steps:
-Edit /opt/local/etc/macports/sources.conf and add a line that says:
Code:
file:///Users/Shared/dports
above the rsync line. Then make this directory:
Code:
$ mkdir /Users/Shared/dports
-In the new dports directory, run:
Code:
$ svn co --revision 50980 http://svn.macports.org/repository/macports/trunk/dports/devel/gmake/ devel/gmake/
-Create a port index for your new local repository:
Code:
$ portindex /Users/Shared/dports
-Finally, install the old version of gmake with:
Code:
$ sudo port install gmake @3.81
-Setting a file descriptor limit:
On MacOS the default limit on the number of simultaneous file descriptors open is too low and a highly parallel build process may exceed this limit.
To increase the cap, add the following lines to your ~/.bash_profile:
Code:
# set the number of open files to be 1024
ulimit -S -n 1024
Your Linux/MacOS build environment is now complete, moving on to downloading....
Step 2: Downloading the source
You'll need to use repo to download sources from repositories.
Here's how I did it:
-Make a /bin directory in your home directory and it must be in your PATH:
Code:
$ mkdir ~/bin
$ PATH=~/bin:$PATH
-Download the Repo script and ensure that it can be executed:
Code:
$ curl https://dl-ssl.google.com/dl/googlesource/git-repo/repo > ~/bin/repo
$ chmod a+x ~/bin/repo
Now that downloading repo is done and executable, we need to initialise it.
Create an empty directory for where all your Android files will be downloaded, stored and made:
Code:
$ mkdir WORKING_DIRECTORY
$ cd WORKING_DIRECTORY
Where WORKING_DIRECTORY can be any name you want (as long as it has no spaces)
Use repo init to grab the latest branch (or rather, the gingerbread branch)
Code:
$ repo init -u https://android.googlesource.com/platform/manifest -b android-x.x.x_r1
Where "x" can be 2.3, 2.3.1, 2.3.2, 2.3.3, 2.3.4, 2.3.5, 2.3.6 or 2.3.7.
For now use the versions that the Galaxy Ace currently has (2.3.3-2.3.5 and 2.3.7)
Optional step:
When prompted, please configure Repo with your real name and email address. To use the Gerrit code-review tool, you will need an email address that is connected with a registered Google account. Make sure this is a live address at which you can receive messages. The name that you provide here will show up in attributions for your code submissions.
Click to expand...
Click to collapse
Once you're done with that, you'll need to download them.
This simple 8-character command is easy to execute but it'll be hard on your internet connection:
Code:
$ repo sync
Ensure that you have at least 5Mbps of internet if you want it completed in a day.
Once you're done syncing, use this code:
Code:
$ gpg --import
To sign what you've downloaded.
Once you entered that, copy and paste this long line of ****:
Code:
-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: GnuPG v1.4.2.2 (GNU/Linux)
mQGiBEnnWD4RBACt9/h4v9xnnGDou13y3dvOx6/t43LPPIxeJ8eX9WB+8LLuROSV
lFhpHawsVAcFlmi7f7jdSRF+OvtZL9ShPKdLfwBJMNkU66/TZmPewS4m782ndtw7
8tR1cXb197Ob8kOfQB3A9yk2XZ4ei4ZC3i6wVdqHLRxABdncwu5hOF9KXwCgkxMD
u4PVgChaAJzTYJ1EG+UYBIUEAJmfearb0qRAN7dEoff0FeXsEaUA6U90sEoVks0Z
wNj96SA8BL+a1OoEUUfpMhiHyLuQSftxisJxTh+2QclzDviDyaTrkANjdYY7p2cq
/HMdOY7LJlHaqtXmZxXjjtw5Uc2QG8UY8aziU3IE9nTjSwCXeJnuyvoizl9/I1S5
jU5SA/9WwIps4SC84ielIXiGWEqq6i6/sk4I9q1YemZF2XVVKnmI1F4iCMtNKsR4
MGSa1gA8s4iQbsKNWPgp7M3a51JCVCu6l/8zTpA+uUGapw4tWCp4o0dpIvDPBEa9
b/aF/ygcR8mh5hgUfpF9IpXdknOsbKCvM9lSSfRciETykZc4wrRCVGhlIEFuZHJv
aWQgT3BlbiBTb3VyY2UgUHJvamVjdCA8aW5pdGlhbC1jb250cmlidXRpb25AYW5k
cm9pZC5jb20+iGAEExECACAFAknnWD4CGwMGCwkIBwMCBBUCCAMEFgIDAQIeAQIX
gAAKCRDorT+BmrEOeNr+AJ42Xy6tEW7r3KzrJxnRX8mij9z8tgCdFfQYiHpYngkI
2t09Ed+9Bm4gmEO5Ag0ESedYRBAIAKVW1JcMBWvV/0Bo9WiByJ9WJ5swMN36/vAl
QN4mWRhfzDOk/Rosdb0csAO/l8Kz0gKQPOfObtyYjvI8JMC3rmi+LIvSUT9806Up
hisyEmmHv6U8gUb/xHLIanXGxwhYzjgeuAXVCsv+EvoPIHbY4L/KvP5x+oCJIDbk
C2b1TvVk9PryzmE4BPIQL/NtgR1oLWm/uWR9zRUFtBnE411aMAN3qnAHBBMZzKMX
LWBGWE0znfRrnczI5p49i2YZJAjyX1P2WzmScK49CV82dzLo71MnrF6fj+Udtb5+
OgTg7Cow+8PRaTkJEW5Y2JIZpnRUq0CYxAmHYX79EMKHDSThf/8AAwUIAJPWsB/M
pK+KMs/s3r6nJrnYLTfdZhtmQXimpoDMJg1zxmL8UfNUKiQZ6esoAWtDgpqt7Y7s
KZ8laHRARonte394hidZzM5nb6hQvpPjt2OlPRsyqVxw4c/KsjADtAuKW9/d8phb
N8bTyOJo856qg4oOEzKG9eeF7oaZTYBy33BTL0408sEBxiMior6b8LrZrAhkqDjA
vUXRwm/fFKgpsOysxC6xi553CxBUCH2omNV6Ka1LNMwzSp9ILz8jEGqmUtkBszwo
G1S8fXgE0Lq3cdDM/GJ4QXP/p6LiwNF99faDMTV3+2SAOGvytOX6KjKVzKOSsfJQ
hN0DlsIw8hqJc0WISQQYEQIACQUCSedYRAIbDAAKCRDorT+BmrEOeCUOAJ9qmR0l
EXzeoxcdoafxqf6gZlJZlACgkWF7wi2YLW3Oa+jv2QSTlrx4KLM=
=Wi5D
-----END PGP PUBLIC KEY BLOCK-----
Paste it into your terminal and press Ctrl+D.
You now have a complete local copy of the Android codebase.
Step 2.5: Include the Samsung COOPER source for compilation (AOSP only)
Yes, this has to be done so you can compile for cooper (Samsung Galaxy Ace).
-Navigate the terminal to the ~/WORKING_DIRECTORY/device/samsung folder:
Code:
$ cd ~/WORKING_DIRECTORY/device/samsung
Where WORKING_DIRECTORY = your android folder
-Make use of git to clone a folder from PabloPL's GitHub:
Code:
$ git clone git://github.com/PabloPL/android_device_samsung_cooper
Once it's done, you should see a folder with that name in the root of your working directory. Rename it to "cooper" and cut & paste it to device/samsung.
Download the Android SDK Tools and make sure you set ADB correctly to be in your PATH.
For more info and how-to steps go here: http://www.lineardroid.co.uk/2010/04/how-to-set-up-adb-in-ubuntu/
Once you're done setting up ADB, go to the cooper folder and run extract-files.sh in the terminal.
ADB should pull some files from your device and automatically close the terminal. (You might need to be in CM7 for ADB to successfully pull all libs, I may be wrong though. Someone test it and tell me if it works)
Now we're done for now.
Oh yes, before I forget:
Have a copy of CM7 before you build!
AOSP does not fully support ARMv6 devices and therefore uneeded errors may arise, so the CM7 files can save you.
Step 3: Building Android (most exciting/boring part)
Initialize the environment with the envsetup.sh script.
Code:
$ . build/envsetup.sh
Choose your target to build with lunch.
Code:
$ lunch cooper-eng
(***NOTE: Change full_base.mk in device_cooper.mk to full.mk) (AOSP only)
(***NOTE2: There'll be another error about an unknown architecture: ARMv6-VFP. That's where your CM7 files come in handy.) (AOSP only)
Build everything with make. GNU make can handle parallel tasks with a -jN argument, and it's common to use a number of tasks N that's between 1 and 2 times the number of hardware threads on the computer being used for the build. E.g. on a dual-E5520 machine (2 CPUs, 4 cores per CPU, 2 threads per core), the fastest builds are made with commands between make -j16 and make -j32.
I usually use this (thanks to cdesai):
Code:
$ make -j8 update-api
$ make -j8 otapackage
OR:
Code:
$ make -j16 update-api
$ make -j16 otapackage
Do have patience because your computer will get inevitably laggy.
Once you're done debugging all errors and stuff you will have a flashable .zip located in WORKING_DIRECTORY/out/target/cooper.
Thanks for reading this whole chunk, though I know it's an XDA App eyesore.
If you do encounter errors feel free to ask here
Alright, now you've built AOSP and CM7 and you love it, what next?
Ice Cream Sandwich *insert holy choir here*
Requirements (they are much more different now):
A computer that's capable of 64-bit
A dual-core processor of a speed of at least 2.2Ghz (Intel Xeon/Core i7 recommended)
Either Ubuntu 10.04 LTS 64-bit (later versions have experimental support) but if you're using a later version that's fine.
Or Mac OSX 10.6
At least 8GB of RAM and 10~GB swap maybe? (Otherwise you could have 4Gb of RAM and ~20GB swap this time)
At least a 70GB partition for Ubuntu (to make sure there is space for compiling + installing required stuff)
Well, here are the steps to build it:
Instructions (Taken from http://source.android.com/source/initializing.html & http://wiki.cyanogenmod.com/wiki/Android_SDK_Emulator:_Compile_CyanogenMod_(Linux)):
---------ONLY FOR UBUNTU 10.10--12.04---------
Chapter 1: Initializing a Build Environment
This section describes how to set up your local work environment, how to use Repo to get the Android files, and how to build the files on your machine. To build the Android source files, you will need to use Linux or Mac OS. Building under Windows is not currently supported.
Note: The source download is approximately 6GB in size. You will need 25GB free to complete a single build, and up to 90GB (or more) for a full set of builds.
Section 1 (Linux/Ubuntu): Setting up a Linux build environment
The Android build is routinely tested in house on recent versions of Ubuntu LTS (10.04), but most distributions should have the required build tools available. Reports of successes or failures on other distributions are welcome.
Note: It is also possible to build Android in a virtual machine. If you are running Linux in a virtual machine, you will need at least 16GB of RAM/swap and 30GB or more of disk space in order to build the Android tree.
In general you will need:
Python 2.5 -- 2.7.
GNU Make 3.81 -- 3.82.
JDK 6 if you wish to build Gingerbread or newer; JDK 5 for Froyo or older.
Git 1.7 or newer.
Detailed instructions for Ubuntu 10.04+ follow.
Step 1: Installing the JDK
The Sun JDK is no longer in Ubuntu's main package repository. In order to download it, you need to add the appropriate repository and indicate to the system which JDK should be used.
To download Java 6, do this:
Code:
$ sudo add-apt-repository "deb http://archive.canonical.com/ lucid partner"
$ sudo apt-get update
$ sudo apt-get install sun-java6-jdk
Note: The lunch command in the build step will ensure that the Sun JDK is used instead of any previously installed JDK.
Alternatively you can follow eoghan2t7's instructions:
eoghan2t7 said:
as you may no the Java JDK has been removed from the ubuntu ppa so i have uploaded the jdk deb file for users to use and to skip the sudo apt-get install java_jdk command
link
http://www.mediafire.com/?b57gqo7t46k1ibc
Click to expand...
Click to collapse
Or bs828's instructions:
bs828 said:
I'm currently out will do later
Edit: im on 12.0.4 and this seemed to work http://www.devsniper.com/ubuntu-12-04-install-sun-jdk-6-7/
Click to expand...
Click to collapse
Step 2: Installing required packages (Ubuntu 10.04 -- 11.10)
You will need a 64-bit version of Ubuntu. Ubuntu 10.04 is recommended. Building using a newer version of Ubuntu is currently only experimentally supported and is not guaranteed to work on Git branches other than master (http://github.com/android).
To install the required packages, do this:
Code:
$ sudo apt-get install git-core gnupg flex bison gperf build-essential \
zip curl zlib1g-dev libc6-dev lib32ncurses5-dev ia32-libs \
x11proto-core-dev libx11-dev lib32readline5-dev lib32z-dev \
libgl1-mesa-dev g++-multilib mingw32 tofrodos python-markdown \
libxml2-utils xsltproc
---------ONLY FOR UBUNTU 10.10--11.10---------
For Ubuntu 10.10 users, do this as well:
Code:
$ sudo ln -s /usr/lib32/mesa/libGL.so.1 /usr/lib32/mesa/libGL.so
Note: This is used to avoid a compile error with libGL later on.
For Ubuntu 11.10 users, do this:
Code:
$ sudo apt-get install libx11-dev:i386
---------END FOR UBUNTU 10.10--11.10---------
----------ONLY FOR UBUNTU 12.04----------
Step 2: Installing required packages (Ubuntu 12.04)
Building on Ubuntu 12.04 is currently only experimentally supported and is not guaranteed to work on branches other than master.
To install the required packages, do this:
Code:
$ sudo apt-get install git-core gnupg flex bison gperf build-essential \
zip curl libc6-dev libncurses5-dev:i386 x11proto-core-dev \
libx11-dev:i386 libreadline6-dev:i386 libgl1-mesa-dev:i386 \
g++-multilib mingw32 openjdk-6-jdk tofrodos python-markdown \
libxml2-utils xsltproc zlib1g-dev:i386
---------END FOR UBUNTU 10.10--12.04---------
I won't do MacOSX for ICS, mainly because it has a very unstable success chance of compilation.
Your build environment is good to go! Proceed to
Chapter 2: Downloading the Source Tree
Section 1: Repo
Repo is a tool that makes it easier to work with Git in the context of Android.
It is also a tool that allows you to download source files from Android easily.
Step 1: Installing Repo
To install, initialize, and configure Repo, follow these steps:
Make sure you have a bin/ directory in your home directory, and that it is included in your path:
Code:
$ mkdir ~/bin
$ PATH=~/bin:$PATH
Download the Repo script and ensure it is executable:
Code:
$ curl https://dl-ssl.google.com/dl/googlesource/git-repo/repo > ~/bin/repo
$ chmod a+x ~/bin/repo
For version 1.15, the SHA-1 checksum for repo is 8eb56d98b36d615c3efec51868e87bebe757feb1
For version 1.16, the SHA-1 checksum for repo is f3bfa7fd2d0a44aa40579bb0242cc20df37b5e17
Step 2: Initializing a Repo client
After installing Repo, set up your client to access the android source repository:
Create an empty directory to hold your working files. If you're using MacOS, this has to be on a case-sensitive filesystem. Give it any name you like:
Code:
$ mkdir I_HATE_STEVE
$ cd I_HATE_STEVE
Run repo init to bring down the latest version of Repo with all its most recent bug fixes. You must specify a URL for the manifest, which specifies where the various repositories included in the Android source will be placed within your working directory.
For AOSP:
Code:
$ repo init -u https://android.googlesource.com/platform/manifest -b android-4.1.1_r1
or
Code:
$ repo init -u https://android.googlesource.com/platform/manifest -b android-4.1.1_r2
or
Code:
$ repo init -u https://android.googlesource.com/platform/manifest -b android-4.1.1_r3
or even
Code:
$ repo init -u https://android.googlesource.com/platform/manifest -b ics-plus-aosp
For CM9:
Code:
$ repo init -u git://github.com/CyanogenMod/android.git -b ics
When prompted, please configure Repo with your real name and email address. To use the Gerrit code-review tool, you will need an email address that is connected with a registered Google account. Make sure this is a live address at which you can receive messages. The name that you provide here will show up in attributions for your code submissions.
A successful initialization will end with a message stating that Repo is initialized in your working directory. Your client directory should now contain a .repo directory where files such as the manifest will be kept.
Step 3: Getting the files
To pull down files to your working directory from the repositories as specified in the default manifest, run
Code:
$ repo sync
The Android source files will be located in your working directory under their project names. The initial sync operation will take an hour or more to complete, depending on your Internet bandwidth.
Note: If you initialize your repo on your root area for all projects, the time for downloading will decrease
If you haven't set up ccache now, now is a good time to set it up.
Chapter 2.5 (AOSP only): Downloading the various device specific configurations from GitHub
Now that you have a full copy of AOSP, you will realise that inside your working directory/device you will only see only a few device configurations. That's because AOSP only supports those devices and you will need to manually download other devices for use with AOSP.
You can either adapt from MaclawStudios' repo of the Galaxy Gio: https://github.com/MaclawStudios/android_device_samsung_gio
Or make an ICS device config yourself.
Meanwhile PabloPL has made an ICS branch here, but currently nothing is being worked on, as it seems.
Chapter 3: Building the System
The basic sequence of build commands is as follows:
Step 1: Initialize
Initialize the environment with the envsetup.sh script. Note that replacing "source" with a single dot saves a few characters, and the short form is more commonly used in documentation.
Either:
Code:
$ source build/envsetup.sh
or
Code:
$ . build/envsetup.sh
Step 2: Choose a target
Choose which target to build with lunch. The exact configuration can be passed as an argument, e.g.
Code:
$ lunch full-eng
The example above refers to a complete build for the emulator, with all debugging enabled.
If run with no arguments lunch will prompt you to choose a target from the menu.
Step 3: Build the Code
Build everything with make. GNU make can handle parallel tasks with a -jN argument, and it's common to use a number of tasks N that's between 1 and 2 times the number of hardware threads on the computer being used for the build. E.g. on a dual-E5520 machine (2 CPUs, 4 cores per CPU, 2 threads per core), the fastest builds are made with commands between make -j16 and make -j32.
If you are using a dual-core computer do either of these:
Code:
make -j2
or
Code:
make -j4
It is usually recommended that you make the -jN amount twice the number of cores your processor has.
Therefore if you have a quad-core processor do this:
Code:
make -j4
or
Code:
make -j8
There are different ways to run make:
Code:
$ make clean
or
Code:
$ make clobber
Cleans the compile directory and deletes all compiled files.
Code:
$ make update-api
Makes part of the framework, usually used to update the API.
Code:
make otapackage
Makes a flashable .zip file, as otapackage = Over The Air package.
Code:
make (app name, like framework-res)
Makes the specified app and the .apk will be compiled in the output directory.
Once you finish make, you are done! Congratulations!
Chapter 4: Troubleshooting Common Build Errors
Sometimes, things don't go as planned such as unexpected build errors. Here are some solutions to common problems:
Section 1: Wrong Java Version
If you are attempting to build froyo or earlier with Java 1.6, or gingerbread or later with Java 1.5, make will abort with a message such as
Code:
************************************************************
You are attempting to build with the incorrect version
of java.
Your version is: WRONG_VERSION.
The correct version is: RIGHT_VERSION.
Please follow the machine setup instructions at
https://source.android.com/source/download.html
************************************************************
This may be caused by:
failing to install the correct JDK as specified on the Initializing chapter. Building Android requires Sun JDK 5 or 6 depending on which release you are building.
another JDK that you previously installed appearing in your path. You can remove the offending JDK from your path with:
Code:
$ export PATH=${PATH/\/path\/to\/jdk\/dir:/}
Section 2: Python Version 3
Repo is built on particular functionality from Python 2.x and is unfortunately incompatible with Python 3. In order to use repo, please install Python 2.x:
Code:
$ apt-get install python
Optional Step: Setting up ccache
You can optionally tell the build to use the ccache compilation tool. Ccache acts as a compiler cache that can be used to speed-up rebuilds. This works very well if you do "make clean" often, or if you frequently switch between different build products.
Put the following in your .bashrc or equivalent.
Code:
$ export USE_CCACHE=1
By default the cache will be stored in ~/.ccache. If your home directory is on NFS or some other non-local filesystem, you will want to specify the directory in your .bashrc as well.
Code:
$ export CCACHE_DIR=
The suggested cache size is 50-100GB. You will need to run the following command once you have downloaded the source code, if you use CCache.
Code:
$ prebuilt/linux-x86/ccache/ccache -M 50G
Optional Step: Using a separate output directory
By default, the output of each build is stored in the out/ subdirectory of the matching source tree.
On some machines with multiple storage devices, builds are faster when storing the source files and the output on separate volumes. For additional performance, the output can be stored on a filesystem optimized for speed instead of crash robustness, since all files can be re-generated in case of filesystem corruption.
To set this up, export the OUT_DIR_COMMON_BASE variable to point to the location where your output directories will be stored.
Code:
export OUT_DIR_COMMON_BASE=
The output directory for each separate source tree will be named after the directory holding the source tree.
For instance, if you have source trees as /source/master1 and /source/master2 and OUT_DIR_COMMON_BASE is set to /output, the output directories will be /output/master1 and /output/master2.
It's important in that case to not have multiple source trees stored in directories that have the same name, as those would end up sharing an output directory, with unpredictable results.
This is only supported on branches newer than 4.0.x (IceCreamSandwich).
Wow dude. That's all I can say.
Woohoo, read through all that but I wont wanna try, and my comp is a piece of ****
Sent from my Galaxy Ace running J.A.F CM 7.2 Odexed using XDA App
MrChaosDesire said:
Woohoo, read through all that but I wont wanna try, and my comp is a piece of ****
Sent from my Galaxy Ace running J.A.F CM 7.2 Odexed using XDA App
Click to expand...
Click to collapse
Those are the recommended specs , not minimum
Wow nice tutorial Matt.but I can do nothing bcz i don't Know how to do coding lol...........
Sent from my GT-S5830 using xda premium
Lot of things to install, thanks for the tuto!
You never fail to impress buddy
Sent from my HTC Sensation XL with Beats Audio X315e using Tapatalk
traduz said:
Lot of things to install, thanks for the tuto!
Click to expand...
Click to collapse
Any errors occured ? Just post them in the thread .
Any solutions for unsolved errors ? Post them here too . Will update solutions
Sent from my GT-S5830 using XDA App
nice tut's bro..
Well i'm reading this day by day, just w8ing for money for a new computer lol, got one with 1gb only and freezes a lot with it =/
Thanks man, its gonna be my little anti-social project for tomorrow
Sent from my GT-S5830 using xda premium
Nice tut,Matt
thanks....everything clear from your tutorial......
one question : how much downloading will be done for AOSP and CM7 both....if i want to work on gingerbread
rocking.nitesh007 said:
thanks....everything clear from your tutorial......
one question : how much downloading will be done for AOSP and CM7 both....if i want to work on gingerbread
Click to expand...
Click to collapse
I think at least 50GB
thanx ...... will download it ill tke days .....
Sent from my GT-S5830 using XDA App
i have installed ubuntu 11 64bit in vmware .... does it affect when the rom ill be compling.....i use 3.2gb of 4gb ram in my virtual machine
Sent from my GT-S5830 using XDA App
rocking.nitesh007 said:
i have installed ubuntu 11 64bit in vmware .... does it affect when the rom ill be compling.....i use 3.2gb of 4gb ram in my virtual machine
Sent from my GT-S5830 using XDA App
Click to expand...
Click to collapse
If you're compiling gingerbread , there's no problem .
Sent from my GT-S5830 using XDA App
EmoBoiix3 said:
If you're compiling gingerbread , there's no problem .
Sent from my GT-S5830 using XDA App
Click to expand...
Click to collapse
thanks..... waiting for cm7 tut also ..... u guys rock
Sent from my GT-S5830 using XDA App
one more question .... what about 50GB .... i means i have read in different places somebody says its arnd 2GB of source of cm .. if u can specify dat would be great....
Sent from my GT-S5830 using XDA App

Tutorial: How to build a custom rom

Hey,
Today im gonna show you how to make a custom rom based on CM7 for Xperia Ray.
What you need:
1. A computer with atleast 50GB free space
2. A PC with atleast a dualcore CPU and atleast 1,5 GB ram and a 64bits OS.
3. A PC with Linux Mint or Ubuntu
4. A stable and fast internet connection
Click to expand...
Click to collapse
Step 1: Setting up the build machine
1. Open up the terminal and paste in the correct command for the distro you use:
Ubuntu 11.04:
sudo apt-get install git-core gnupg flex bison gperf libsdl1.2-dev libesd0-dev libwxgtk2.6-dev squashfs-tools build-essential zip curl libncurses5-dev zlib1g-dev openjdk-6-jdk pngcrush schedtool g++-multilib lib32z1-dev lib32ncurses5-dev lib32readline5-dev gcc-4.3-multilib g++-4.3-multilib
Click to expand...
Click to collapse
Newer than Ubuntu 11.04:
sudo apt-get install git-core gnupg flex bison gperf libsdl1.2-dev libesd0-dev libwxgtk2.6-dev squashfs-tools build-essential zip curl libncurses5-dev zlib1g-dev openjdk-6-jdk pngcrush schedtool g++-multilib lib32z1-dev lib32ncurses5-dev lib32readline-gplv2-dev
Click to expand...
Click to collapse
2. When the apt-get installation is done, type in this code in the Terminal.
mkdir -p ~/bin
mkdir -p ~/android/system
PATH=~/bin:$PATH
Click to expand...
Click to collapse
Step 2: Setting up the Repo Command
1. Enter this code in the Terminal:
curl https://dl-ssl.google.com/dl/googlesource/git-repo/repo > ~/bin/repo
chmod a+x ~/bin/repo
Click to expand...
Click to collapse
Step 3: Downloading the sourcecode
1. Type this into the Terminal to start downloading the CM sourcecode:
cd ~/android/system/
repo init -u git://github.com/CyanogenMod/android.git -b gingerbread
repo sync -j4
Click to expand...
Click to collapse
If you want to compile from jellybean sources, type this instead:
repo init -u git://github.com/CyanogenMod/android.git -b jellybean-stable
Click to expand...
Click to collapse
Hint:
If you want higher download speed and you have faster computer, make the J value higher, something around 10 is usually good for downloading sources.
Click to expand...
Click to collapse
If you want RomManager in your custom rom, use this command:
~/android/system/vendor/cyanogen/get-rommanager
Click to expand...
Click to collapse
2. Download Android-SDK by following this video tutorial:
http://www.youtube.com/watch?feature=player_embedded&v=dfdpYFMax8M
Step 4: Copy proprietary files:
!!!You dont need to do this to get a working rom!!!
Recommended roms for this:
CM7 or Stock Gingerbread
1. Types this into the terminal:
cd ~/android/system/device/semc/shakira/
./extract-files.sh
Click to expand...
Click to collapse
2. When finished with the previous step, type this into the terminal:
export PATH=${PATH}:~/android-sdk-linux/tools
export PATH=${PATH}:~/android-sdk-linux/platform-tools
Click to expand...
Click to collapse
Put correct path to ADB
3. Type:
./adb devices
If you recive:
"List of devices attached ????????????? no permissions”
Then type this into the Terminal:
sudo touch /etc/udev/rules.d/51-android.rules && sudo sh -c "echo 'SUBSYSTEM=="usb", ATTRS{idVendor}=="0fce", SYSFS{idProduct}=="612e", MODE="0666"' >> /etc/udev/rules.d/51-android.rules" && sudo chmod 644 /etc/udev/rules.d/51-android.rules
Click to expand...
Click to collapse
If something goes wrong, type:
lsusb
Click to expand...
Click to collapse
To see which devices is connected, type:
sudo restart udev
sudo ./adb kill-server
sudo ./adb start-server
Click to expand...
Click to collapse
And your ready
Step 5: Setting build enviroment
Type this into your terminal:
cd ~/android/system/
. build/envsetup.sh && lunch
Click to expand...
Click to collapse
You will see a lot of devices, select Urushi if your gonna compile for Xperia Ray.
Step 6: Building the custom rom
Type this into the Terminal to get your custom rom compiled:
make -j4 otapackage
Click to expand...
Click to collapse
It will take a while so be patient, and when its ready you will have your rom as a zip file.
If you liked this tutorial, please press the thanks button
How about based in jelly bean?
Sent from my Xperia Ray using xda app-developers app
zani18 said:
How about based in jelly bean?
Sent from my Xperia Ray using xda app-developers app
Click to expand...
Click to collapse
It should be almost the same, just different sources, I dont know where to find the FXP CM Jellybean Sources, so take a look for yourself.
The basics Lin Linux
Good work brov!!
Sent from my SK17 using xda app-developers app
Allen Hu said:
The basics Lin Linux
Good work brov!!
Sent from my SK17 using xda app-developers app
Click to expand...
Click to collapse
Thanks, if you liked my work, please press the thanks button
devstaff said:
Thanks, if you liked my work, please press the thanks button
Click to expand...
Click to collapse
Pressed
BTW what is the Git-Read Only??
Allen Hu said:
Pressed
BTW what is the Git-Read Only??
Click to expand...
Click to collapse
Idk, I used this myself, but I havent got anything about git read only:/
Thanks ......do you know how to make a custom rom with the rom kitchen and cywign ???
Really nice guide.....hope I upgrade my comp.soon to start build cm based roms .
sent straight from hell
dadierv17 said:
Thanks ......do you know how to make a custom rom with the rom kitchen and cywign ???
Click to expand...
Click to collapse
Yes, I know that also, I can make another tutorial about that
Sent from Xperia Ray powered by Jellybean using Tapatalk 2.
if you could I would really appreciate it, because I have several concerns with my rom
Great ! After my final exam im going to start be a newbie dev xperia ray will be having one newbie dev and i will need the help of master like u all
Support me?
Sent from my ST18i using xda premium
devstaff said:
It should be almost the same, just different sources, I dont know where to find the FXP CM Jellybean Sources, so take a look for yourself.
Click to expand...
Click to collapse
isn't enough to change in "Step 3: Downloading the sourcecode"...
repo init -u git://github.com/CyanogenMod/android.git -b gingerbread
to
repo init -u git://github.com/CyanogenMod/android.git -b jellybean-stable
I'm trying it now in ubuntu virtual machine and sources are downloaded, cut from terminal...
Code:
From git://github.com/CyanogenMod/android_packages_apps_Contacts
* [new branch] jellybean-stable -> github/jellybean-stable
finchcz said:
isn't enough to change in "Step 3: Downloading the sourcecode"...
repo init -u git://github.com/CyanogenMod/android.git -b gingerbread
to
repo init -u git://github.com/CyanogenMod/android.git -b jellybean-stable
I'm trying it now in ubuntu virtual machine and sources are downloaded, cut from terminal...
Code:
From git://github.com/CyanogenMod/android_packages_apps_Contacts
* [new branch] jellybean-stable -> github/jellybean-stable
Click to expand...
Click to collapse
Thanks for info, Ill add it to the main post
Sent from Xperia Ray powered by Jellybean using Tapatalk 2.
do you know this error and how to avoid? thx
Code:
Receiving objects: 99% (613428/613542), 952.14 MiB | 109 KiB/s
remote: Counting objects: 613542, done.
remote: Compressing objects: 100% (192910/192910), done.
Receiving objects: 100% (613542/613542), 952.21 MiB | 160 KiB/s, done.
Resolving deltas: 100% (372684/372684), done.
error: Cannot fetch CyanogenMod/android_frameworks_base
finchcz said:
do you know this error and how to avoid? thx
Code:
Receiving objects: 99% (613428/613542), 952.14 MiB | 109 KiB/s
remote: Counting objects: 613542, done.
remote: Compressing objects: 100% (192910/192910), done.
Receiving objects: 100% (613542/613542), 952.21 MiB | 160 KiB/s, done.
Resolving deltas: 100% (372684/372684), done.
error: Cannot fetch CyanogenMod/android_frameworks_base
Click to expand...
Click to collapse
I downloaded the sources earlier today, and it worked fine, so try to download them again
finchcz said:
do you know this error and how to avoid? thx
Code:
Receiving objects: 99% (613428/613542), 952.14 MiB | 109 KiB/s
remote: Counting objects: 613542, done.
remote: Compressing objects: 100% (192910/192910), done.
Receiving objects: 100% (613542/613542), 952.21 MiB | 160 KiB/s, done.
Resolving deltas: 100% (372684/372684), done.
error: Cannot fetch CyanogenMod/android_frameworks_base
Click to expand...
Click to collapse
just try to sync the repo again...if your internet connection is slow (or wonky) you may want to change the -j4 to something smaller,
like -j2....so in terminal try: repo sync -j2
hmm, now running for couple of hours with j10 and stucked at:
Code:
Receiving objects: 99% (613428/613542), 952.41 MiB | 282 KiB/s
will try tomorrow with lower value, thx for hint
finchcz said:
hmm, now running for couple of hours with j10 and stucked at:
Code:
Receiving objects: 99% (613428/613542), 952.41 MiB | 282 KiB/s
will try tomorrow with lower value, thx for hint
Click to expand...
Click to collapse
No worries...the first time takes the longest....I think it took me 3 days the first time..but once you have the repository the subsequent sync's will be much faster. ChampionSwimmer also has a tut for building AOKP in the Arc section, but it works for most of the Xperia devices: http://forum.xda-developers.com/showthread.php?t=1767578
This thread is a sticky now, thanks to the mods
Sent from Xperia Ray powered by Jellybean using Tapatalk 2.

[HOWTO] Compile Roms for the X+ in a nut shell

Ok guys i'm doing this as there's only two AOSP dev's (AOSP\CM\AOKP\PA) also i want to help get more people into developing.
This tutorial covers BOTH the AT&T and the International
This tutorial assumes you WONT be using a virtual machine but Linux installed onto your hard drive.
Prerequisites:
Able to read
Able to think
Not wanting your hand to be held
Able to use Linux
Ubuntu 10.04 > 12.04 (one of those)
AT LEAST 80gb free on your hard drive
Time
Patience
fastish internet
coffee (or tea or beer)
Computer Specs MINIMUM Dual core cpu and 4gb of ram and a ubuntu based OS 64bit
So your ready and read everything above lets get the show on the road.
if you are using ubuntu 10.04 to 11.10, you will need these files:
Code:
sudo apt-get install git-core gnupg flex bison gperf build-essential \ zip curl zlib1g-dev libc6-dev lib32ncurses5-dev ia32-libs \ x11proto-core-dev libx11-dev lib32readline5-dev lib32z-dev \ libgl1-mesa-dev g++-multilib mingw32 tofrodos python-markdown \ libxml2-utils xsltproc openjdk6-jdk
end of 10.04 > 11.10 section
if you are using Ubuntu 12.04 > you will need these files:
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 openjdk-7-jdk
and then run this command:
sudo ln -s /usr/lib/i386-linux-gnu/mesa/libGL.so.1 /usr/lib/i386-linux-gnu/libGL.so
if you get any errors showing up simply remove the offending package it's moaning about and install it manually later, i wont hold your hand with this.
end of 12.04 > section
now you have all those packages you want to grab the android source, for this tutorial i'll be using CM10.1 (4.2.2)
1st you will need to grab repo:
you need to make this folder for it to go into
mkdir ~/bin
PATH=~/bin:$PATH this is to tell linux where the bin folder is (in a nutshell)
now to Download the Repo script and ensure it is executable:
curl https://dl-ssl.google.com/dl/googlesource/git-repo/repo > ~/bin/repo
chmod a+x ~/bin/repo
ok that's that part done, now to grabbing the source and so on:
1st you need to make a folder to dump the source in, my folder layout is like this ~/Android/AOSP422 or ~/Android/CM10.1
but you can do it however you want
so for the benefits of this tutorial i'll be using ~/Android/CM10.1
mkdir ~/Android/CM10.1
cd ~/Android/CM10.1
thats the folder created and you have cd'd into it now to grab the source
repo init -u git://github.com/CyanogenMod/android.git -b cm-10.1
this is telling repo where the source is and what BRANCH to pull so we are pulling cm-10.1
once all that is done do the next command
repo sync -j# (the # = number of cores + 1) so on my i5 it only has 4cores so it's -j5 (but you can do a little bigger on a repo sync i tend to do a -j16 on my i5 for repo)
now go grab a coffee this can take a little while.
once all that is done and dusted you'll be wanting to start building, hold your horses you still need the device specific stuff, so make sure you are in the root of the CM.10.1 Directory, then type the following command:
for the AT&T X+ it's
AT&T will be updated in the near future. Please don't ask for it right now.
for the International X+ it's
git clone https://github.com/HoxPlusCMOfficial/android_device_htc_enrc2b -b cm-10.1 device/htc/enrc2b
git clone https://github.com/HoxPlusCMOfficial/android_vendor_htc_enrc2b -b master vendor/htc/enrc2b
git clone https://github.com/HoxPlusCMOfficial/android_kernel_htc_enrc2b -b master kernel/htc/enrc2b
git clone https://github.com/HoxPlusCMOfficial/android_device_htc_tegra3-common.git -b cm-10.1 device/htc/tegra3-common
that will grab down my CM10.1 device specific source
once that's downloaded
Get the CM prebuilts by doing the following:
cd vendor/cm/
./get-prebuilts
then cd back to the root dir
then the following commands to get the build going
. build/envsetup.sh
brunch evitareul or enrc2b depending on which device your building for.
and the build will get started, this can take anywhere from 4hrs > 30minutes
once it's all finished it will tell you where your zip file has poped out.
enjoy and don't forget if you used this tutorial link back to it in your rom op.
recommended reading:
http://source.android.com/source/initializing.html
and
http://wiki.cyanogenmod.org/w/Development
-Lloir
reserved just in case (might use this one for kernel building)
Might just try this for ****s and giggles
Sent from my HTC One X using Tapatalk 2
Hey Lloir, I'll be reading for years, but can you point me to the link on the cyanogenmod site or wherever, that explains why I did (repo sync -j#) and what exactly it did please, and thank you.
Edit: Found the info I was looking for, sorry, had some many tabs open, I didn't think to google.
Is it possible to setup in a virtual machine? If so what's needs to be done different? Thanks.
yes it is, you would need AT LEAST a quad core + 8gb of ram (2cores and 4gb for the virtual machine)
Good, simple guide
I think there might be a step missing before brunch:
Code:
cd vendor/cm
./get-prebuilts
...because the first time I ran brunch enrc2b I got this error:
Code:
make: *** No rule to make target `vendor/cm/proprietary/Term.apk', needed by `/android/cm-10.1/out/target/product/enrc2b/system/app/Term.apk'. Stop.
make: *** Waiting for unfinished jobs....
Woops my bad, thanks for pointing it out
Sent from my HTC One X+ using Tapatalk 2
Also, I needed to install lib32ncurses5-dev (sudo apt-get install lib32ncurses5-dev) on Ubuntu 12.04 amd64 to avoid the following errors when doing 'make menuconfig' for the kernel:
Code:
cripts/kconfig/mconf.o: In function `show_help':
mconf.c:(.text+0x744): undefined reference to `stdscr'
scripts/kconfig/mconf.o: In function `main':
mconf.c:(.text.startup+0x66): undefined reference to `initscr'
mconf.c:(.text.startup+0x6d): undefined reference to `stdscr'
scripts/kconfig/lxdialog/checklist.o: In function `print_arrows':
checklist.c:(.text+0x41): undefined reference to `wmove'
checklist.c:(.text+0x61): undefined reference to `acs_map'
checklist.c:(.text+0x69): undefined reference to `waddch'
checklist.c:(.text+0x7b): undefined reference to `waddnstr'
checklist.c:(.text+0x8c): undefined reference to `wmove'
checklist.c:(.text+0xb3): undefined reference to `acs_map'
checklist.c:(.text+0xbb): undefined reference to `waddch'
checklist.c:(.text+0x10b): undefined reference to `acs_map'
I don't think that compiling your own kernel is necessary, and it's not part of Lloir's instructions, but I thought I'd post this here because I imagine that people who are interested in compiling Cyanogenmod might also be interested in compiling a kernel for it as well.
Hey Lloir when I get to the git clone command I get an error fatal: could not create leading directories of '/device/htc/evitareul': Permission denied. When I googled it I found this:
The fix for this error: “fatal: could not create leading directories of '…': Permission denied” was much different than what I thought it would be. I'd think if permission was denied, it would be caused by folder or file mode. Not the case!
But let me take a step back and explain how I encountered this error. It was getting generated during a deployed using vlad. Thankfully the error report included the command that vlad was trying to execute. I tried running it manually and received the same response, so I broke it up into its pieces, then tried running them on the remote target. That revealed it was actually an ssh-key problem.
Wow! I'm surprised that the explanation was so far off the mark.
Anyway, all it took was to login to the remote target, ssh to the git origin remote server, accept the key, and away I went. Whee…
I'm going to play with it, but any pointers would be good. Using 12.04
EDIT: Is your git link dead?
n1gh7m4r3 said:
Hey Lloir when I get to the git clone command I get an error fatal: could not create leading directories of '/device/htc/evitareul': Permission denied. When I googled it I found this:
The fix for this error: “fatal: could not create leading directories of '…': Permission denied” was much different than what I thought it would be. I'd think if permission was denied, it would be caused by folder or file mode. Not the case!
But let me take a step back and explain how I encountered this error. It was getting generated during a deployed using vlad. Thankfully the error report included the command that vlad was trying to execute. I tried running it manually and received the same response, so I broke it up into its pieces, then tried running them on the remote target. That revealed it was actually an ssh-key problem.
Wow! I'm surprised that the explanation was so far off the mark.
Anyway, all it took was to login to the remote target, ssh to the git origin remote server, accept the key, and away I went. Whee…
I'm going to play with it, but any pointers would be good. Using 12.04
Click to expand...
Click to collapse
i typo'd don't do the /device just do device/ , or you could just cd into device mkdir htc cd into htc then git clone into there
BTW I'm glad many of you can read this tutorial, i'am awful at doing instructions for other people...if anyone has opinions on the way it's written please PM or re-write it and PM me and i'll replace the current one with a friendlier version.
-Lloir
Anyone know how to fix these errors:
Code:
Install: /android/cm-10.1/out/target/product/enrc2b/system/bin/dhcpcd
Install: /android/cm-10.1/out/target/product/enrc2b/system/bin/keystore
Install: /android/cm-10.1/out/target/product/enrc2b/system/bin/make_ext4fs
Install: /android/cm-10.1/out/target/product/enrc2b/system/bin/netcfg
target Executable: netd (/android/cm-10.1/out/target/product/enrc2b/obj/EXECUTABLES/netd_intermediates/LINKED/netd)
target Executable: vold (/android/cm-10.1/out/target/product/enrc2b/obj/EXECUTABLES/vold_intermediates/LINKED/vold)
target SharedLib: libpixelflinger (/android/cm-10.1/out/target/product/enrc2b/obj/SHARED_LIBRARIES/libpixelflinger_intermediates/LINKED/lib
pixelflinger.so)
/android/cm-10.1/prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.6/bin/../lib/gcc/arm-linux-androideabi/4.6.x-google/../../../../arm-li
nux-androideabi/bin/ld: /android/cm-10.1/out/target/product/enrc2b/obj/STATIC_LIBRARIES/libbt-brcm_bta_intermediates/libbt-brcm_bta.a(bta_a
g_sco.o): in function bta_ag_create_sco:external/bluetooth/bluedroid/bta/./ag/bta_ag_sco.c:538: error: undefined reference to 'BTM_SetWBSCo
dec'
/android/cm-10.1/prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.6/bin/../lib/gcc/arm-linux-androideabi/4.6.x-google/../../../../arm-li
nux-androideabi/bin/ld: /android/cm-10.1/out/target/product/enrc2b/obj/STATIC_LIBRARIES/libbt-brcm_bta_intermediates/libbt-brcm_bta.a(bta_a
g_sco.o): in function bta_ag_create_sco:external/bluetooth/bluedroid/bta/./ag/bta_ag_sco.c:542: error: undefined reference to 'BTM_ConfigI2
SPCM'
/android/cm-10.1/prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.6/bin/../lib/gcc/arm-linux-androideabi/4.6.x-google/../../../../arm-li
nux-androideabi/bin/ld: /android/cm-10.1/out/target/product/enrc2b/obj/STATIC_LIBRARIES/libbt-brcm_bta_intermediates/libbt-brcm_bta.a(bta_a
g_sco.o): in function bta_ag_sco_disc_cback:external/bluetooth/bluedroid/bta/./ag/bta_ag_sco.c:218: error: undefined reference to 'BTM_SetW
BSCodec'
/android/cm-10.1/prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.6/bin/../lib/gcc/arm-linux-androideabi/4.6.x-google/../../../../arm-li
nux-androideabi/bin/ld: /android/cm-10.1/out/target/product/enrc2b/obj/STATIC_LIBRARIES/libbt-brcm_bta_intermediates/libbt-brcm_bta.a(bta_a
g_sco.o): in function bta_ag_sco_conn_rsp:external/bluetooth/bluedroid/bta/./ag/bta_ag_sco.c:1529: error: undefined reference to 'BTM_Confi
gI2SPCM'
collect2: ld returned 1 exit status
make: *** [/android/cm-10.1/out/target/product/enrc2b/obj/SHARED_LIBRARIES/bluetooth.default_intermediates/LINKED/bluetooth.default.so] Err
or 1
make: *** Waiting for unfinished jobs....
Note: I didn't make the libGL.so symlink at first, but I have now and I've gone back and run brunch enrc2b again and I still get the same error.
woops i forgot all about that, the fix is'nt merged into CM yet
do the following
cd external/bluetooth/
rm -rf bluedroid
git clone https://github.com/maxwen/bluedroid.git
wait for that to download and then cd back into the root dir
(this will be needed for both devices when building)
n1gh7m4r3 said:
EDIT: Is your git link dead?
Click to expand...
Click to collapse
no....it's working, i just cloned from it to check to see if it was working
Code:
Package Complete: /android/cm-10.1/out/target/product/enrc2b/cm-10.1-20130313-UNOFFICIAL-enrc2b.zip
frankoid said:
Code:
Package Complete: /android/cm-10.1/out/target/product/enrc2b/cm-10.1-20130313-UNOFFICIAL-enrc2b.zip
Click to expand...
Click to collapse
grats :good:
Lloir said:
BTW I'm glad many of you can read this tutorial, i'am awful at doing instructions for other people...if anyone has opinions on the way it's written please PM or re-write it and PM me and i'll replace the current one with a friendlier version.
Click to expand...
Click to collapse
I personally found it very useful. I've built CM before for other devices, but I didn't realise how easy it was to build it using an unofficial device tree - I didn't know it was simply a case of dropping the device tree into devices/.
frankoid said:
I personally found it very useful. I've built CM before for other devices, but I didn't realise how easy it was to build it using an unofficial device tree - I didn't know it was simply a case of dropping the device tree into devices/.
Click to expand...
Click to collapse
my device tree is a very lazy tree, it's supposed to have a vendor tree, but i've slammed it all into one.
These instructions pretty much cover any ROM, except for where you grab the source from..
Sent from my HTC One X+ using Tapatalk 2
the ATT git clone command should be: git clone https://bitbucket.org/Lloir/android_device_htc_evitareul.git and not: git clone https://[email protected]/Lloir/an..._evitareul.git -b CM10.1
I believe this is/was my problem.
EDIT: or perhaps git clone https://bitbucket.org/Lloir/android_device_htc_evitareul.git -b CM10.1
EDIT2: It isn't showing correctly in the thread. replace the ... with device, and it should work.

[GUIDE][LINUX][Fedora 25] Setting up an Android compile environment

This post is mainly to communicate the packages required to get Fedora 25 ready to build android/AOSP. I don't intend to cover the Installation of Fedora, or the actual steps to generate the build (manifests, proprietary code, etc).
From a clean installation of Fedora 25:
Update the installation
Code:
dnf update
Install additional packages that we need to compile AOSP
(adapted from the Omni guide for F-19_64)
Code:
dnf -y install zip curl gcc gcc-c++ flex bison gperf glibc-devel.{x86_64,i686} zlib-devel.{x86_64,i686} ncurses-devel.i686 libX11-devel.i686 libstdc++.i686 readline-devel.i686 libXrender.i686 libXrandr.i686 perl-Digest-MD5-File python-markdown mesa-libGL-devel.i686 git schedtool pngcrush ncurses-compat-libs java-1.8.0-openjdk-devel xz-lzma-compat
Now let's grab some stuff from Google
Code:
mkdir -p ~/bin
curl http://commondatastorage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
chmod a+x ~/bin/repo
Add to end of ~/.bashrc
Code:
export PATH=~/bin:$PATH
Configure git to identify you
Code:
git config --global user.email "[email protected]"
git config --global user.name "Your Name"
At this point, the environment is ready to compile AOSP.
The remaining steps (getting & building the code, generating local manifest(s), looking up errors) are not distribution dependent, and are already posted in many places.
Create vendor directory, initialize repo , and download/sync the code (see vendor manifest page).
example:
Code:
mkdir -p ~/android/slim7
cd ~/android/slim7
repo init -u git://github.com/SlimRoms/platform_manifest.git -b ng7.1
repo sync -j#
Happy building,
-Cyril279
Super helpful guide. Thank you. I also ran the following to make sure I had all the stuff I needed.
Code:
sudo dnf groupinstall 'C Development Tools and Libraries'
Does LineageOS require extra packages? I am pretty sure it requires ImageMagick too.
cyril279 said:
This post is mainly to communicate the packages required to get Fedora 25 ready to build android/AOSP. I don't intend to cover the Installation of Fedora, or the actual steps to generate the build (manifests, proprietary code, etc).
-Cyril279
Click to expand...
Click to collapse
You created Android with Fedora?
FEDORA 30 Lineage 15.0
Code:
bash-5.0# java -version
java version "1.8.0_221"
Java(TM) SE Runtime Environment (build 1.8.0_221-b11)
Java HotSpot(TM) 64-Bit Server VM (build 25.221-b11, mixed mode)
Code:
ninja: no work to do.
[2/3] glob vendor/*/*/Android.bp
[1/1] /home/U-16/WORKING_DIRECTORY/out...ORKING_DIRECTORY/out/soong/build.ninja
18:43:57 *******************************************************
18:43:57 You are attempting to build with an unsupported JDK.
18:43:57
18:43:57 Only an OpenJDK based JDK is supported.
18:43:57
18:43:57 Please follow the machine setup instructions at:
18:43:57 https://source.android.com/source/initializing.html
18:43:57 *******************************************************
18:43:57 stop
make: *** [build/core/main.mk:21: run_soong_ui] error 1
bash-5.0#
taras-fedora-syn said:
You created Android with Fedora?
Click to expand...
Click to collapse
Yes. Let the errors be your guide.
cyril279 said:
errors
Click to expand...
Click to collapse
Hi! Compiling AOSP 7.1.2 for Sharp Z2 MT6797
eMachines eME642 AMD® Athlon(tm) ii p340 dual-core processor × 2
Fedora 34
Is my processor too weak?​
Notice file: prebuilts/tools/common/netbeans-visual/NOTICE -- out/host/linux-x86/obj/NOTICE_FILES/src//framework/org-openide-util.jar.txt
make: *** No rule to make target 'out/host/linux-x86/obj32/lib/libbcinfo.so', needed by 'out/host/linux-x86/obj32/lib/libbcc.so'. Stop.
LOG https://gist.githubusercontent.com/...9b1ad4b81a9de6124470aef15e89bca/gistfile1.txt

Code Aurora's Android for MSM - Unable to downlad the project files using Git/Repo

Hi
I am coming from a non-OS embedded firmware and Windows OS background and a newbie to the Linux and Android OS world.
I have got a Qualcomm Snapdragon 400 development kit which is running a specific version of Android OS from Code Aurora. I want to download the source project of this OS to be able to make a few changes and rebuilt it.
The specific version I need is "LA.BR.1.2.4-01810-8x16.0" as listed at Code Aurora website under "Android for MSM Project" (I am unable to post the weblink being a newbie of this forum).
To get this project, I am following the instructions listed at this website which are:
Releases are available for download using Repo and Git. A specific release is downloaded by choosing both a branch and manifest from the Releases table.
$ repo init -u git://codeaurora.org/platform/manifest.git -b [branch] -m [manifest] --repo-url=git://codeaurora.org/tools/repo.git --repo-branch=caf-stable
$ repo sync
But I am getting some errors and unable to resolve them.
Here is the terminal window log when I try to get the source files using Git/Repo as per the link above.
[email protected]:~/Documents/S.Ali/BW/410$ repo init -u git://codeaurora.org/platform/manifest.git -b release -m LA.BR.1.2.4-01810-8x16.0.xml --repo-url=git://codeaurora.org/tools/repo.git --repo-branch=caf-stable
remote: Counting objects: 18, done.
remote: Compressing objects: 100% (12/12), done.
remote: Total 18 (delta 3), reused 0 (delta 0)
Unpacking objects: 100% (18/18), done.
From git://codeaurora.org/platform/manifest
65b6e6e..3004d8c aosp-new/emu-2.4-release -> origin/aosp-new/emu-2.4-release
c005393..52b8e1a aosp-new/lldb-master-dev -> origin/aosp-new/lldb-master-dev
7e723b6..eae6bdf aosp-new/lollipop-mr1-cts-release -> origin/aosp-new/lollipop-mr1-cts-release
88ac9b4..84298e7 aosp-new/marshmallow-cts-release -> origin/aosp-new/marshmallow-cts-release
1e9af62..83fe89c aosp-new/nougat-cts-release -> origin/aosp-new/nougat-cts-release
0498397..f505234 aosp-new/nougat-mr1-cts-release -> origin/aosp-new/nougat-mr1-cts-release
error: in `init -u git://codeaurora.org/platform/manifest.git -b release -m LA.BR.1.2.4-01810-8x16.0.xml --repo-url=git://codeaurora.org/tools/repo.git --repo-branch=caf-stable`: [Errno 2] No such file or directory: '/home/digital/.repo/manifests/.git/HEAD'
error: manifest missing or unreadable -- please run init
and when I try again, I get:
[email protected]:~/Documents/S.Ali/BW/410$ repo init -u git://codeaurora.org/platform/manifest.git -b release -m LA.BR.1.2.4-01810-8x16.0.xml --repo-url=git://codeaurora.org/tools/repo.git --repo-branch=caf-stable
error: in `init -u git://codeaurora.org/platform/manifest.git -b release -m LA.BR.1.2.4-01810-8x16.0.xml --repo-url=git://codeaurora.org/tools/repo.git --repo-branch=caf-stable`: [Errno 2] No such file or directory: '/home/digital/.repo/manifests/.git/HEAD'
error: manifest missing or unreadable -- please run init
Probably I am doing something silly and/or missing something very basic.
I would be very grateful for your help in resolving this issue.
Thanks

Categories

Resources