Jump to content


[Guide]Build AOSP for liquid

* * * * * 1 votes

29 replies to this topic

#1
koudelka

koudelka

    Addict

  • Members
  • PipPipPipPipPip
  • 508 posts
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.androi...e/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.and...ing/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.codeauro...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.androiden...in-repo-to.html To add external git projects to your repo setup

http://android.git.k...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.androiden...ject-build.html Close look at android buildsystem part 1
http://www.androiden...t-build_27.html Part 2


http://source.androi...ild_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, 30 July 2010 - 03:26 PM.


#2
koudelka

koudelka

    Addict

  • Members
  • PipPipPipPipPip
  • 508 posts
*saved for later use*


#3
CedricGatay

CedricGatay

    Enthusiast

  • Members
  • PipPipPip
  • 240 posts
  • Location:Tours, France
  • Interests:Software development
  • Devices:Acer Liquid Metal
  • Twitter:@Cedric_Gatay
Thanks for the topic, I think I'll try when I got some spare time !

Take the time to try out my apps !
Come visit my Blog

#4
uzirox

uzirox

    Regular

  • Members
  • PipPip
  • 60 posts
Epic post, please sticky!


#5
Andy__P

Andy__P

    Enthusiast

  • Members
  • PipPipPip
  • 263 posts
  • Gender:Male
  • Devices:Galaxy Nexus, Acer Liquid
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


#6
nameless'

nameless'

    Regular

  • Members
  • PipPip
  • 102 posts
  • Location:Barcelona
  • Devices:Acer Liquid
Really great post, thanks for taking the time doing it !!!!!


#7
koudelka

koudelka

    Addict

  • Members
  • PipPipPipPipPip
  • 508 posts

View PostAndy__P, on Jul 28 2010, 07:16, said:

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)


#8
malez

malez

    Hardcore

  • Members
  • PipPipPipPipPipPip
  • 1,420 posts
  • Gender:Male
  • Devices:Acer Liquid - Galaxy S2
  • Twitter:@malez2000
Thank you very much

If you enjoy what i do, i would really apprecite that you place a little gift
Posted ImagePosted Image Follow me on twitter http://twitter.com/malez2000Posted Image

LCR-F(royo)
malez recovery 0.6.1

#9
Rajit

Rajit

    Addict

  • Members
  • PipPipPipPipPip
  • 623 posts
  • Gender:Male
  • Location:New Delhi, India
  • Devices:HTC One X, Acer Liquid
  • Twitter:@rajitsingh
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...

[SIZE="4"]

HTC One X - Stock 1.26.720.2 | Acer Liquid - CyanogenMod 7.1


#10
koudelka

koudelka

    Addict

  • Members
  • PipPipPipPipPip
  • 508 posts

View Postkoudelka, on Jul 28 2010, 00:02, said:

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.codeauro...xwiki/bin/QAEP/ )


View PostRajit, on Jul 28 2010, 09:47, said:

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 :()


#11
Rajit

Rajit

    Addict

  • Members
  • PipPipPipPipPip
  • 623 posts
  • Gender:Male
  • Location:New Delhi, India
  • Devices:HTC One X, Acer Liquid
  • Twitter:@rajitsingh

View Postkoudelka, on Jul 28 2010, 15:37, said:

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..

[SIZE="4"]

HTC One X - Stock 1.26.720.2 | Acer Liquid - CyanogenMod 7.1


#12
koudelka

koudelka

    Addict

  • Members
  • PipPipPipPipPip
  • 508 posts
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


#13
koudelka

koudelka

    Addict

  • Members
  • PipPipPipPipPip
  • 508 posts
Fix was simple, just comment out WIFI_DRIVER_MODULE_ARG := "", in BoardConfig.mk. Or you can download updated zip with makefiles from here http://www.multiupload.com/IY135XIZ8O


#14
andrey765

andrey765

    Newbie

  • Members
  • Pip
  • 1 posts
  • Devices:HTC Wildfire

View Postkoudelka, on Jul 28 2010, 02:02, said:

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.androi...e/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.and...ing/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.codeauro...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.androiden...in-repo-to.html To add external git projects to your repo setup

http://android.git.k...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.androiden...ject-build.html Close look at android buildsystem part 1
http://www.androiden...t-build_27.html Part 2
http://source.androi...ild_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


#15
Dario93

Dario93

    Hardcore

  • Moderator Team
  • PipPipPipPipPipPip
  • 1,180 posts
  • Location:Albenga, Italy
  • Interests:Music,Android,Developing,Photography
  • Devices:Acer Liquid E,Galaxy S,B7610
  • Twitter:@Dario993
Thanks koudelka! B)

Device: Acer Liquid E - ROM: FroYoMetal from CDTeam

Currently working with Community Dev Team on:
- FroYoMetal ROM 4.0 BETA
- Sense ROMs

And Dario93's Rom on my own
If you have requests,send me a PM!


If you like my work, Offer me a Beer!

Posted Image


#16
kenelm

kenelm

    Enthusiast

  • Members
  • PipPipPip
  • 211 posts
Thank you, koudelka!
I'll try it this weekend!


#17
Ramdanih

Ramdanih

    Diehard

  • Members
  • PipPipPipPip
  • 348 posts
  • Gender:Male
  • Location:Jakarta
  • Devices:Acer Liquid E | LG Optimus 2x
  • Twitter:@Ramdanih7
Bookmark!!!!  thx koud...


#18
Andrea1Liquid

Andrea1Liquid

    Diehard

  • Members
  • PipPipPipPip
  • 318 posts
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.androi...e/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, 20 December 2010 - 04:03 PM.

Device: Acer Liquid - ROM: AuraxTSense 8.0 Liquid Port 0.2

Currently working with Community Dev Team on:

-Gingerbread for Liquid from AOSP
-AuraxTSense 8.0 Liquid Port 0.2 + Fix4 (will have proximity sensor working)
-FroyoMetal

If you have requests, let me know!


Posted Image


#19
studjuice

studjuice

    Regular

  • Members
  • PipPip
  • 85 posts
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. :/


#20
koudelka

koudelka

    Addict

  • Members
  • PipPipPipPipPip
  • 508 posts

View PostAndrea1Liquid, on Dec 20 2010, 14:58, said:

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.androi...e/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.googl...X4/ryfzr3AXT34J

another interesting post to look at is, https://groups.googl...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, 21 December 2010 - 12:36 AM.





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users