firefox-5 Hello again, and welcome back to our next excursion into Firefox OS.

Today I will show you how I built Firefox OS v1.3 for my ZTE Open.

First of all, let me say that probably the best way to build your own Firefox OS is to either use a desktop/laptop you do not use anymore, or virtualize a dedicated build-machine. I chose to virtualize the build machine with VirtualBox (it’s available for Windows and Linux).

Firefox OS can be built either on 64bit Linux, or OSX if you happen to have an Apple.

My Laptop is installed with Windows 8, has 16GB of memory and an i7 4002mq quad core.

The virtual machine I created with VirtualBox has 5GB of memory (4 is minimum) and 2 cores, capped at 90% execution. The Harddisk size I chose is 50GB – you will need at least 30GB and that could potentially be not enough. I won’t go through the details of setting up VirtualBox, there are tutorials out there to help you with that.

Here it’s also important to mention that you will also need the VirtualBox Extension Packs because you need to be able to attach USB devices.

The VM was then installed with Ubuntu 12.04.4 LTS 64bit. I did this by downloading the Desktop Live-CD.

After successfull installation, follow the instructions of how to set up your build environment on Mozilla Developer Network:

I won’t detail this here because I would encourage you to actually read through the instructions there to better understand what is going on.
also, if you want to use a different Linux Distribution (such as Mint or Fedora) everything you need is described there also.

You will also need adb and fastboot, which is described here:

If you haven’t already configured udev rules, this how to do it:

  • Create a file 51-android.rules in /etc/udev/rules.d/ and put this inside:
SUBSYSTEM=="usb", ATTR{idVendor}=="19d2", MODE="0666", GROUP="plugdev"
SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", MODE="0666", GROUP="plugdev"

The first line is for ADB to recognize your zte roamer2 (=open)
The second line is for fastboot

  • Restart udev like so:
sudo service udev restart
  • Now connect your ZTE Open (dont forget to attach it to the VM)
  • Check if you can see it:
adb devices

it should show

roland@B2G-Dev:~$ adb devices
* daemon not running. starting it now on port 5037 *
* daemon started successfully *
List of devices attached
full_inari    device

In your case it should show ZTE open/roamer2 instead of inari.

Now go get the 1.1 update from ZTE, you have to install that first.
Depending on your geo and the revision of your phone you need to download the right update:

If all went well, you should now be on V1.1 – hurray.

  • Now move on in the description on MDN of how to get the code. (git clone etc.)
  • Configure the build. If you want a clean enduser build its like this:
BRANCH=v1.3 VARIANT=user ./configure inari

inari is the code name for the ZTE open.

This is going to take a LONG time, depending on how fast your internet is, it’s going to fetch about 17GB.

Once this is done, go ahead and build. In order to do that, your phone needs to be connected and attached, because the first time it’s going to pull the system folder for the build process.

  • so to really build ->
BRANCH=v1.3 VARIANT=user ./

If you set up the build machine correctly, this should be successful.

Now comes the tricky part. Since the hal is provided by ZTE and also the RIL proxy is a binary blob, if you flash your phone now it will be stuck in a boot loop. You don’t want a boot loop, so we will fix the problem beforehand.

To avoid the boot loop, you will need:

  1. boot.img contained in the v1.1 update zip
  2. abootimg (is a standard Ubuntu package, install as usual with sudo apt-get install abootimg)
  3. mkbootfs
  4. mkbootimg – the last two tools are from the android source code, either you compile them from there or you ask Mr. Google – there ar precompiled ones to download.
  • If you have all 4 of these ready to go, do as follows:
abootimg -x boot.img
mkdir a_dir; cd a_dir
gunzip -c ../initrd.img | cpio -i

This will extract the boot.img file and the included initrd.img so you can edit it.

  • Edit default.prop so it looks like this:
roland@B2G-Dev:~/FXOS/bootimg/a_dir$ cat default.prop
  • Edit init.b2g.rc (you need to comment out everything related to the RIL proxy)
roland@B2G-Dev:~/FXOS/bootimg/a_dir$ cat init.b2g.rc
service fakeperm /system/bin/fakeperm
class main
user root

service b2g /system/bin/
class main
onrestart restart media

#service rilproxy /system/bin/rilproxy
# class main
# socket rilproxy stream 660 root system
# user root
# group radio

on boot
exec /system/bin/rm -r /data/local/tmp
# set RLIMIT_NOFILE to increase soft limit from 1024(default) to 2048.
# Hard limit keeps default value(4096).
setrlimit 7 2048 4096
  • Last but not least, edit init.rc. Go to line 111 where it mounts all the filesystems and change it to look like this:
# mount mtd partitions
    # Mount /system rw first to give the filesystem a chance to save a checkpoint
    mount yaffs2 mtd@system /system
# make bootable b2g environment
    chmod 0755 /system/b2g/b2g
    chmod 0755 /system/b2g/updater
    chmod 0755 /system/b2g/plugin-container
#done, b2g should work now
    mount yaffs2 mtd@system /system ro remount

All done. Bravo.

  • Repack everything like this:
mkbootfs . | gzip > ../newinitramfs.cpio.gz
cd ..
mkbootimg --kernel zImage --ramdisk newinitramfs.cpio.gz --base 0x200000 --cmdline 'androidboot.hardware=roamer2' -o newboot.img
  • Copy the new boot image to the finished build so you can flash it together with it: (adjust the path to your environment)
cp newboot.img ~/B2G/out/target/product/inari/boot.img 

Now when you then flash your phone the boot.img will be flashed also.

This is the last chance you get to backup anything, because in the next step the phone will be wiped clean (the sdcard will be left alone – but your contacts etc. are gone)

  • Go back to the B2G folder and flash your phone (again, your phone has to be connected and attached)

This will reboot your phone into fastboot mode – if you use Virtualbox, you have to reattach the Android “bla bla” now, then the process should go through until you see -”trying to set time”,

  • Then your phone should be booting and you have to reattach it again in Virtualbox.

If all went ok, it should be successful now.

Bravo, you just installed Firefox OS 1.3. If you have any questions or comments, please feel to ask in the comments or at

Roland LindnerHow ToRecentTutorials13,build,firefox,osHello again, and welcome back to our next excursion into Firefox OS. Today I will show you how I built Firefox OS v1.3 for my ZTE Open. First of all, let me say that probably the best way to build your own Firefox OS is to either use a desktop/laptop...

Related Posts

Mozilla Firefox OS Review ZTE Open Review

Mozilla Firefox OS Review ZTE Open Review