[SCRIPT/KITCHEN]How to compile any AOSP derivative for the Amaze 4G

Search This thread
S

sportsstar89

Guest
Ok new method you have to be running Ubuntu. I made an All in one script to do everything for you I'm really tired so for now figure it out your self i couldn't have made it any easier to use. It even downloads my tree and cm9/10/aokp
Instructions
1. Open Terminal
2. Copy and paste this
Code:
cd ~/ && git clone git://github.com/Sportsstar89/scripts.git && cd ~/scripts
3. Then run the script
Code:
./cm_script

### Below this is outdated ###
Code:
Ok I am writing this tutorial to encourage people to learn and to help develop CM9 as more people = more ideas
First you need to be running linux i recommend ubuntu
For 32-bit & 64-bit systems:
1.[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

NOTE: On Ubuntu 11.10, and variants, you need to enable the parter repository to install sun-java6-jdk:

Code:
sudo add-apt-repository "deb http://archive.canonical.com/ lucid partner"
sudo apt-get update
sudo apt-get install sun-java6-jdk

2.
Code:
mkdir -p ~/bin
curl https://dl-ssl.google.com/dl/googlesource/git-repo/repo > ~/bin/repo
chmod a+x ~/bin/repo
export PATH=~/bin:$PATH

3.
Code:
mkdir -p ~/android
cd android

4.
Code:
repo init -u git://github.com/Sportsstar89/android.git -b ics
repo sync -j4

5.
Code:
.  build/envsetup.sh

6.
Code:
brunch ruby -j#
#= How ever man cores you have ex. if you have a quad core it would be "brunch ruby -j4"

7. Wait for the build to complete and it will be in the out/target/product/ruby/


Ok so i think i have everything if you run in to any issues let me know[/CODE]
 
Last edited:
S

sportsstar89

Guest
Default.xml fixed

Sent from my HTC_Amaze_4G using xda premium
 

00hero00

Senior Member
Sep 19, 2009
112
13
Ulm
Does that tutorial also work for devices like the Incredible s that don't have CM9 by now?

Does Compile from source mean that I can compile CM9 for my device even if it isn't a supoprted device by cyanogenmod?
 

johnride

Senior Member
Feb 16, 2012
115
13
Really nice idea to write this tutorial!

OHowever you wrote the same dependencies for both architectures I think ;) The 32 bits one definitely seems to be wrong with all these lib32-*

Sent from my HTC Amaze 4G using XDA
 
S

sportsstar89

Guest
Does that tutorial also work for devices like the Incredible s that don't have CM9 by now?

Does Compile from source mean that I can compile CM9 for my device even if it isn't a supoprted device by cyanogenmod?

You would have to use the incredible's device tree and edit in to the vendor setup.sh in vendor/cm 'add_lunch_combo cm_inc-userdebug' or what ever your device's codename is and then brunch inc

Really nice idea to write this tutorial!

OHowever you wrote the same dependencies for both architectures I think ;) The 32 bits one definitely seems to be wrong with all these lib32-*

Sent from my HTC Amaze 4G using XDA
Yea ubuntu changed their name they still download they just give you a bunch of warnings
 

Nshih422

Senior Member
Jul 24, 2010
289
35
Arizona
Thank you so much for this write up.

After the repo sync -j4 command my computer has been running the sync for about 5 hours.

My question is, for future updates I'd need to run this command again, correct? Next time I run it, it shouldn't take nearly as long, right? Just thought I'd ask.

Sent from my HTC_Amaze_4G using Tapatalk 2
 

ziggy46

Senior Member
Aug 18, 2011
2,237
1,956
27
Chambersburg, Pa
Thank you so much for this write up.

After the repo sync -j4 command my computer has been running the sync for about 5 hours.

My question is, for future updates I'd need to run this command again, correct? Next time I run it, it shouldn't take nearly as long, right? Just thought I'd ask.

Sent from my HTC_Amaze_4G using Tapatalk 2

No it won't take as long because it will only get the new files and get rid of the new ones. (Usually takes about 30 seconds for me on 50mbps internet)

Sent from my HTC_Amaze_4G using Tapatalk 2
 
  • Like
Reactions: Nshih422

Nshih422

Senior Member
Jul 24, 2010
289
35
Arizona
Ok, sorry for the questions but im a noob in linux. Im running ubuntu 12.04 LTS

so the java install gave me this

Code:
Package sun-java6-jdk is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

E: Package 'sun-java6-jdk' has no installation candidate

So I installed java using this tutorial HERE.

Also I got this error:

Code:
Package lib32readline5-dev is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
However the following packages replace it:
  lib32readline-gplv2-dev

E: Package 'lib32readline5-dev' has no installation candidate

So i installed that package instead.

Im guessing one of these problems is leading me to this error when I brunch ruby -j4

Code:
make: *** [out/host/common/obj/JAVA_LIBRARIES/dumpkey_intermediates/javalib.jar] Error 127
make: *** Waiting for unfinished jobs....
In file included from external/srec/tools/grxmlcompile/sub_grph.h:26:0,
                 from external/srec/tools/grxmlcompile/sub_supp.cpp:26:
external/srec/tools/grxmlcompile/vocab.h:72:54: warning: ‘typedef’ was ignored in this declaration [enabled by default]
external/srec/tools/grxmlcompile/sub_supp.cpp: In member function ‘void SubGraph::ClearDuplicateArcs()’:
external/srec/tools/grxmlcompile/sub_supp.cpp:366:12: warning: suggest explicit braces to avoid ambiguous ‘else’ [-Wparentheses]

In the out/target/product/ruby folder I have

Code:
obj  (folder)
root  (folder)
system  (folder)
clean_steps.mk
previous_build_config.mk

Ruby folder is:
Contents: 2,885 items, totalling 24.0 MB


Any help on where to go from here? Thanks in advance.
 
Last edited:
S

sportsstar89

Guest
Ok, sorry for the questions but im a noob in linux. Im running ubuntu 12.04 LTS

so the java install gave me this

Code:
Package sun-java6-jdk is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

E: Package 'sun-java6-jdk' has no installation candidate

So I installed java using this tutorial HERE.

Also I got this error:

Code:
Package lib32readline5-dev is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
However the following packages replace it:
  lib32readline-gplv2-dev

E: Package 'lib32readline5-dev' has no installation candidate

So i installed that package instead.

Im guessing one of these problems is leading me to this error when I brunch ruby -j4

Code:
make: *** [out/host/common/obj/JAVA_LIBRARIES/dumpkey_intermediates/javalib.jar] Error 127
make: *** Waiting for unfinished jobs....
In file included from external/srec/tools/grxmlcompile/sub_grph.h:26:0,
                 from external/srec/tools/grxmlcompile/sub_supp.cpp:26:
external/srec/tools/grxmlcompile/vocab.h:72:54: warning: ‘typedef’ was ignored in this declaration [enabled by default]
external/srec/tools/grxmlcompile/sub_supp.cpp: In member function ‘void SubGraph::ClearDuplicateArcs()’:
external/srec/tools/grxmlcompile/sub_supp.cpp:366:12: warning: suggest explicit braces to avoid ambiguous ‘else’ [-Wparentheses]

In the out/target/product/ruby folder I have

Code:
obj  (folder)
root  (folder)
system  (folder)
clean_steps.mk
previous_build_config.mk

Ruby folder is:
Contents: 2,885 items, totalling 24.0 MB


Any help on where to go from here? Thanks in advance.

Dis you set JAVA_HOME correctly for the jdk

Sent from my HTC_Amaze_4G using xda premium
 

Nshih422

Senior Member
Jul 24, 2010
289
35
Arizona
OK! First compile ever thanks to your guide! THANKS Sportsstar89!

Originally I was running it on my SSD and for some reason it wasnt working well. Download took 5 hours and compile was running for 3 hours before I ran out of space. So I swapped hard drives and finished the whole process in a little under 3 hours. I guess my SSD is either going bad or needs to be set up somehow to work properly with linux.

Compile took 1 hour 11 minutes

I recommend anyone who wants to try this out to at least give yourself 30GB for the Ubuntu Install.

So apparently, There are two zips in the ruby folder after its done compiling. I flashed the "cm-9-20120625-UNOFFICIAL-ruby" one first then flashed the "cm_ruby-ota-eng.a.zip" am I doing it right?
I keep getting SystemUI error and it wont stop. Not trying to report issues just want to know if I'm on the right track.

Thanks again for all your hard work. Cant wait till this is done!

EDIT:

I figured out that the one that had ota in the title is what is used to make the unofficial. For some reason though the ota seems to function a little better.
 
Last edited:
S

sportsstar89

Guest
OK! First compile ever thanks to your guide! THANKS Sportsstar89!

Originally I was running it on my SSD and for some reason it wasnt working well. Download took 5 hours and compile was running for 3 hours before I ran out of space. So I swapped hard drives and finished the whole process in a little under 3 hours. I guess my SSD is either going bad or needs to be set up somehow to work properly with linux.

Compile took 1 hour 11 minutes

I recommend anyone who wants to try this out to at least give yourself 30GB for the Ubuntu Install.

So apparently, There are two zips in the ruby folder after its done compiling. I flashed the "cm-9-20120625-UNOFFICIAL-ruby" one first then flashed the "cm_ruby-ota-eng.a.zip" am I doing it right?
I keep getting SystemUI error and it wont stop. Not trying to report issues just want to know if I'm on the right track.

Thanks again for all your hard work. Cant wait till this is done!

EDIT:

I figured out that the one that had ota in the title is what is used to make the unofficial. For some reason though the ota seems to function a little better.

The cm_ota is the not zipaligned version that you would get from doing
Code:
.  build/envsetup.sh
lunch cm_ruby
make otapackage -j#
but by using the brunch command it zipaligns it for you and produces the cm-date-unofficial.zip
 

derekalan18

Member
Oct 29, 2008
14
1
34
Bruce Twp.
OK! First compile ever thanks to your guide! THANKS Sportsstar89!

Originally I was running it on my SSD and for some reason it wasnt working well. Download took 5 hours and compile was running for 3 hours before I ran out of space. So I swapped hard drives and finished the whole process in a little under 3 hours. I guess my SSD is either going bad or needs to be set up somehow to work properly with linux.

Compile took 1 hour 11 minutes

I recommend anyone who wants to try this out to at least give yourself 30GB for the Ubuntu Install.

So apparently, There are two zips in the ruby folder after its done compiling. I flashed the "cm-9-20120625-UNOFFICIAL-ruby" one first then flashed the "cm_ruby-ota-eng.a.zip" am I doing it right?
I keep getting SystemUI error and it wont stop. Not trying to report issues just want to know if I'm on the right track.

Thanks again for all your hard work. Cant wait till this is done!

EDIT:

I figured out that the one that had ota in the title is what is used to make the unofficial. For some reason though the ota seems to function a little better.

I'm getting the SystemUI error too. I haven't tried the cm_ruby-ota-eng.a.zip yet to see if that helps. Anyone else getting this problem? Does anyone know why it's doing that?

Sent from my HTC_Amaze_4G using XDA
 
S

sportsstar89

Guest
I'm getting the SystemUI error too. I haven't tried the cm_ruby-ota-eng.a.zip yet to see if that helps. Anyone else getting this problem? Does anyone know why it's doing that?

Sent from my HTC_Amaze_4G using XDA

It's a bug from using the stock kernel it'll be fixed soon

Sent from my HTC_Amaze_4G using xda premium
 

Nshih422

Senior Member
Jul 24, 2010
289
35
Arizona
Oh ok. I thought I did something wrong.

Sent from my HTC_Amaze_4G using XDA

I thought I did something wrong too. So I deleted my "bin" and "android" folders and started from scratch and now it wont compile. I keep getting error 1, or error 2. Ill update with an exact error when i get a chance.

EDIT: sorry I forgot to update. I think my problem was not making repo, in bin folder executable. Like the suggestion below, when I repeated the process step by step it compiled again.
 
Last edited:

Roladriz

Senior Member
Apr 5, 2010
112
33
I thought I did something wrong too. So I deleted my "bin" and "android" folders and started from scratch and now it wont compile. I keep getting error 1, or error 2. Ill update with an exact error when i get a chance.

If you deleted bin, you'll have to add repo back in and make it executable. Glad you got it working. I love compiling android.
 
  • Like
Reactions: Nshih422

johnride

Senior Member
Feb 16, 2012
115
13
I am syncing the git right now on my ArchLinux and I have had to modify a little bit the repo and main.py scripts to get them working. The python command on ArchLinux is actually python 3.2 so there are multiple syntax errors popping. To fix it I just installed python2 and changed "python" for "python2" at the begining of those scripts.

Just posting this to help anybody. :D

By the way this git repo is HUGE! 1.9 GB and still downloading... I wonder why I see so much cm7 stuff in the syncing output? We need all cm7 sources to compile cm9 on the Amaze?

Edit: 11.1GB ? WTF? My 74GB home disk is now almost full. Why is it so big?
 
Last edited:
S

sportsstar89

Guest
I am syncing the git right now on my ArchLinux and I have had to modify a little bit the repo and main.py scripts to get them working. The python command on ArchLinux is actually python 3.2 so there are multiple syntax errors popping. To fix it I just installed python2 and changed "python" for "python2" at the begining of those scripts.

Just posting this to help anybody. :D

By the way this git repo is HUGE! 1.9 GB and still downloading... I wonder why I see so much cm7 stuff in the syncing output? We need all cm7 sources to compile cm9 on the Amaze?

Edit: 11.1GB ? WTF? My 74GB home disk is now almost full. Why is it so big?

That's how big source code for android is a full build will take about 50gb to complete
 
S

sportsstar89

Guest
New!!! Now a script! Easy to use and you no longer have to wait for me to build :)
 

Top Liked Posts

  • There are no posts matching your filters.
  • 1
    Thank you so much for this write up.

    After the repo sync -j4 command my computer has been running the sync for about 5 hours.

    My question is, for future updates I'd need to run this command again, correct? Next time I run it, it shouldn't take nearly as long, right? Just thought I'd ask.

    Sent from my HTC_Amaze_4G using Tapatalk 2

    No it won't take as long because it will only get the new files and get rid of the new ones. (Usually takes about 30 seconds for me on 50mbps internet)

    Sent from my HTC_Amaze_4G using Tapatalk 2
    1
    I thought I did something wrong too. So I deleted my "bin" and "android" folders and started from scratch and now it wont compile. I keep getting error 1, or error 2. Ill update with an exact error when i get a chance.

    If you deleted bin, you'll have to add repo back in and make it executable. Glad you got it working. I love compiling android.