The Firefox OS boot screen is so cute #Firefox #firefoxos #zte #zteopen #bootscreen #mobilephone #boot2gecko (at Lisburn)

seen from Malaysia
seen from United States

seen from United States

seen from India
seen from Canada

seen from United States

seen from United States
seen from United States
seen from Hong Kong SAR China
seen from China

seen from Canada
seen from China

seen from United States
seen from Japan
seen from India

seen from United States
seen from Canada
seen from T1

seen from United States
seen from China
The Firefox OS boot screen is so cute #Firefox #firefoxos #zte #zteopen #bootscreen #mobilephone #boot2gecko (at Lisburn)
Hello Firefox OS
One of the most energetic presentations at this years Øredev conference was that about Firefox OS by Christian Heilmann (video here). One of the reasons it was so energetic was the very high pace, caused by Christian oversleeping and arriving to the presentation fifteen minutes late. The other reasons were that Firefox OS is really cool, and that Christian did a great job selling it.
I tried the Firefox OS simulator plugin for Firefox (the browser) when it first came out, but it failed to impress. After Øredev I gave it a second chance, and it still didn't do it for me. To retain my enthusiasm for the platform, I needed a phone. Luckily, they're not impossible to get any more.
Back in the days, the only phone delivered with Firefox OS was the Geeksphone Keon, but Geeksphone had (and still have) a very hard time delivering phones. A friend ordered a Geeksphone Peak in september, and still hasn't received it. Nowadays there are actually a couple of "real" consumer phones on the market, most notably the LG Fireweb, Alcatel One Touch Fire and ZTE Open. The latter both being sold by carriers to consumers, and directly by ZTE through eBay to developers. The developer version is endorsed by Mozilla, and comes both unlocked and rooted. After thinking about it for a couple of days I went ahead and ordered one, at €75 including shipping to Sweden it's not much to argue about anyway. The phone arrived in just three days through regular mail.
The ZTE Open comes in a pretty nice box (thanks Apple for raising the bar on package design), but as expected the phone itself feels very cheap. I've never been a fan of huge phones, so I'm perfectly fine with the 3.5" screen size, but the screen itself, an more importantly the digitizer, leave a lot to be desired. The precision is pretty poor, and around the edges it's pretty much useless. Try placing the cursor at the beginning of the search field, I dare you! Performance is by no means great, but it's running Firefox OS 1.0.1, and I assume this will improve when updates are released.
None of this matters though. Mozilla is not trying to compete with iPhones and high end Androids at the moment, instead it's targeting emerging markets where these phones are completely out of reach for the broad masses. The ZTE Open is reportedly being sold in Spain for €69 with a €30 prepaid card included. I'm not sure Spain is an emerging market per se, but no matter where you live (except perhaps Monaco), not everybody can afford an iPhone. As a comparison, the iPhone 5S is €699-€899 in Span. If €70 is all you can afford to spend on a phone, the ZTE Open is a lot better than the feature phones you've previously been limited to.
So you bricked your ZTE Open?
During my attempts to get a newer version of Firefox OS on my ZTE Open, I accidentally flashed it without a userdata.img. Not good, the phone only got about half way through the boot process after that. At that point, I didn't have a working build setup on my computer, so I didn't really have much to flash the phone with.
The process below works for the UK and US ZTE Open bought on eBay, and should not be attempted on any other phones!
Luckily, there's a way out of this situation, and the only thing you need is a MicroSD card. Here's what you have to do:
Go to the ZTE Open support for UK version or US version and download the SD card upgrade file. Again, this file is only for the UK or US ZTE Open bought on eBay. There might be similar files for other versions and phones, but this is not the right one.
Unzip the file. Inside it you'll find another zip file, and a pdf with some instructions.
Put the inner zip file in the root of your MicroSD card, eject it and insert it into the phone.
Start the phone in recovery mode by holding the power and volume up buttons until the phone vibrates.
Navigate to the "Apply update from external storage" option using the volume buttons and press the power button to select it.
Select the zip file on the MicroSD card the same way. The phone will then be flashed.
Once the flashing is done, select "Reboot system now".
If everything is OK, the phone will boot up like a brand new phone. Sweet!
Still not working? Sometimes a restore like this doesn't help. The restore runs fine (there's a restore log on the MicroSD card), but the phone still doesn't boot. In those cases I have always been able to fix the problem by fist using the Wipe data option in the restore menu, and then installing the image from the MicroSD card again.
Building Firefox OS on OS X
While Firefox OS 1.1 had been released by Mozilla, and 1.2 being stabilized, my ZTE Open was delivered with 1.0.1. No fun. With no newer images available from ZTE, I quickly begun looking into building my own. After all, how hard could it be?
Basically I first followed all the Mac related instructions on MDN (there's a link to the next step at the bottom). The ZTE Open is built using the inari (think Inara in Firefly, but with an i) device profile. Here's my recipe, yours might have to look different (see links for the actual instructions):
Run the Firefox OS Mac bootstrap, this will make sure you have a bunch of command line tools you'll need, or install the missing ones.
Download and install the OS X 10.6 SDK and symlink it into the current Xcode installation. The build process doesn't work with newer versions.
Create a disk image with a case sensitive filesystem to work from, unless your main filesystem is already case sensitive (by default it isn't).
Install the Android SDK, you'll need their tools to communicate with the phone (backing up, flashing etc). Make sure adb is on your path.
Configure ccache to allow a big cache (3 GB or so).
Enable remote debug on the phone.
Make a copy of the system partition from the phone, it is needed during the build process.
From now on, do all work on the case sensitive disk image.
Check out the B2G git repository.
Config the build environment using the config.sh script. Here you can both specify what branch to build, and what device to build for. This means checking out a lot of code, and it might take a while.
By now you should be able to build Firefox OS, but it didn't work for me. I found the reason on a different MDN page. It turns out with Xcode 5 installed, /usr/bin/gcc is actually gcc from Xcode, and that doesn't work for this build. Luckily this can be fixed.
Install gcc-4.6 using homebrew, and make sure you can run gcc-4.6 -v and g++-4.6 -v and get sensible output before you continue.
Edit the build/core/combo/HOST_darwin-x86.mk file as specified on the page above, to make sure it's using gcc-4.6 instead of the system gcc.
Again, by now you should be able to build Firefox OS, and this time it actually worked for me. Yay!
Another thing that caused my build to fail along the way was that I first checked out the code on a case insensitive disk, and then copied it into my case sensitive one once I realized that could be a problem. In hindsight, this was stupid. Really stupid. The cause of all these case-related problems is that the Linux kernel has files with the same name but different case in the same directory. Checking out the code to a case insensitive disk, only one of these files will survive. For example, my build failed because I didn't have any B2G/kernel/include/linux/netfilter/xt_CONNMARK.h, since it had been overwritten by xt_connmark.h. If you get strange errors like this, delete the code and config it from scratch on a case sensitive filesystem.
Tips and tricks
If your build fails and nothing seems to work, try removing the entire out directory and build again. This will ensure a fresh build.
You can specify how many parallel build process you want to use. If your build fails but you can't really tell why, build using ./build.sh -j1. This way, only one process will be used, and the output will be much more linear. The last output should be about the cause of the failure.
When the build actually works, it takes a long time. I suggest getting a cup of coffee or watching some TV. If the build fails, the computer will play a sound (unless you've turned off the bell sound in the Terminal settings).
Now what? Once you have successfully built the OS, it's time to flash the phone. This has brought along a whole slew of new problems for me, but I hope they can be solved shortly. Stay tuned for more frustration fun!
#firefoxos #zteopen