Flashing Firefox OS onto a Flame with Windows

Since being involved in the Mozilla Tablet Contribution Program I’ve seen community members often asked about flashing and building on Windows. This seems to be a something of a FAQ for both the ‘flatfish’ tablet and ‘flame’ reference phone, and I wonder if not also for other devices. The Firefox OS development community concentrate on using Linux and Mac OS X, which is another OS with UNIX roots, being based on BSD. Thus support for Windows has been a low priority; why bother when Linux is freely available on any device and works so well?

It turns out the demand and suitability of using a Windows host is quite different for flashing and for building Firefox OS. It makes every sense for flashing, but not so for building. In this post I’ll explore flashing and introduce shallow_flash.bat for Flame. I’ll leave building Firefox OS on Windows to a later post

Flashing

Flashing a phone is something any community member with a phone might want to do and significant numbers of our wonderful community are not particularly technical and/or many have only a Windows machine at hand. While automatic “Over The Air” (OTA) updates are often available direct to the device, either from the device vendor or Mozilla, these may not meet the user’s requirements. Some vendors do provide flashing updates but often at their own cadence, leaving users a long way behind the latest versions.

There are currently 3 channels of Mozilla supplied Firefox OS updates, with varying levels stability. Release is the most stable and vendors will usually supply and support this. Next is nighlty Aurora, the Beta channel which is fairly stable and just right for early adopters. Finally nightly Master is the latest developer build and likely to be buggy or broken. (Mozilla devs checkin directly to the master branch and don’t use a GitFlow type workflow). We really want people to be testing and improving the latest less stable channels if they are willing to. However, the only way to switch between these channels, say to Aurora from the supplied Release, is to flash your device.

A flashing wrinkle is that some devices, like flatfish, currently use a full flash which updates the entire software stake of Gonk, Gecko and Gaia. Other devices, like the flame, take the approach of flashing a base full-stack image and then partially flashing updates to Gecko and Gaia. At some point another full flash will be required, usually when a new Gonk lands.

Part of the reason for this is that some of the vendor supplied hardware specific components in Gonk cannot be freely redistributed in isolation by Mozilla due to licensing. Ideally, for Firefox OS to be fully open, no such restrictions would apply but the reality is different. For now these proprietary binary blobs get supplied as vendor images that are either combined with Mozilla generated code in a single flash, or provided as a base version for use with subsequent so called shallow flashing of Gecko and Gaia.

Practically however, flashing is almost entirely a matter of running a program to talk to the device and copying files across. This can be done manually but is usually done with a script to combine all the steps and components. In fact, 2 programs from Android are used; ADB and Fastboot. These are similar but have different features and require the device to be in distinct states so they can communicate. Windows versions of these are available, but Windows also often requires device specific USB drivers, though the standard Android ones do often work.

Flashing on Windows is not only desirable but also now achievable. For the TCP flatfish we’ve been providing Windows scripts to do the flash. The base versions for flame also have usable Windows scripts.   However, for devices like Flame, the ‘shallow_flash‘ script provided by the Mozilla Taiwan QA group is written for use on Linux. Now however, after a couple of minor tweaks it also works on Cygwin, a popular Linux emulator for Windows.

Cygwin is fine for anyone with experience of the Linux command line. However those less technical are likely to be uncomfortable with its idiosyncratic installer and quite confused by the Linux-style command line, especially as the file paths are different to Windows.

I wanted to make flashing much easier on Windows, especially after helping someone update their Flame to 2.1. So now a Windows script ‘shallow_flash.bat‘ hides much of the complexity of using Cygwin and running shallowflash.sh. All that is required is to install Cygwin, copy the required Gecko and Gaia archive files and double click on the script to run it.

I plan to update the script to make the Cygwin installation a little easier too.

This entry was posted in development and tagged . Bookmark the permalink.
Skip to top

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *