[HTC Pico (Explorer)] cute_prince:
Ok guyz, here I am posting a detailed tutorial about building FireFox OS for Pico from source :)

IMPORTANT: This guide is based on building FireFox OS on Ubuntu 10.04, so you should use the same. Other versions of Ubuntu may NOT work with this guide.

SYSTEM REQUIREMENTS

An installed 64-bit version of Ubuntu OS ( I am using Ubuntu 10.04 and strongly recommend you the same )

At least 4 GB of RAM

Atleast 20 GB of available hard-disk space

PREREQUISITES

You need to install the following packages:

[COLOR=Blue]$ sudo apt-get install autoconf2.13 bison bzip2 ccache curl flex gawk gcc g++ g++-multilib git ia32-libs lib32ncurses5-dev lib32z1-dev libgl1-mesa-dev libx11-dev make zip[/COLOR]

INITIALISING BUILD ENVIRONMENT

1. Clone B2G repo from my github to your working directory:

[COLOR=Blue]git clone https://github.com/cuteprince/B2G.git[/COLOR]

This will create a directory named B2G inside your working folder.

NOTE

: Cloning the above repo will download the basic scripts and stuffs. So it will finish quickly.

2. Open a terminal window and navigate to your B2G directory. Now run the following command:

[COLOR=Blue]./config.sh pico[/COLOR]

NOTE

: This is where real source downloading/synchronization happens. Depending on your network speed it may vary from 30 mins. to several hours. The total size is around 5.2 GB.

3. Download the file http://www.mediafire.com/?pipgixfncje4pix

Now copy the downloaded hardware.tar.gz to the root of B2G folder and extract it. This will create a folder named 'hardware' inside your B2G folder.

4. I am using inline kernel compilation. So download my kernel source from here: http://www.mediafire.com/download.php?0zaeq1nbqm34plh

Now goto your B2G directory and create directories in the following manner: kernel/htc/pico

Goto kernel/htc/pico and extract kernel source here, so that finally it should look like this:

B2G/kernel/htc/pico/<Kernel Source>

The Kernel source must contain an AndroidKernel.mk file for inline compilation.

Download it from here http://www.mediafire.com/?9siuvtfbl9w3c30 and place it at the root of Kernel source.

COMPILE SOURCE

To start compiling run the following command:

[COLOR=Blue]./build.sh -j3[/COLOR]

COMPILATION ERRORS

1. The very first error you are likely going to face will be this:

[COLOR=Blue]make: *** No rule to make target `out/target/product/pico/obj/KERNEL_OBJ/usr', needed by `out/target/product/pico/obj/SHARED_LIBRARIES/libstagefright_intermediates/ACodec.o'. Stop.[/COLOR]

FIX

: Goto out/target/product/pico/obj/KERNEL_OBJ. Now manually create a folder named 'usr' ( without quotes ). This will fix it.

There are 1 or 2 more errors you will face during compilation ( These errors are caused due to missing headers only. ) which I don't remember well.. Just reply here when you face errors and I'll post the fix :)

CAMERA FIX

The AOSP source lack some vital routines that are required for the camera to work. Just follow these steps to fix it:

1. Open B2G/frameworks/base/libs/camera/CameraParameters.cpp in gedit

2. Add the following code after the function: CameraParameters::setPreviewFpsRange and save it.

[COLOR=Blue]void CameraParameters::setPostviewSize(int width, int height)
{

}[/COLOR]

NOTE

: Yes, this is an empty function but it is required for camera to actually work.

3. Now, open B2G/frameworks/base/include/camera/CameraParameters.h in gedit

4. Add the following code after the function prototype: void setPreviewSize(int width, int height); and save it.

[COLOR=Blue]void setPostviewSize(int width, int height);[/COLOR]

Thats all, camera is fixed :)