Jump to content

[Guide]Build AOSP for liquid


Recommended Posts

Guest koudelka
Posted (edited)

So, I decided to write some documentation on how to compile android from source and install it on your liquid. This thread is meant as a simple introduction and a place for questions and thoughts about getting AOSP on liquid. If you decide to try this, then it is something at your own risk, I cant take responsibility for your device. But if you are somewhat like me and you always felt interested in leaning somethings about android and build something on your own, then I can tell you it can be a great lot of fun :( (Especially when things starts working B))

First of, I should say I am not an expert at this, I started from scratch without knowing anything at all about custom roms or how android buildsystem work, and that was just a few weeks ago. I hope to share some of the things I have learned, but I also hope I will get some feedback and update to correct things I have done wrong or things that could be improved. Let's start. This post will be updated with time. As of now this guide won't get all hardware working (camera,proximitysensor, problem with audio over bluetooth,automatic brightness control, and non functional leds)

[1]

To build android you need Linux or Mac (Windows is not supported). I would recommend using Ubuntu linux 32 bit it probably has the easiest setup and is tested regularly with the buildsystem by Google. I have not used any other Linux distribution or Mac to build Android.

The codebase is big and I would recommend atleast 10gb free disk space It is possible to use Linux in virtualization if you are using windows, but compiling android takes a lot of ram and the recommended amount for virtual machine is 1.5gb.

To get your computer setup go to http://source.android.com/source/download.html and follow the instructions. This site gives easy instruction on how to setup your machine, download and install the "repo" tool and how to use it. If you have any questions about it, you can ask it in this thread.

You probably also want to make adb working on your computer, you can do that by following the guide at http://developer.android.com/guide/developing/device.html 3rd step under "setting up a device for development"

For initialization of repo client you will probably want to use:

repo init -u git://codeaurora.org/platform/manifest.git -b froyo_almond -m Q8650BSDCANLYA5025.xml

repo sync

This is the stabilization branch for Froyo on Qualcom qsd860 (from codeaurora, they also have a guide there that I recommend you looking at (https://www.codeaurora.org/xwiki/bin/QAEP/)

From now on, the files and folders I am talking about will be from inside the folder you did repo init and sync.

[2]

When everything has downloaded you can get the buildfiles (and some proprietary and or precompiled libraries) from here http://www.multiupload.com/IY135XIZ8O

Enter the device folder and create a folder called acer with subfolder named liquid, and there you extract the buildfiles. (I will describe more about the files further down)

[3]

Now you should be ready to compile AOSP, to initialize the buildsystem. open terminal, cd into yourdroid folder and run

. build/envsetup.sh (this will be for your opened terminal, if you close it or enter another one, you wont have the same build system config there)

then run choosecombo and you will be guided to setup buildsystem for your device. Probably you want to use 1.device, 1. release, and device "liquid"

To start compiling run make -jN where N two times the numbers of cores in your computers cpu. (to speedup the build). Android is big, so this will probably take alot of time (hours).

when it is done you will see something like

Install system fs image: out/target/product/liquid/system.img

Installed file list: out/target/product/liquid/installed-files.txt

koudelka@koudelka-laptop:~/liquid-aosp$

[4]

All the files that has been created you can find in out/target/product/liquid/ . my buildfiles does not build kernel for the liquid, but it is made to work together with phh liquide kernel, so you can use boot.img from his FRF91 rom with your build. There will be both folders with all the applications/frameworks and libs you have compiled, and also generated images you can flash using liquid bootloader (fastboot, same way you install malez recovery).

enter bootloader by using adb, adb reboot bootloader

*note* If you are using virtual machine, it is probably best not to flash from inside it, rather use native windows

fastboot -i 0x0502 flash boot boot.img (extract from phh FRF91 rom, or if you are already running it, you dont neet do flash it again)

fastboot -i 0x0502 flash system system.img (the one you crated in /out/target/product/liquid/

fastboot -i 0x0502 flash userdata userdata.img (also from /out/target/product/liquid/)

fastboot -i 0x0502 reboot

now it is just to see if your device is booting :P if not you can use adb to reboot to recovery or bootloader again to flash new images, or revert to another rom. If you cant connect to adb, you can use the button combination (check sticked thread on this forum)

Instead of using the images you can create a update.zip and flash it using malez recovery. If you include the cache folder from phh FRF91 rom you will also get radio working for calling/sms and data.

Short comment on buildfiles in device/acer/liquid/

The two most important files are BoardConfig.mk and liquid.mk, BoardConfig includes as the name suggest board(liquid internal) specific settings, hardware settings and other things. Editing this probably will endup in non booting build unless you know short of what you are doing :D. liquid.mk is for configuration on what languages and applications should be included in your build, it is also the file where proprietary and config files get copied to your build. ex, apn config file. Looking in the files you can probably figure out what they do.

Extra reading

If you are interesting in learning some more about adding things to your build, or adding a module/application I can suggest some interesting articles to read.

http://www.androidenea.com/2010/06/using-l...in-repo-to.html To add external git projects to your repo setup

http://android.git.kernel.org/?p=platform/...ild-system.html Document describing what the android buildsystem is trying to be (Old document, there is not so much recent information on this)

http://www.androidenea.com/2009/04/closer-...ject-build.html Close look at android buildsystem part 1

http://www.androidenea.com/2009/04/closer-...t-build_27.html Part 2

http://source.android.com/porting/build_system.html official porting guide for android, good source for information but is probably aimed more for professionals :D (and some parts are outdated?)

Please give feedback about things to add/remove, and I will update the post :P Hope someone finds this of use, even though it is a bit unstructured:) Ps, If you read this far, I am impressed :(

Edited by koudelka
Guest CedricGatay
Posted

Thanks for the topic, I think I'll try when I got some spare time !

Guest Andy__P
Posted

fastboot -i 0x0502 flash usedata userdata.img (also from /out/target/product/liquid/)

i suppose that should be

fastboot -i 0x0502 flash userdata userdata.img (also from /out/target/product/liquid/)

anyway. thanks for the introduction

Guest nameless'
Posted

Really great post, thanks for taking the time doing it !!!!!

Guest koudelka
Posted
fastboot -i 0x0502 flash usedata userdata.img (also from /out/target/product/liquid/)

i suppose that should be

fastboot -i 0x0502 flash userdata userdata.img (also from /out/target/product/liquid/)

anyway. thanks for the introduction

ah thank you :( yes there are probably lots of typos and errors in here since i wrote it 2am while watching the aviator (damn long movie btw)

Guest Rajit
Posted

ok.. this might be a silly question, but what version of android do you get from this??? 2.1 or 2.2

either ways, its a really nice post.. will try this once i have time...

Guest koudelka
Posted
repo init -u git://codeaurora.org/platform/manifest.git -b froyo_almond -m Q8650BSDCANLYA5025.xml

repo sync

This is the stabilization branch for Froyo on Qualcom qsd860 (from codeaurora, more information here https://www.codeaurora.org/xwiki/bin/QAEP/ )

ok.. this might be a silly question, but what version of android do you get from this??? 2.1 or 2.2

either ways, its a really nice post.. will try this once i have time...

This is for Froyo (2.2), I have not tried building 2.1, but in theory this should work for other releases also (unless I am missing something :()

Guest Rajit
Posted
This is for Froyo (2.2), I have not tried building 2.1, but in theory this should work for other releases also (unless I am missing something :()

well thats great news.. as in my opinion, as far as aosp is concerned, froyo should be the focus..

Guest koudelka
Posted

Seems they have changed some things in the branch I suggested here, I will try and make it build. And post what modifications I had to make

  • 3 months later...
Guest andrey765
Posted
So, I decided to write some documentation on how to compile android from source and install it on your liquid. This thread is meant as a simple introduction and a place for questions and thoughts about getting AOSP on liquid. If you decide to try this, then it is something at your own risk, I cant take responsibility for your device. But if you are somewhat like me and you always felt interested in leaning somethings about android and build something on your own, then I can tell you it can be a great lot of fun :) (Especially when things starts working ;))

First of, I should say I am not an expert at this, I started from scratch without knowing anything at all about custom roms or how android buildsystem work, and that was just a few weeks ago. I hope to share some of the things I have learned, but I also hope I will get some feedback and update to correct things I have done wrong or things that could be improved. Let's start. This post will be updated with time. As of now this guide won't get all hardware working (camera,proximitysensor, problem with audio over bluetooth,automatic brightness control, and non functional leds)

[1]

To build android you need Linux or Mac (Windows is not supported). I would recommend using Ubuntu linux 32 bit it probably has the easiest setup and is tested regularly with the buildsystem by Google. I have not used any other Linux distribution or Mac to build Android.

The codebase is big and I would recommend atleast 10gb free disk space It is possible to use Linux in virtualization if you are using windows, but compiling android takes a lot of ram and the recommended amount for virtual machine is 1.5gb.

To get your computer setup go to http://source.android.com/source/download.html and follow the instructions. This site gives easy instruction on how to setup your machine, download and install the "repo" tool and how to use it. If you have any questions about it, you can ask it in this thread.

You probably also want to make adb working on your computer, you can do that by following the guide at http://developer.android.com/guide/developing/device.html 3rd step under "setting up a device for development"

For initialization of repo client you will probably want to use:

repo init -u git://codeaurora.org/platform/manifest.git -b froyo_almond -m Q8650BSDCANLYA5025.xml

repo sync

This is the stabilization branch for Froyo on Qualcom qsd860 (from codeaurora, they also have a guide there that I recommend you looking at (https://www.codeaurora.org/xwiki/bin/QAEP/)

From now on, the files and folders I am talking about will be from inside the folder you did repo init and sync.

[2]

When everything has downloaded you can get the buildfiles (and some proprietary and or precompiled libraries) from here http://www.multiupload.com/IY135XIZ8O

Enter the device folder and create a folder called acer with subfolder named liquid, and there you extract the buildfiles. (I will describe more about the files further down)

[3]

Now you should be ready to compile AOSP, to initialize the buildsystem. open terminal, cd into yourdroid folder and run

. build/envsetup.sh (this will be for your opened terminal, if you close it or enter another one, you wont have the same build system config there)

then run choosecombo and you will be guided to setup buildsystem for your device. Probably you want to use 1.device, 1. release, and device "liquid"

To start compiling run make -jN where N two times the numbers of cores in your computers cpu. (to speedup the build). Android is big, so this will probably take alot of time (hours).

when it is done you will see something like

Install system fs image: out/target/product/liquid/system.img

Installed file list: out/target/product/liquid/installed-files.txt

koudelka@koudelka-laptop:~/liquid-aosp$

[4]

All the files that has been created you can find in out/target/product/liquid/ . my buildfiles does not build kernel for the liquid, but it is made to work together with phh liquide kernel, so you can use boot.img from his FRF91 rom with your build. There will be both folders with all the applications/frameworks and libs you have compiled, and also generated images you can flash using liquid bootloader (fastboot, same way you install malez recovery).

enter bootloader by using adb, adb reboot bootloader

*note* If you are using virtual machine, it is probably best not to flash from inside it, rather use native windows

fastboot -i 0x0502 flash boot boot.img (extract from phh FRF91 rom, or if you are already running it, you dont neet do flash it again)

fastboot -i 0x0502 flash system system.img (the one you crated in /out/target/product/liquid/

fastboot -i 0x0502 flash userdata userdata.img (also from /out/target/product/liquid/)

fastboot -i 0x0502 reboot

now it is just to see if your device is booting :) if not you can use adb to reboot to recovery or bootloader again to flash new images, or revert to another rom. If you cant connect to adb, you can use the button combination (check sticked thread on this forum)

Instead of using the images you can create a update.zip and flash it using malez recovery. If you include the cache folder from phh FRF91 rom you will also get radio working for calling/sms and data.

Short comment on buildfiles in device/acer/liquid/

The two most important files are BoardConfig.mk and liquid.mk, BoardConfig includes as the name suggest board(liquid internal) specific settings, hardware settings and other things. Editing this probably will endup in non booting build unless you know short of what you are doing ;). liquid.mk is for configuration on what languages and applications should be included in your build, it is also the file where proprietary and config files get copied to your build. ex, apn config file. Looking in the files you can probably figure out what they do.

Extra reading

If you are interesting in learning some more about adding things to your build, or adding a module/application I can suggest some interesting articles to read.

http://www.androidenea.com/2010/06/using-l...in-repo-to.html To add external git projects to your repo setup

http://android.git.kernel.org/?p=platform/...ild-system.html Document describing what the android buildsystem is trying to be (Old document, there is not so much recent information on this)

http://www.androidenea.com/2009/04/closer-...ject-build.html Close look at android buildsystem part 1

http://www.androidenea.com/2009/04/closer-...t-build_27.html Part 2

http://source.android.com/porting/build_system.html official porting guide for android, good source for information but is probably aimed more for professionals :P (and some parts are outdated?)

Please give feedback about things to add/remove, and I will update the post ;) Hope someone finds this of use, even though it is a bit unstructured:) Ps, If you read this far, I am impressed B)

will this guide work for other devices?

i have a HTC Wildfire and i would like to build my own rom from the source code.

thank you very much

  • 4 weeks later...
Guest Andrea1Liquid
Posted (edited)

Koud, you need to update the guide. Compile 2.3+ on 32bit systems is not possible, when you try to compile it says that you can't compile on 32bit. I know it's intended for froyo, but maybe for future updates...

Hoping to avoid the annoyance to other users :)

Edit: found a way to bypass it. Will post it ;) You will also need java 6 jdk. They should update their site...[italian]cretini[/italian]...

Edit2: nothing...compiling errors...the best way is to dp it on a 64bit machine...

What is ball breaking in this story is that on their documentation they let you intend that the buildsystem on 32bit is more tested and functional than 64bit. They say to install JDK 5 without even say how to, because, their apt-get string doesn't work because that package isn't included anymore on recent ubuntu's repos. I had to google and install the debs from 9.04. I tried to compile isprelinking to get that damned prelink map and the compiler asked for 64bit system saying that compiling on 32bit isn't possible on 2.2 and beyond. WTF? Seriously, they never wrote this on their page...they even let intend the contrary! After bypassing that dumb check of the arch they ask for java 1.6, when they said they needed 1.5 for compatibility issues on their webpage, pointing to a link (in which they state to explain you how to correctly set up your machine) that...guess what? Doesn't exist! From the provided link (http://source.android.com/download) I deduced they meant this (http://source.android.com/source/download.html) link, which is old and says exactly the contrary! They can't even write onto their own code one of their documentation links! It's obvious that they stopped updating their pages from donut's release and changed things without informing the user (an example is by updating their documentation) about those changes and simply letting him slam his head in the wall before finding out that he completely wasted his time. Really disappointing...

So, for future users that want to compile gingerbread, setup a 64bit environment and install jdk 6...

Edited by Andrea1Liquid
Guest studjuice
Posted

I encountered all of these problems. Then I got cyanogen's tweet about how you can't compile on 32bit anymore... Which sucks because I use my netbook for ubuntu and android work, and it's not 64bit capable. So now because I joined this scene just a little too late, I can't learn how to do work with source. :/

Guest koudelka
Posted (edited)
Koud, you need to update the guide. Compile 2.3+ on 32bit systems is not possible, when you try to compile it says that you can't compile on 32bit. I know it's intended for froyo, but maybe for future updates...

Hoping to avoid the annoyance to other users :)

Edit: found a way to bypass it. Will post it ;) You will also need java 6 jdk. They should update their site...[italian]cretini[/italian]...

Edit2: nothing...compiling errors...the best way is to dp it on a 64bit machine...

What is ball breaking in this story is that on their documentation they let you intend that the buildsystem on 32bit is more tested and functional than 64bit. They say to install JDK 5 without even say how to, because, their apt-get string doesn't work because that package isn't included anymore on recent ubuntu's repos. I had to google and install the debs from 9.04. I tried to compile isprelinking to get that damned prelink map and the compiler asked for 64bit system saying that compiling on 32bit isn't possible on 2.2 and beyond. WTF? Seriously, they never wrote this on their page...they even let intend the contrary! After bypassing that dumb check of the arch they ask for java 1.6, when they said they needed 1.5 for compatibility issues on their webpage, pointing to a link (in which they state to explain you how to correctly set up your machine) that...guess what? Doesn't exist! From the provided link (http://source.android.com/download) I deduced they meant this (http://source.android.com/source/download.html) link, which is old and says exactly the contrary! They can't even write onto their own code one of their documentation links! It's obvious that they stopped updating their pages from donut's release and changed things without informing the user (an example is by updating their documentation) about those changes and simply letting him slam his head in the wall before finding out that he completely wasted his time. Really disappointing...

So, for future users that want to compile gingerbread, setup a 64bit environment and install jdk 6...

It is known that most building documentation is outdated (sometimes VERY outdated, even when I wrote this guide for 2.2 the documentation was outdated. From now on you need a 64bit system to build android, and there has been some added dependencies I think. I do recommend people to stay current with the android mailing list and look for problems and updates there.

https://groups.google.com/forum/#!activ...X4/ryfzr3AXT34J

another interesting post to look at is, https://groups.google.com/d/msg/android-bui...Dk/sqybzKOyfbIJ

And really, I dont think Google ever considered that people would build the full android system on a netbook (it really is a huge codebase, takes hours on my 2.4ghz dualcore 4gb ddr3ram thinkpad :D )

Edited by koudelka
Guest jayziac
Posted

Maybe someone has the resources to host a Linux 64-bit machine for people to share and build on like in a normal software dept.

Guest merirosvo
Posted

Finally a tutorial that explains how to compile android, the first real tutorial worthy of the name

Congratulations and thank you for this beautiful work!

Guest Andrea1Liquid
Posted (edited)

I setted up a new 64bit VM. Then I installed all the tools, plus openjdk6 (it works with isprelinked). Synced from gingerbread repo, compiled all the tools and found Acer's prelinking for Froyo bins. Edited the sources to use Acer's prelinking. Tried to compile libwebcore with optimizations for snapdragron and got a non prelinked libwebcore.so. Retried with just "make libwebcore" and it gave me a compiling error. I searched on the net and found out that it's related to the code: simply a code not written correctly. What a shame for AOSP...Ok. I said. Let's try to sync again and see if they fixed the error:

fatal: The remote end hung up unexpectedly

error: Cannot fetch platform/bionic

Disappointed...again!

Edit: syncing again!

Edit2: nothing! I can't build that damned library! Doesn't matter what command do I write: it gives the same error...

Edit3: btw, liquid device tree has to be adapted to gingerbread ;)

Edit4: seems that an old version of xian's liquid device tree does the trick...roggin is compiling gingerbread right now: let's see :D I also gave him my map so he can compile a Stock Kernel Version too... Let's hope it works ;)

Edit5: it to worked with AOSP Gingerbread in cyanogen's git :)

Edited by Andrea1Liquid
Guest koudelka
Posted
I setted up a new 64bit VM. Then I installed all the tools, plus openjdk6 (it works with isprelinked). Synced from gingerbread repo, compiled all the tools and found Acer's prelinking for Froyo bins. Edited the sources to use Acer's prelinking. Tried to compile libwebcore with optimizations for snapdragron and got a non prelinked libwebcore.so. Retried with just "make libwebcore" and it gave me a compiling error. I searched on the net and found out that it's related to the code: simply a code not written correctly. What a shame for AOSP...Ok. I said. Let's try to sync again and see if they fixed the error:

fatal: The remote end hung up unexpectedly

error: Cannot fetch platform/bionic

Disappointed...again!

Edit: syncing again!

Edit2: nothing! I can't build that damned library! Doesn't matter what command do I write: it gives the same error...

Edit3: btw, liquid device tree has to be adapted to gingerbread ;)

Edit4: seems that an old version of xian's liquid device tree does the trick...roggin is compiling gingerbread right now: let's see ;) I also gave him my map so he can compile a Stock Kernel Version too... Let's hope it works ;)

Edit5: it to worked with AOSP Gingerbread in cyanogen's git :(

Your build problems was probably due to the fact that gingerbread is still not spread over all mirrors, and doing reposync might give you incomplete tree with broken stuff ;) it takes some time for all the servers around the world to get synced ;)

Guest Andrea1Liquid
Posted
Your build problems was probably due to the fact that gingerbread is still not spread over all mirrors, and doing reposync might give you incomplete tree with broken stuff :( it takes some time for all the servers around the world to get synced ;)

Yes. I think it too. I explained in the other thread how I got gingerbread AOSP (not from cyano) to compile. Compiles flawlessly, but I have some problems in testing. Could you send me your gtalk address so we can talk about it? ;)

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.