Firefox OS

This page details how to build Firefox OS and flash it on your phone

Phone

 * Obviously, you will need a smartphone supported by Firefox OS, see the list here.
 * fastboot must be enabled, you may need to unlock the bootloader for that. This is out of the scope of this document.

Computer

 * 64bit Gentoo with a multilib profile
 * 4GB of RAM
 * 30GB of disk space (sources alone take 14GB)

Packages
Firefox OS requires gcc 4.6, it will not build with any other version.

Quite a few other packages are required, so we might as well create a set.

You also need the 32bit versions of ncurses and zlib

Test adb
Check if adb detects your phone

Udev rule
If your phone is not detected, you may need a new udev rule

Then retry to detect your phone

Backing up your data
This backup can be used later to build Firefox OS because some non-free files are not included in the sources and must be extracted from a backup (or the phone directly)

Find your phone's codename
See this table.

Choose a Firefox OS version
The list of versions available can be seen here. As of this writing, v1.3 is the lastest stable version but you can build any version you want.

Python
The script fetching the sources uses python, unfortunatly it only works with python2, if your default python interpreter is python3, you will need this small hack

GCC
Building requires GCC 4.6, it won't work with GCC 4.7 which is the current version used by Gentoo

Non-free files
To build Firefox OS you need some non-free files only present on the phone (or backups of the phone). If you did a backup, you can use it for the build by setting ANDROIDFS_DIR, otherwise you need to connect your phone via USB while building.

Fetching the sources
The last command will start fetching the sources, this will take a very long time, possibly hours since it basically downloads 14GB of data.

Build
Building takes quite some time and displays a lot of warnings.

Flashing
If all goes well, your phone should reboot on the new version of Firefox OS