[GUIDE] How to configure Ubuntu 14.04 Trusty Tahr daily builds for compiling ROMs - Android

In the last few days I started to try the Ubuntu 14.04 daily builds on my computer and I tried to configure it to compile android roms and managed to get a working configuration :laugh:
This guide is meant for Ubuntu 14.04 Trusty Tahr 64 bit. 32 Bit won't work.
If you want to use another ubuntu version, some things might be a little different. Just search on xda and you will find all the instructions that you need to complete the setup.
DISCLAMER
Although the procedures in this guide were tested on my pc/phone and produced a working build for my Galaxy Nexus, I take no responsibility for any consequences derived from their use.
1) SET UP THE BUILD ENVIRONMENT
Remove openJDK and install Java 6 jdk. Open a terminal and type:
Code:
sudo apt-get purge openjdk-\* icedtea-\* icedtea6-\*
This will uninstall openJDK.
Code:
sudo add-apt-repository ppa:webupd8team/java
Adds a PPA to your system, needed to download java.
Code:
sudo apt-get update && sudo apt-get install oracle-java6-installer
Download and installs java!
To make sure the correct version of Java is activated, run the following at the Terminal prompt:
Code:
java -version
You should see something like that:
java version "1.6.0_45"
Java(TM) SE Runtime Environment (build 1.6.0_45-b06)
Java HotSpot(TM) 64-Bit Server VM (build 20.45-b01, mixed mode)
Now type:
Code:
sudo apt-get install git-core gnupg flex bison gperf build-essential zip curl zlib1g-dev zlib1g-dev:i386 libc6-dev lib32ncurses5-dev x11proto-core-dev libx11-dev:i386 libreadline6-dev:i386 lib32z-dev libgl1-mesa-glx:i386 libgl1-mesa-dev g++-multilib mingw32 tofrodos python-markdown libxml2-utils xsltproc readline-common libreadline6-dev libreadline6 lib32readline-gplv2-dev libncurses5-dev lib32readline5 lib32readline6 libreadline-dev libreadline6-dev:i386 libreadline6:i386 bzip2 libbz2-dev libbz2-1.0 libghc-bzlib-dev lib32bz2-dev libsdl1.2-dev libesd0-dev squashfs-tools pngcrush schedtool libwxgtk2.8-dev python lzop
This will install the needed packages.
When done, do this:
Code:
sudo ln -s /usr/lib/i386-linux-gnu/mesa/libGL.so.1 /usr/lib/i386-linux-gnu/libGL.so
Now, install the repo binary:
Code:
mkdir ~/bin && curl https://dl-ssl.google.com/dl/googlesource/git-repo/repo > ~/bin/repo && chmod a+x ~/bin/repo
Edit .bashrc:
Code:
sudo nano ~/.bashrc
At the bottom of the file, add the following line:
Code:
export PATH=~/bin:$PATH
Save it (In nano type Ctrl-O and then Enter, then Ctrl-X to exit back to a prompt).
Restart bash:
Code:
source ~/.bashrc
Now you can download the sources of the rom that you want to compile, I make an examble for cm10.2:
2) DOWNLOAD THE SOURCES:
Code:
mkdir ~/cyanogenmod
cd ~/cyanogenmod
This creates a folder named "cyanogenmod" and opens it.
Initialize the repo:
Code:
repo init -u git://github.com/CyanogenMod/android.git -b cm-10.2
Download time!
Code:
repo sync
It will download about 10gb of data, so be patient!
Then get your device files and binaries and compile!
For a guide on how compile a ROM from source, just search on xda or look in my signature, there's also a guide for compiling roms.

Reserved

Updated the op with instructions for beta release

elia222 said:
Updated the op with instructions for beta release
Click to expand...
Click to collapse
I just installed Ubuntu 13.10 (fresh install in seprate HDD ) and i got error in step 1
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}

ShoaibAhmed said:
I just installed Ubuntu 13.10 (fresh install in seprate HDD ) and i got error in step 1
Click to expand...
Click to collapse
This: http://askubuntu.com/questions/15433/how-do-i-fix-a-could-not-get-lock-var-lib-dpkg-lock-problem may help you.

Updated the op with instructions for 14.04 daily releases

This is crazy, I didnt even know ubuntu 14.04 was out till now, it just released a couple days ago! Great work dude:good:

noob
shoot me if i ask stupid questions but im new to this:
i wanna start with building a cm KOT49E rom for maguro: where do i get the files i need? like ´device tree' and things like that,i know there on github but then what? how do you ´ćherry pick' things?

firebird11 said:
shoot me if i ask stupid questions but im new to this:
i wanna start with building a cm KOT49E rom for maguro: where do i get the files i need? like ´device tree' and things like that,i know there on github but then what? how do you ´ćherry pick' things?
Click to expand...
Click to collapse
You can get device and kernel tree from cyanogenmod github (android_device_samsung_tuna, android_device_samsung_maguro, kernel_Samsung_tuna).
There's a good guide on xda called "how to use github" that explains cherry-picking and some other useful stuff.

error
self._write_file(output_dir, generator(), file_name)
gperf = subprocess.Popen(gperf_args, stdin=subprocess.PIPE, stdout=subprocess.PIPE)
File "scripts/make_css_value_keywords.py", line 172, in generate_implementation
File "/usr/lib/python2.7/subprocess.py", line 679, in __init__
gperf = subprocess.Popen(gperf_args, stdin=subprocess.PIPE, stdout=subprocess.PIPE)
errread, errwrite)
File "/usr/lib/python2.7/subprocess.py", line 1249, in _execute_child
File "/usr/lib/python2.7/subprocess.py", line 679, in __init__
raise child_exception
errread, errwrite)
OSError: [Errno 2] No such file or directory
File "/usr/lib/python2.7/subprocess.py", line 1249, in _execute_child
raise child_exception
OSError: [Errno 2] No such file or directory
make: *** [/home/firebird11/android/system/out/target/product/maguro/obj/GYP/shared_intermediates/blink/CSSPropertyNames.cpp] Error 1
make: *** Waiting for unfinished jobs....
make: *** [/home/firebird11/android/system/out/target/product/maguro/obj/GYP/shared_intermediates/blink/CSSValueKeywords.cpp] Error 1
[email protected]:~/android/system$
Click to expand...
Click to collapse
iḿ getting this error all the time and looked for it on google but canẗ find the right answer,, do you know what is wrong here?

ok, error solved, got something to do with sdk,
1 question: how do i merge a fork ,letś say "halo" in my build?
i downloaded it but dont know what to do? can i just simply put it in the build directory?

I am having trouble setting up JDK 6 via the method in the OP. Did it setup just fine for everyone else? I could use a little help setting up JDK 6 please.

elia222 said:
In the last few days I started to try the Ubuntu 14.04 daily builds on my computer and I tried to configure it to compile android roms and managed to get a working configuration :laugh:
This guide is meant for Ubuntu 14.04 Trusty Tahr 64 bit. 32 Bit won't work.
If you want to use another ubuntu version, some things might be a little different. Just search on xda and you will find all the instructions that you need to complete the setup.
DISCLAMER
Although the procedures in this guide were tested on my pc/phone and produced a working build for my Galaxy Nexus, I take no responsibility for any consequences derived from their use.
1) SET UP THE BUILD ENVIRONMENT
Remove openJDK and install Java 6 jdk. Open a terminal and type:
Code:
sudo apt-get purge openjdk-\* icedtea-\* icedtea6-\*
This will uninstall openJDK.
Code:
sudo add-apt-repository ppa:webupd8team/java
Adds a PPA to your system, needed to download java.
Code:
sudo apt-get update && sudo apt-get install oracle-java6-installer
Download and installs java!
To make sure the correct version of Java is activated, run the following at the Terminal prompt:
Code:
java -version
You should see something like that:
java version "1.6.0_45"
Java(TM) SE Runtime Environment (build 1.6.0_45-b06)
Java HotSpot(TM) 64-Bit Server VM (build 20.45-b01, mixed mode)
Now type:
Code:
sudo apt-get install git-core gnupg flex bison gperf build-essential zip curl zlib1g-dev zlib1g-dev:i386 libc6-dev lib32ncurses5-dev x11proto-core-dev libx11-dev:i386 libreadline6-dev:i386 lib32z-dev libgl1-mesa-glx:i386 libgl1-mesa-dev g++-multilib mingw32 tofrodos python-markdown libxml2-utils xsltproc readline-common libreadline6-dev libreadline6 lib32readline-gplv2-dev libncurses5-dev lib32readline5 lib32readline6 libreadline-dev libreadline6-dev:i386 libreadline6:i386 bzip2 libbz2-dev libbz2-1.0 libghc-bzlib-dev lib32bz2-dev libsdl1.2-dev libesd0-dev squashfs-tools pngcrush schedtool libwxgtk2.8-dev python lzop
This will install the needed packages.
When done, do this:
Code:
sudo ln -s /usr/lib/i386-linux-gnu/mesa/libGL.so.1 /usr/lib/i386-linux-gnu/libGL.so
Now, install the repo binary:
Code:
mkdir ~/bin && curl https://dl-ssl.google.com/dl/googlesource/git-repo/repo > ~/bin/repo && chmod a+x ~/bin/repo
Edit .bashrc:
Code:
sudo nano ~/.bashrc
At the bottom of the file, add the following line:
Code:
export PATH=~/bin:$PATH
Save it (In nano type Ctrl-O and then Enter, then Ctrl-X to exit back to a prompt).
Restart bash:
Code:
source ~/.bashrc
Now you can download the sources of the rom that you want to compile, I make an examble for cm10.2:
2) DOWNLOAD THE SOURCES:
Code:
mkdir ~/cyanogenmod
cd ~/cyanogenmod
This creates a folder named "cyanogenmod" and opens it.
Initialize the repo:
Code:
repo init -u git://github.com/CyanogenMod/android.git -b cm-10.2
Download time!
Code:
repo sync
It will download about 10gb of data, so be patient!
Then get your device files and binaries and compile!
For a guide on how compile a ROM from source, just search on xda or look in my signature, there's also a guide for compiling roms.
Click to expand...
Click to collapse
E: Unable to locate package oracle-java6-installer
??? i added the ppa and updated
Edit: there is no java6 intsaller for trusty, only 7 and 8, you have to intsall it manually
Also then repo bin thing should be: mkdir ~/bin && curl http://commondatastorage.googleapis.com/git-repo-downloads/repo > ~/bin/repo && chmod a+x ~/bin/repo

Aaahh said:
E: Unable to locate package oracle-java6-installer
??? i added the ppa and updated
Edit: there is no java6 intsaller for trusty, only 7 and 8, you have to intsall it manually
Also then repo bin thing should be: mkdir ~/bin && curl http://commondatastorage.googleapis.com/git-repo-downloads/repo > ~/bin/repo && chmod a+x ~/bin/repo
Click to expand...
Click to collapse
Yeah. This is not an accurate guide. I had trouble getting java 6 installed too. There is a link at the bottom of this post and it will show you how I did it. Had to install it manually. Everything else should work properly I think. Anyways, if you have any questions about setting it up, feel free to PM me.
install java - http://askubuntu.com/questions/67909/how-do-i-install-oracle-jdk-6
install gksu - http://askubuntu.com/questions/290810/how-to-add-gksudo-or-what-to-use-instead-in-ubuntu-13-04
That should get you going on the java part.

to get Java JDK 6 do following (for install to a system without graphical Interface and above workaround not work):
1. Download the jdk-6u38-linux-x64.bin from the Oracle/Sun Java Download Area
Code:
wget --no-cookies --header "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com" "http://download.oracle.com/otn-pub/java/jdk/6u38-b05/jdk-6u38-linux-x64.bin"
2. Make the bin file executable:
Code:
chmod +x jdk-6u38-linux-x64.bin
3. Extract the bin file:
Code:
./jdk-6u38-linux-x64.bin
4. Move the extracted folder to this this location:
Code:
sudo mv jdk1.6.0_38 /usr/lib/jvm/./jdk-6u38-linux-x64.bin
5. Install the new Java source in system:
Code:
sudo update-alternatives --install /usr/bin/javac javac /usr/lib/jvm/jdk-6u38-linux-x64.bin/bin/javac 1
sudo update-alternatives --install /usr/bin/java java /usr/lib/jvm/jdk-6u38-linux-x64.bin/bin/java 1
sudo update-alternatives --install /usr/bin/javaws javaws /usr/lib/jvm/jdk-6u38-linux-x64.bin/bin/javaws 1
sudo update-alternatives --install /usr/bin/javadoc javadoc /usr/lib/jvm/jdk-6u38-linux-x64.bin/bin/javadoc 1
sudo update-alternatives --install /usr/bin/javah javah /usr/lib/jvm/jdk-6u38-linux-x64.bin/bin/javah 1
sudo update-alternatives --install /usr/bin/javap javap /usr/lib/jvm/jdk-6u38-linux-x64.bin/bin/javap 1
sudo update-alternatives --install /usr/bin/jar jar /usr/lib/jvm/jdk-6u38-linux-x64.bin/bin/jar 1
6. Select the default Java version for your system:
Code:
sudo update-alternatives --config javac
sudo update-alternatives --config java
sudo update-alternatives --config javaws
sudo update-alternatives --config javadoc
sudo update-alternatives --config javah
sudo update-alternatives --config javap
sudo update-alternatives --config jar
7. Check Java version:
Code:
java -version
8. Verify the symlinks. Javac, Java, Javaws, Javadoc, Javah, Javap and Jar should all point to the new Java location and version:
Code:
ls -la /etc/alternatives/java* && ls -la /etc/alternatives/jar

MetaIIica said:
to get Java JDK 6 do following (for install to a system without graphical Interface and above workaround not work):
1. Download the jdk-6u38-linux-x64.bin from the Oracle/Sun Java Download Area
Code:
wget --no-cookies --header "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com" "http://download.oracle.com/otn-pub/java/jdk/6u38-b05/jdk-6u38-linux-x64.bin"
2. Make the bin file executable:
Code:
chmod +x jdk-6u38-linux-x64.bin
3. Extract the bin file:
Code:
./jdk-6u38-linux-x64.bin
4. Move the extracted folder to this this location:
Code:
sudo mv jdk1.6.0_38 /usr/lib/jvm/./jdk-6u38-linux-x64.bin
5. Install the new Java source in system:
Code:
sudo update-alternatives --install /usr/bin/javac javac /usr/lib/jvm/jdk-6u38-linux-x64.bin/bin/javac 1
sudo update-alternatives --install /usr/bin/java java /usr/lib/jvm/jdk-6u38-linux-x64.bin/bin/java 1
sudo update-alternatives --install /usr/bin/javaws javaws /usr/lib/jvm/jdk-6u38-linux-x64.bin/bin/javaws 1
sudo update-alternatives --install /usr/bin/javadoc javadoc /usr/lib/jvm/jdk-6u38-linux-x64.bin/bin/javadoc 1
sudo update-alternatives --install /usr/bin/javah javah /usr/lib/jvm/jdk-6u38-linux-x64.bin/bin/javah 1
sudo update-alternatives --install /usr/bin/javap javap /usr/lib/jvm/jdk-6u38-linux-x64.bin/bin/javap 1
sudo update-alternatives --install /usr/bin/jar jar /usr/lib/jvm/jdk-6u38-linux-x64.bin/bin/jar 1
6. Select the default Java version for your system:
Code:
sudo update-alternatives --config javac
sudo update-alternatives --config java
sudo update-alternatives --config javaws
sudo update-alternatives --config javadoc
sudo update-alternatives --config javah
sudo update-alternatives --config javap
sudo update-alternatives --config jar
7. Check Java version:
Code:
java -version
8. Verify the symlinks. Javac, Java, Javaws, Javadoc, Javah, Javap and Jar should all point to the new Java location and version:
Code:
ls -la /etc/alternatives/java* && ls -la /etc/alternatives/jar
Click to expand...
Click to collapse
ALSO add to path and thats 38 not 45... doesn't really matter but still.

Its a sample and you can replace 6u38 with 6u45
work fine too

This work better, faster and install every time the last JDK 6
Needed if have apt-apt-repository Command not found
Code:
sudo apt-get install -y python-software-properties
Then
Code:
sudo add-apt-repository "deb http://ppa.launchpad.net/webupd8team/java/ubuntu precise main"
sudo apt-get update
sudo apt-get install -y oracle-java6-installer
java -version
ls -la /etc/alternatives/java* && ls -la /etc/alternatives/jar

I was able to install oracle jdk 6 without any problem, using elia222's method

These instructions worked perfectly on 14.04 (update from 13.10 using update-manager -d)! :good:

Related

[Q] sun-java6-jdk Ubuntu 11.10

It appears sun-java6-jdk has been removed from the Canonical repository. I added "http://archive.canonical.com/ lucid partner" to my sources, but the package is not there. Are there any alternative ways to install it?
There are quite plenty of ways actually:
1. Install from some ppa:
Code:
sudo add-apt-repository ppa:ferramroberto/java
sudo apt-get update
sudo apt-get install sun-java6-jdk sun-java6-plugin
2. Download bin package from oracle site, but that's not ubuntu-way.
3. This one i like the most: create your own packages
http://www.techytalk.info/latest-oracle-sun-java-jdk-and-jre-6-on-ubuntu-operating-systems/
and in any case, don't forget to
Code:
sudo update-alternatives --config java
inflim said:
There are quite plenty of ways actually:
1. Install from some ppa:
Code:
sudo add-apt-repository ppa:ferramroberto/java
sudo apt-get update
sudo apt-get install sun-java6-jdk sun-java6-plugin
2. Download bin package from oracle site, but that's not ubuntu-way.
3. This one i like the most: create your own packages
http://www.techytalk.info/latest-oracle-sun-java-jdk-and-jre-6-on-ubuntu-operating-systems/
and in any case, don't forget to
Code:
sudo update-alternatives --config java
Click to expand...
Click to collapse
It worked, Thank You!
No problem! Google rules

[How-TO] Building badadroid CM10.1 from source code

Hi all
This is a TUT for building badadroid CM 10 kernel from source code
Step 1 : Setup your build environment
1.Setup Ubuntu 64-bit (I am using 12.04 but i recommend using 11.10)
-http://releases.ubuntu.com/
-It is recommended to install Ubuntu on a 40GB ext4 partition to have enough space for your source code
Step 2 : Install required packages to build a ROM (we are compiling kernel but you can build the ROM too)
-first Run this command to update your package lists
Code:
sudo apt-get update
-Run this command in terminal to download packages (Just copy-paste)(press y and enter when promoted)
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-glx:i386 \
libgl1-mesa-dev g++-multilib mingw32 openjdk-6-jdk tofrodos \
python-markdown libxml2-utils xsltproc zlib1g-dev:i386
-Run this command to fix an incorrect library with Ubuntu 11.10 and above
Code:
sudo ln -s /usr/lib/i386-linux-gnu/mesa/libGL.so.1 /usr/lib/i386-linux-gnu/libGL.so
Step 3 : Preparing Repo
-Run these commands (each line is a command)
Code:
mkdir ~/bin
export PATH=~/bin:$PATH
curl https://dl-ssl.google.com/dl/googlesource/git-repo/repo > repo
chmod a+x ~/bin/repo
if any error happen with these commands don't ever re-run it with sudo(I did that mistake before )....post your error
Step 4 : Downloading Repo sources(maybe later we can separate kernel source from ROM)
-Run these commads
Code:
cd ~
mkdir wave
cd wave
repo init -u git://github.com/CyanogenMod/android.git -b jellybean
cd .repo
wget https://raw.github.com/Badadroid/android_wave_local_manifest/jellybean/local_manifest.xml
cd ..
repo sync -j8
Notes
-repo sync command will take really a lot of time to finish depending on your Internet connection speed (about 10 GBs of download)
-If you just want to pause this download and continue later just close terminal then when you want to continue run these commands
Code:
cd ~
cd wave
repo sync -j8
Step 5 : Including tools for the build
-Run these commands just one time
Code:
cd vendor/cm/
./get-prebuilts
cd ../../
-Then run this command before each build
Code:
. build/envsetup.sh
Step 6 : Building
-To build kernel run these commands
Code:
lunch cm_wave-userdebug
make bootimage
-To build ROM run this command
Code:
brunch wave
Big Thanks to:
-Linux developers
-badadroid team
-CM 10 developers
-xda-university
-anyone i forgot to mention
Got any Questions just ask
Best Regards
For repo sync a "-j8" mean make 8 downloading pattern at same time, better if you use more like 32 for more fast downloading
For brunch wave -j2 mean use double core if you got 4 core then -j4
You can install :
sudo apt-get install ccache
add "export USE_CCACHE=1" without quote on your /home/USER/.bashrc
Then command like this :
ccache -M 6 (mean 6giga cache)
ccache -C clear all cache
ccache -c clean old cache
I felt free to translate this tutorial into German...
You can red German version here...
Good. Just btw - it ain't no CM10.1 but 10.0. ;]
Thank u so much for the guide. (mylove90 and Tigrouzen)
What exactly does this badadroid look like and does it mean the samsung bada os + the android os merged together. And How does it work?
Sent from my GT-I9300 using xda premium

[NEWBIES]How to build cm10.2 for this device

Building on Ubuntu 12.04 is currently only experimentally supported and is not guaranteed to work on branches other than master.
Installing required packages (Ubuntu 12.04)
Code:
$ sudo apt-get install git gnupg flex bison gperf build-essential \
zip curl libc6-dev libncurses5-dev:i386 x11proto-core-dev \
libx11-dev:i386 libreadline6-dev:i386 libgl1-mesa-glx:i386 \
libgl1-mesa-dev g++-multilib mingw32 tofrodos \
python-markdown libxml2-utils xsltproc zlib1g-dev:i386
$ sudo ln -s /usr/lib/i386-linux-gnu/mesa/libGL.so.1 /usr/lib/i386-linux-gnu/libGL.so
Installing Repo
Code:
$ mkdir ~/bin
$ PATH=~/bin:$PATH
Code:
$ curl https://dl-ssl.google.com/dl/googlesource/git-repo/repo > ~/bin/repo
$ chmod a+x ~/bin/repo
Now 80% of your work is done.. Now its time for actual cm10.2 development
Code:
mkdir -p cm10.2
Code:
$ PATH=~/bin:$PATH
Code:
cd cm10.2
Code:
repo init -u git://github.com/androidarmv6/android.git -b cm-10.2
Code:
repo sync -jX
where X is any integer. If you have high speed connection then try something like -j16 or -j32
This will take long time because you are trying to download around 15gb
Once this is done go in your cm10.2 directory and do this
Code:
sh vendor/cm/get-prebuilts
Congrats your build machine is now ready.
Create a script named " compile.sh " inside cm10.2 folder and paste these contents inside it.
Code:
#!/system/bin/sh
PATH=~/bin:$PATH
repo sync -j32
.build/envsetup.sh
export USE_CCACHE=1
make clean
brunch protou
So to start compiling you have to do this command inside your cm10.2 folder
Code:
sh compile.sh
This will give you a basic build machine. I haven't added the device specific stuff yet. To do that:
Assuming you are in cm10.2 folder before each step.
1.Create device tree
Code:
mkdir -p /device/htc
Go in /device/htc
Code:
git clone https://github.com/prototype-U/android_device_htc_protou.git
Rename this folder to protou
Code:
git clone https://github.com/ProtouProject/android_device_htc_common.git
Rename this folder to common
2.Add vendors WIP
Code:
mkdir -p /vendor/htc/
Go in /vendor/htc/
Code:
git clone https://github.com/prototype-U/android_vendor_htc_protou.git
Rename this folder to protou
3.Add kernel sources
Code:
mkdir -p kernel/htc/
Go in /kernel/htc/protou
Code:
git clone -b cm10.2 https://github.com/prototype-U/android_kernel_htc_protou.git
Rename this folder to protou
And you are done! You can try compiling now..
I'll try this on Arch Linux in the evening and report back if it worked. Hopefully I'll find the right dependencies for the build as Arch Linux is a bit special with this. Anyway thanks for the guide!
Sent from my HTC Desire X using XDA Premium 4 mobile app
Why?
repo init -u git://github.com/androidarmv6/android.git -b cm-10.2
we got ARMv7
Klapo said:
Why?
repo init -u git://github.com/androidarmv6/android.git -b cm-10.2
we got ARMv7
Click to expand...
Click to collapse
Source, Its on androidarmv6 git its a group or something...not related to this.
Sent from my HTC Desire X using xda premium
Found a typo. It has to be "-b cm-10.2" in last clone command, then it works.
prototype-U said:
Create a script named " compile.sh " inside cm10.2 folder and paste these contents inside it.
Code:
#!/system/bin/sh
PATH=~/bin:$PATH
repo sync -j32
.build/envsetup.sh
export USE_CCACHE=1
make clean
brunch protou
So to start compiling you have to do this command inside your cm10.2 folder
Code:
sh compile.sh
Click to expand...
Click to collapse
A guy from #cyanogenmod-dev told me that is much better to use terminal to start compiling then this script,he told me to do this :
cd cm10.2
export USE_CCACHE=1
source build/envsetup.sh
brunch protou
These are just recommendations.
prototype-U said:
Code:
mkdir -p /device/htc
Go in /device/htc
Click to expand...
Click to collapse
It's actually mkdir -p device/htc. You made a typo,it will create a folder inside the system partition.
Then go into device/htc.
prototype-U said:
Code:
mkdir -p /vendor/htc/
Go in /vendor/htc/
Click to expand...
Click to collapse
Same here,it's mkdir -p vendor/htc .
Then go in vendor/htc.
prototype-U said:
Code:
mkdir -p kernel/htc/
Go in /kernel/htc/protou
Click to expand...
Click to collapse
The folder location is good here but you go :
cd kernel/htc instead of /kernel/htc/protou.
Also i had to install these to make it work. We need java,etc.
Code:
git-core gnupg flex bison gperf libsdl1.2-dev libesd0-dev libwxgtk2.8-dev squashfs-tools build-essential zip curl libncurses5-dev zlib1g-dev openjdk-6-jre openjdk-6-jdk pngcrush schedtool libxml2 libxml2-utils xsltproc
Code:
g++-multilib lib32z1-dev lib32ncurses5-dev lib32readline-gplv2-dev gcc-multilib
Don't take this offensively,i am just trying to help.
nightwalkerkg said:
A guy from #cyanogenmod-dev told me that is much better to use terminal to start compiling then this script,he told me to do this :
cd cm10.2
export USE_CCACHE=1
source build/envsetup.sh
brunch protou
These are just recommendations.
It's actually mkdir -p device/htc. You made a typo,it will create a folder inside the system partition.
Then go into device/htc.
Same here,it's mkdir -p vendor/htc .
Then go in vendor/htc.
The folder location is good here but you go :
cd kernel/htc instead of /kernel/htc/protou.
Also i had to install these to make it work. We need java,etc.
Code:
git-core gnupg flex bison gperf libsdl1.2-dev libesd0-dev libwxgtk2.8-dev squashfs-tools build-essential zip curl libncurses5-dev zlib1g-dev openjdk-6-jre openjdk-6-jdk pngcrush schedtool libxml2 libxml2-utils xsltproc
Code:
g++-multilib lib32z1-dev lib32ncurses5-dev lib32readline-gplv2-dev gcc-multilib
Don't take this offensively,i am just trying to help.
Click to expand...
Click to collapse
None taken. To be honest I have never tried setting up a build machine because my build server already had everything installed. And the steps I have mentioned above are not tested by me. I modify the core manifest to sync everything rather than doing it manually. Btw there is nothing wrong with the script, I made it just to reduce my manual work.
Sent from my HTC Desire X using xda app-developers app
I ran into problems using the script, because I use zsh as my favorite shell. When the shell interpreter used in the script and the shell used for building is not the same, the sourcing won't work and it will give you an error like "brunch: command not found".
dansou901 said:
I ran into problems using the script, because I use zsh as my favorite shell. When the shell interpreter used in the script and the shell used for building is not the same, the sourcing won't work and it will give you an error like "brunch: command not found".
Click to expand...
Click to collapse
You have to make sure that you have synced all device related repos correctly. To make sure; goto the folder where you synced; goto device/htc and you should see protou and common folders.
dansou901 said:
I ran into problems using the script, because I use zsh as my favorite shell. When the shell interpreter used in the script and the shell used for building is not the same, the sourcing won't work and it will give you an error like "brunch: command not found".
Click to expand...
Click to collapse
Do it each time in a new shell. . /build/envsetup.sh
Sent from my HTC Desire X using xda app-developers app
Instead of renaming we could do
git clone git://github.com/<user>/android_device_htc_protou.git protou
do the same for common
Just a suggestion (sames lot of time :silly: )

[ GUIDE ] How to Prepare Ubuntu 14.04 LTS Trusty Tahr to Compile Android ROMs

--- If you would rather use a ready-to-go Virtual Machine, check out my post here. ---
--- Copied with permission from http://nathanpfry.com ---
TLDR; if you don't care about an explanation of what your system is doing,
click here to check out XDA Senior Member Aaahh's sweet two-step method based on my guide below.
Otherwise, keep reading!​
With a new version of Ubuntu comes an update to my world-famous guide for setting up a build environment to compile Android ROMs. 14.04 Trusty Tahr is the next Long Term Support edition of the popular Linux distro. The aim of this guide is to simplify the configuration process for you.
Follow the directions step-by-step. All you have to do is copy and paste the code sections in order and you will be up and running in no time!
This guide applies to all variations of Ubuntu 14.04 LTS Trusty Tahr 64 bit. Do not use the 32 Bit version.
Also, PAY CLOSE ATTENTION when to use "sudo" and when to not. It can make things funky if you do something as root that you shouldn't.
Much thanks goes out to Google, ProTekk, Canonical, and everyone else that I read a random paragraph here and snippet there.
Ready to begin? Ok.
1) Unless it's a completely fresh Ubuntu installation, many of you may have the wrong version of Java installed. Let's fix that first.
The command below makes sure you're starting with a clean slate. Copy and paste it into a terminal (command prompt) window:
Code:
sudo apt-get purge openjdk-\* icedtea-\* icedtea6-\*
If necessary, follow the on-screen instructions to remove any previous versions. Otherwise, move on to the next step.
It's time to install Java, one of the core pieces for compiling Android ROMs. Depending on which version of Android you are building, you will need the corresponding version of the Java Development Kit.
*** IF YOU ARE BUILDING ANDROID GINGERBREAD THRU KITKAT (2.3 - 4.4.x) USE THESE INSTRUCTIONS FOR JDK 6***
2) Copy and paste the following into the terminal:
Code:
sudo add-apt-repository ppa:webupd8team/java
This will add the correct PPA to your system for updated builds of Java 6 JDK that are compatible with 14.04.
3) Now you need to install the package. More copy-paste:
Code:
sudo apt-get update && sudo apt-get install oracle-java6-installer
Follow the on-screen instructions. You must accept the Licensing Agreement to complete the install.
Press Enter to acknowledge the "OK", then tab over to "Yes" and press Enter again to accept the license. The installation will continue automatically.
4) Let's make sure the correct version of Java is activated. Run the terminal command:
Code:
java -version
You should see something like:
java version "1.6.0_45"
Java(TM) SE Runtime Environment (build 1.6.0_45-b06)
Java HotSpot(TM) 64-Bit Server VM (build 20.45-b01, mixed mode)
Continue to Step 5.
*** IF YOU ARE BUILDING ANDROID L AND ABOVE (CURRENT AOSP MASTER BRANCH) USE THESE INSTRUCTIONS FOR JDK 7***
2) Install Open-JDK 7 for the necessary Java development tools.
Code:
sudo apt-get update && sudo apt-get install openjdk-7-jdk
Follow the on-screen instructions.
3) Let's make sure the correct version of Java is activated. Run the terminal command:
Code:
java -version
You should see something like OpenJDK 1.7
Continue on to Step 5.
5) Back to a fresh terminal prompt. Install the main build tools with this command:
Code:
sudo apt-get install git ccache automake lzop bison gperf build-essential zip curl zlib1g-dev zlib1g-dev:i386 g++-multilib python-networkx libxml2-utils bzip2 libbz2-dev libbz2-1.0 libghc-bzlib-dev squashfs-tools pngcrush schedtool dpkg-dev liblz4-tool make optipng
That's it on the package side of things. You guessed it, time for more Terminal. This really is the easiest way, I promise.
6) A program called "repo" lets you communicate with git servers and download all that precious source code. The next command will install it:
Code:
mkdir ~/bin && curl http://commondatastorage.googleapis.com/git-repo-downloads/repo > ~/bin/repo && chmod a+x ~/bin/repo
7) Use your favorite text editor to open ~/.bashrc - I like nano:
Code:
sudo nano ~/.bashrc
8) At the very bottom (use the Page Down key) paste this code to a new (empty) line:
Code:
export PATH=~/bin:$PATH
9) Save it. In nano that would be Ctrl-O and then Enter. Then Ctrl-X to exit back to a prompt. Restart bash:
Code:
source ~/.bashrc
10) In the terminal, navigate to where you would like to download the Android source code. The commands below will make it in your home folder, but if you have limited space you may want to create it somewhere else. Faster is better, i.e. SSD would be best, USB external is basically unusable. Here we go:
Code:
mkdir ~/android
cd ~/android
11) Now you're going to initialize the repo. This is where you decide the flavor of Android you want to build, i.e. AOKP, CyanogenMod, AOSP etc.
For the purposes of the tutorial, here's the command for AOKP KitKat:
Code:
repo init -u git://github.com/AOKP/platform_manifest.git -b kitkat
12) Almost there. Last step, it's a doozy. Time to get the source. Prepare yourself, 10+ GB of downloading await.
Don't worry, it's automated. Go to sleep. Eat something. Perhaps you have heard of this new thing the kids are doing called "going outside"? Yeah, I didn't think so. Me neither.
Hey everyone, it's the final terminal command:
Code:
repo sync
Check back periodically every hour or so. It all depends on how fast your connection is.
That should be everything. Now you're ready to build Android the right way. Good luck!
For those of you that want to build Lollipop (which requires JDK 1.7) but already have your system configured for GB-KK (JDK 1.6), here's the easiest way to update your system:
First, install OpenJDK7. At a terminal:
Code:
sudo apt-get install openjdk-7-jdk
Once that completes, you simply need to tell Linux to use the newer version of Java and Java Compiler to render content. Run the following two commands separately, making the correct selection for OpenJDK 1.7 both times when prompted. Again in the terminal:
Code:
sudo update-alternatives --config java
sudo update-alternatives --config javac
That should do the trick! Have fun everyone..
Feel free to buy me a coconut water (donate) if you like my work. It would be greatly appreciated!
Please hit the "Thanks" button if this post helped you out!​
not for me...
ppa:webupd8team/java no longer supports oracle-java6-installer.....
at least when I tried it on ubuntu 14.04 a week ago......
had to resort to the old fashion way of installing jdk from older oracle instructions...!!!
UPDATED:
----------------
seems at the time we tested(feb.4) it did not work but since then has been fixed...
at the time the OP posted it had been corrected, feb.7
fgdn17 said:
had to resort to the old fashion way of installing jdk from older oracle instructions...!!!
Click to expand...
Click to collapse
Respectfully, you're wrong.
Yesterday I tried the instructions (as I was writing the guide) with the latest Alpha of Xubuntu 14.04 and it works fine.
It appears they've updated the PPA within the last few days to support Trusty Tahr.
I wouldn't publish a guide that I hadn't verified myself as working, unlike some people.
well that implies they have fixed it...because on feb 4 we setup Ubuntu 14.04 and had to work around the issue
because it did not work.....
so did it work well for you a week ago???
maybe because of the different systems???
will give it a try again in the next couple of weeks if we get time...either way it's good to know
it has been corrected....
and BTW we also installed openjava 7, switched between the two and
build our source without issues.....
source was android-x86 kitkat
got a chance to check this am and it was FIXED YESTERDAY it appears.....
https://launchpad.net/~webupd8team/+archive/java
https://launchpad.net/~nilarimogard/+related-packages
and as stated did not work a week ago....feb.-1 thru feb 4
thanks for the updates...
fgdn17 said:
got a chance to check this am and it was FIXED YESTERDAY it appears.....
Click to expand...
Click to collapse
That's great, but your first post is still wrong. You should edit it so other users aren't confused.
oracle-java6-installer works perfectly fine in Ubuntu 14.04 at the time of the original posting.
I used 14.04 early and i had to install some extra packages because things wouldn't work properly, just a heads up incase anyone is having problems...
I've build android 4.2 and 4.4 using openjdk 1.7, without any changes, using ubuntu 13.10 (some time ago in aosp there has been added patches which fixes build under java 7, of course it's not for all android versions).
This guide really complicates things. Most of this could be put into a single one-liner.
I appreciate a detailed, step-by-step guide like this. In my experience here, I've found that far too many arrogant developers hold the opinion that since they had to find things out the hard way, everyone else should have to as well. Finding developers that actually want to help people out, rather than snub them with snot-nosed attitudes, is always refreshing, so thanks to the OP for the guide!
AdamOutler said:
This guide really complicates things. Most of this could be put into a single one-liner.
Click to expand...
Click to collapse
Then why haven't you done it already, instead of raining on my parade?
sylentprofet said:
Then why haven't you done it already, instead of raining on my parade?
Click to expand...
Click to collapse
Do you want me to post a second guide mid-thread? I'm just suggesting combining steps. Its a lengthy read and it could be much shorter.
AdamOutler said:
Do you want me to post a second guide mid-thread? I'm just suggesting combining steps. Its a lengthy read and it could be much shorter.
Click to expand...
Click to collapse
Or start your own thread?
If you wanna post it in here as a reply, go ahead. When I can verify that it works I'd be happy to update the OP and credit you.
Also I've released Builduntu, a ready-to-go virtual machine. The link is at the top of the OP. No matter what system you've got (OSX, Win, other linux) you can import the machine into VirtualBox or VMWare and have a working development environment in minutes.
Now that I've built a completely new, modern machine, I'm going to repurpose my old system (which is still perfectly usable, with 8GB of RAM and an Intel Core2 Quad) as an Android development platform. I plan to install Linux Mint 14 on it, as I despise Unity with the blazing white heat of a million suns. I'll give your steps a try on it and post here how successful they were; if anything needs tweaking for Mint, you can add them to your instructions (it shouldn't, as Mint is based on Ubuntu).
AdamOutler said:
This guide really complicates things. Most of this could be put into a single one-liner.
Click to expand...
Click to collapse
Here is a two liner,
Code:
sudo apt-get purge openjdk-\* icedtea-\* icedtea6-\* && sudo add-apt-repository ppa:webupd8team/java && sudo apt-get update && sudo apt-get install oracle-java6-installer && sudo apt-get install git-core gnupg ccache lzop flex bison gperf build-essential zip curl zlib1g-dev zlib1g-dev:i386 libc6-dev lib32ncurses5 lib32z1 lib32bz2-1.0 lib32ncurses5-dev x11proto-core-dev libx11-dev:i386 libreadline6-dev:i386 lib32z-dev libgl1-mesa-glx:i386 libgl1-mesa-dev g++-multilib mingw32 tofrodos python-markdown libxml2-utils xsltproc readline-common libreadline6-dev libreadline6 lib32readline-gplv2-dev libncurses5-dev lib32readline5 lib32readline6 libreadline-dev libreadline6-dev:i386 libreadline6:i386 bzip2 libbz2-dev libbz2-1.0 libghc-bzlib-dev lib32bz2-dev libsdl1.2-dev libesd0-dev squashfs-tools pngcrush schedtool libwxgtk2.8-dev python && sudo ln -s /usr/lib/i386-linux-gnu/mesa/libGL.so.1 /usr/lib/i386-linux-gnu/libGL.so && mkdir ~/bin && curl http://commondatastorage.googleapis....downloads/repo > ~/bin/repo && chmod a+x ~/bin/repo && sudo nano ~/.bashrc
Copy and paste
export PATH=~/bin:$PATH
Code:
source ~/.bashrc && mkdir ~/android && cd ~/android
I purposly left out the repo init and sync, that way you can pick what source to init.
Aaahh said:
Here is a two liner,
Code:
sudo apt-get purge openjdk-\* icedtea-\* icedtea6-\* && sudo add-apt-repository ppa:webupd8team/java && sudo apt-get update && sudo apt-get install oracle-java6-installer && sudo apt-get install git-core gnupg ccache lzop flex bison gperf build-essential zip curl zlib1g-dev zlib1g-dev:i386 libc6-dev lib32ncurses5 lib32z1 lib32bz2-1.0 lib32ncurses5-dev x11proto-core-dev libx11-dev:i386 libreadline6-dev:i386 lib32z-dev libgl1-mesa-glx:i386 libgl1-mesa-dev g++-multilib mingw32 tofrodos python-markdown libxml2-utils xsltproc readline-common libreadline6-dev libreadline6 lib32readline-gplv2-dev libncurses5-dev lib32readline5 lib32readline6 libreadline-dev libreadline6-dev:i386 libreadline6:i386 bzip2 libbz2-dev libbz2-1.0 libghc-bzlib-dev lib32bz2-dev libsdl1.2-dev libesd0-dev squashfs-tools pngcrush schedtool libwxgtk2.8-dev python && sudo ln -s /usr/lib/i386-linux-gnu/mesa/libGL.so.1 /usr/lib/i386-linux-gnu/libGL.so && mkdir ~/bin && curl http://commondatastorage.googleapis....downloads/repo > ~/bin/repo && chmod a+x ~/bin/repo && sudo nano ~/.bashrc
Copy and paste
export PATH=~/bin:$PATH
Code:
source ~/.bashrc && mkdir ~/android && cd ~/android
I purposly left out the repo init and sync, that way you can pick what source to init.
Click to expand...
Click to collapse
Yep. you beat me to it.. I was mobile earlier so I couldn't really copy-pasta all of it into a post.
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies:
build-essential : Depends: gcc (>= 4:4.4.3) but it is not going to be installed
Depends: g++ (>= 4:4.4.3) but it is not going to be installed
g++-multilib : Depends: cpp (>= 4:4.8.2-1ubuntu4) but it is not going to be installed
Depends: gcc-multilib (>= 4:4.8.2-1ubuntu4) but it is not going to be installed
Depends: g++ (>= 4:4.8.2-1ubuntu4) but it is not going to be installed
Depends: g++-4.8-multilib (>= 4.8.2-5~) but it is not going to be installed
libghc-bzlib-dev : Depends: libghc-base-dev-4.6.0.1-8aa5d
Depends: libghc-bytestring-dev-0.10.0.2-4f932
E: Unable to correct problems, you have held broken packages.
may i request some suggestion? thanks
desalesouche said:
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies:
build-essential : Depends: gcc (>= 4:4.4.3) but it is not going to be installed
Depends: g++ (>= 4:4.4.3) but it is not going to be installed
g++-multilib : Depends: cpp (>= 4:4.8.2-1ubuntu4) but it is not going to be installed
Depends: gcc-multilib (>= 4:4.8.2-1ubuntu4) but it is not going to be installed
Depends: g++ (>= 4:4.8.2-1ubuntu4) but it is not going to be installed
Depends: g++-4.8-multilib (>= 4.8.2-5~) but it is not going to be installed
libghc-bzlib-dev : Depends: libghc-base-dev-4.6.0.1-8aa5d
Depends: libghc-bytestring-dev-0.10.0.2-4f932
E: Unable to correct problems, you have held broken packages.
may i request some suggestion? thanks
Click to expand...
Click to collapse
try sudo apt-get autoremove then sudo apt-get update then sudo apt-get dist-upgrade then sudo dpkg --configure -a then if it still perist try to enable muitverse, if it still doesn't work then try trusty proposed or compiling by hand...
Aaahh said:
try sudo apt-get autoremove then sudo apt-get update then sudo apt-get dist-upgrade then sudo dpkg --configure -a then if it still perist try to enable muitverse, if it still doesn't work then try trusty proposed or compiling by hand...
Click to expand...
Click to collapse
all is fine now... thanks to these commands i could run point 5 and 6 from op
hi <while compiling cm11 on that fresh install of unbutu 14.04 i have that weird error? any idea? thank you.
Can't locate Switch.pm in @Inc (you may need to install the Switch module
@Inc contains: /etc/perl /usr/local/lib/perl/5.18.2 /usr/local/share/perl/5.18.2 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.18 /usr/share/perl/5.18 /usr/local/lib/site_perl .) at external/webkit/Source/WebCore/make-hash-tools.pl line 23.
BEGIN failed--compilation aborted at external/webkit/Source/WebCore/make-hash-tools.pl line 23.
Import includes file: /home/desalesouche/cm11m3/out/target/product/u8860/obj/STATIC_LIBRARIES/libwebcore_intermediates/import_includes
make: *** [/home/desalesouche/cm11m3/out/target/product/u8860/obj/STATIC_LIBRARIES/libwebcore_intermediates/Source/WebCore/html/DocTypeStrings.cpp] Error 2
edit: i think i foound the solution here
http://answers.yahoo.com/question/index?qid=20130510115737AAfIgU5
hi did in terminal :
cpan App::cpanminus
then i choosed solution with sudo.
then i did in new terminal:
cpanm Switch
i restarted cm build and error seem to be gone... will confirm that.

[How To] [L5]Compile CM 10.2 from Source

Hello. Today i want to show you how to compile CM 10.2 using TeamHackLG Device tree.
I using Ubuntu 12.04 x64
First, perpare your ubuntu
Open Terminal And:
Install JDK
HTML:
sudo apt-get install openjdk-6-jdk
Install python and GIt
HTML:
sudo apt-get install python
sudo apt-get install git-core
Install required packages.
HTML:
sudo apt-get install git gnupg flex bison gperf build-essential \
zip curl libc6-dev libncurses5-dev x11proto-core-dev \
libx11-dev libreadline6-dev libgl1-mesa-glx \
libgl1-mesa-dev g++-multilib mingw32 tofrodos \
python-markdown libxml2-utils xsltproc zlib1g-dev
HTML:
sudo ln -s /usr/lib/i386-linux-gnu/mesa/libGL.so.1 /usr/lib/i386-linux-gnu/libGL.so
Then : get source
HTML:
mkdir ~/bin
PATH=~/bin:$PATH
curl https://dl-ssl.google.com/dl/googlesource/git-repo/repo > ~/bin/repo
chmod a+x ~/bin/repo
create workspace
HTML:
mkdir cm102_e610
cd cm102_e610
get CM source
HTML:
repo init -u git://github.com/CyanogenMod/android.git -b cm-10.2
Put your Name and email. then
HTML:
repo sync
When you get CM Source , get files required for our device
HTML:
curl --create-dirs -L -o .repo/local_manifests/local_manifest.xml -O -L https://raw.github.com/TeamHackLG/local_manifest/cm-10.2/local_manifest.xml
and
HTML:
repo sync
again and enter this line in your terminal
HTML:
cd cm102_e610/system/vendor/cm
./get-prebuilts
After sync, load "lunch combo"
HTML:
source build/envsetup.sh
HTML:
lunch
choose cm_e610-userdebug or cm_e610-eng
Then press
HTML:
make -j2
After make do
HTML:
make otapackage
and you get flash zip Cm 10.2 for LG l5.
Happy Build
Using tutorials for compile:
http://forum.xda-developers.com/showthread.php?t=1762641
https://github.com/TeamHackLG/local_manifest
use brunch e610 instead of make.
use oracle java 6 not jdk.
aidasaidas75 said:
use brunch e610 instead of make.
use oracle java 6 not jdk.
Click to expand...
Click to collapse
OpenJDK 7 works on some Ubuntu version, while Oracle Java (any version) won't work.
CMIIW
#F4UZAN : Team Optima
F4uzan said:
OpenJDK 7 works on some Ubuntu version, while Oracle Java (any version) won't work.
CMIIW
#F4UZAN : Team Optima
Click to expand...
Click to collapse
openjdk used for aosp rom

Categories

Resources