✏ B2G beta (formerly Firefox OS)

###The development of B2G is discontinued

But an old working image still exists. Find out how to install it here:

If anything ever changes and B2G development starts again feel free to edit this wiki.

here lie the remains of a dead post

:warning: The current version of B2G is still a Beta Version and it only works partially on the Fairphone 2, so please only continue when you are completely aware of what you are doing :warning:
:warning: It is recommended to perform a backup of your current system e.g. using twrp :warning:

Before You start

Make shure you have performed a backup of all your partitions, if you don’t know how, here is a manual:

  1. If you are using a Linux Distribution, you should allow adb and fastboot to access your device:
    Add a file /etc/udev/rules.d/51-android.rules with the following content (if not already done):

SUBSYSTEM==“usb”, ATTR{idVendor}==“18d1”, ATTR{idProduct}==“d00d”, MODE=“0600”, OWNER=“user”

and replace user with your username. Then run sudo service udev reload
2. Turn off your device, connect it to your computer and hold down the Volume Down Button while pressing the Power button. If you can see the Fairphone logo you have accessed the fastboot mode.
3. Download the manual installation version of Fairphone Open Source OS and extract the .zip Archive.
4. Open a shell in the directory you placed your files in and run fastboot flash recovery recovery.img
:warning: This will flash the TWRP Recovery to your flash partition. Without a working recovery you may not be able to restore the functionality of your device after something went wrong :warning:
5. Reboot your device by typing in fastboot reboot and shut it down again. Then start the TWRP recovery by holding down the Volume Up button while pressing the Power button.
6. If you have a MicroSD-card inserted you can perform a backup to the card, if not perform a backup to the internal memory, reboot and copy the TWRP directory of your internal memory to your computer.

If something went wrong during the installation process you can flash back the TWRP recovery in case it got overwritten, then you can write back the TWRP directory to your internal memory e.g. using by connecting to your phone while the recovery is loaded in case you didn’t backup to a MicroSD-card and finally restore your backup.

First of all there are 2 ways of how to get B2G working on the Fairphone 2. For both ways you either need Linux (64-Bit) or Mac OS X installed on your machine.

B2G-installer (recommended)

More information can be found here link:
Make sure you have the factory or the Fairphone Open Source version of the Fairphone OS installed on your device.

  1. Download a current version of Firefox Nightly (a beta version of Firefox): link
  2. Create a new profile for Firefox Nightly by running ./firefox -P in the directory Nightly was placed and inactivate add-on signature:
    Type in about:config and disable xpinstall.signatures.required
  3. Install ADB Helper link and b2g-installer link
  4. Connect your device and open about:b2g-installer and follow the steps shown. (Currently the b2g-installer does not find the nightly build of Juan. A download link can be found here: link)
  5. Congratulations: Your device should now be flashed with a nightly build of B2G/Firefox OS.

Compile it on your own (currently not working with Ubuntu 16.04)

Make sure you have at least 4GB of RAM and 40GB of free disk space. Additional information can be found here, here and here.

  1. Install adb and fastboot
  2. For Ubuntu 14.04 install the following packages:

sudo apt-get install --no-install-recommends autoconf2.13 bison bzip2 ccache curl flex gawk gcc g++ g+±multilib git lib32ncurses5-dev lib32z1-dev libgconf2-dev zlib1g:amd64 zlib1g-dev:amd64 zlib1g:i386 zlib1g-dev:i386 libgl1-mesa-dev libx11-dev make zip lzop libxml2-utils openjdk-7-jdk nodejs unzip python

For Ubuntu 16.04 you have to switch back to version 3.81 of make, newer versions cause build errors. This can be done by adding the main repository of trusty to your sources.list, installing version 3.81 of make and running sudo apt-mark hold make.
Afterwards you have to install the following packages:

sudo apt-get install --no-install-recommends autoconf2.13 bison bzip2 ccache curl flex gawk gcc g++ g+±multilib git lib32ncurses5-dev lib32z1-dev libgconf2-dev zlib1g:amd64 zlib1g-dev:amd64 zlib1g:i386 zlib1g-dev:i386 libgl1-mesa-dev libx11-dev zip lzop libxml2-utils openjdk-8-jdk nodejs unzip python

For Mac OS X you need do the following:
TODO (ask @novski :stuck_out_tongue_winking_eye:)
3. Create a new folder and clone the git repository of B2G

git clone git://github.com/mozilla-b2g/B2G.git && cd B2G

configure and download the source code (this will take a lot of time but you only need to do it once):

./config.sh fairphone2

To improve the building speed you could activate ccache by running:

ccache -M 50G

Then start to build your system:

./build.sh

This will take 3-5 hours depending on your machine.

4.If no errors occurred, you can flash it to your device:

./flash.sh

Additional Information

As you may have noticed Mozilla announced that they will not continue to support B2G OS for smartphones, but the community of B2G OS is still active an continues the support of the OS.
Currently there aren’t many Apps available for B2G OS. If you miss an App think of creating one on your own and publishing it in the marketplace. Different to other mobile systems like Android B2G Apps are some kind of (local) website, written in html, css and JavaScript. So it is easier for Web developers to create an App.
More information about this can be found here.

Latest News:

PS: This is a wiki now. Please contribute and keep it up-to-date.

9 Likes

I have just compiled Firefox OS for Fairphone 2. Here there is the build https://mega.nz/#F!2UsjWBZY.
In order to flash the device, it is sufficient to follow this guide https://developer.mozilla.org/en-US/docs/Mozilla/Firefox_OS/Installing_on_a_mobile_device or this guide https://wiki.mozilla.org/Firefox_OS/TCP/Flashing_your_device/
Please note: this is not as an installation of an applications, since this changes the OS of your device. So if you make a mistake you could brick your device. You must follow the previous guides exactly. For any question, you can ask here or in the Firefox OS forum.

3 Likes

Could you write a howto for dummies (like me)?

I managed to install homebrew by entering

ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

Into the terminal.

Then I entered:

$brew install android-platform-tools

and it returned:

usage: install [-bCcpSsv] [-B suffix] [-f flags] [-g group] [-m mode]
               [-o owner] file1 file2
       install [-bCcpSsv] [-B suffix] [-f flags] [-g group] [-m mode]
               [-o owner] file1 ... fileN directory
       install -d [-v] [-g group] [-m mode] [-o owner] directory ...

whatever that means.

Now the guide says connect to your phone. (Just by plugging it in via usb or do I have to enter a command into the terminal? Or should I now have ADB installed as a program on my mac and use that?)

When I enter

./flash.sh

I get

-bash: $./flash.sh: No such file or directory

PS: I just saw this:

Note: The first time you flash your phone, it must have Android 4 (Ice Cream Sandwich) installed. The process will not work correctly otherwise. Once you’ve done your first install of B2G, however, you can simply update on top of it.

Does that mean we have to somehow downgrade Android first or should that say Android 4 or higher?

I think brew wants you to specify a directory, where to install android-platform-tools. If a program doesn’t recognize what you want from it, it will print its usage pattern, to tell you what it expects from you.

2 Likes

Homebrew is a tool from the Mac World. It typically knows exactly where to install programs, @Stefan s guess is wrong here.

Homebrew is an easy way to install the latest android platform tools, e.g. adb and fastboot. If you use a recent Linux desktop, like Ubuntu, you can also install those programs using the apt package manager. Or you install the full android Sdk (a bit overkill).

1 Like

Remove the dollar from the command.

Explanation :
$brew is now a variable, that is probably not defined in your shell., e.g. empty. So you where actually calling the program ‘install’, therefore the explanation from @Stefan is correct about the usage. What you want is calling the program ‘brew’ with the parameters ‘install android…’.

1 Like

I managed to install ADB another way by now, but now I’m stuck with the very next step.
I give up. I don’t think it makes a lot of sense to flash a beta OS on a 500€ phone if you have never used the terminal before and need help with every single step… :wink:

If someone else however successfully flashes it (with a mac) and is willing to write down how they did it - step by step - I’ll reconsider.

Hi Paul,
I have just uploaded an updated version of the package that should contains all the necessary in order to flash the phone. I just copied the folder structure of the github of Firefox OS with the necessary scripts and files. Unfortunately, I cannot test it since I do not have a Fairphone 2 and I’m using Ubuntu GNU/linux. Can you try it on MAC OS X?

Reference
https://developer.mozilla.org/en-US/docs/Mozilla/Firefox_OS/Installing_on_a_mobile_device

1) Decompress the compressed file Fairphone2 Firefox OS xxx.7z into desktop folder (or whatever folder you want)
1) Open the terminal and enter into the build folder decompressed at previous step
2) Install ADB
2a) On OSX. If you have homebrew on OSX: brew install android-platform-tools
            Otherwise, download the Android Developer Tools and add the binaries to your PATH.
2b) On Ubuntu: sudo apt-get install android-tools-adb
3) Flash your phone: ./flash.sh

Moreover, some developers of Firefox OS are working on a Firefox plug in that should be able to install B2G on a supported device https://bugzilla.mozilla.org/show_bug.cgi?id=1166276. However, this plug in still requires to build the entire system, but it will be simpler than now tailored for end users.

This is the new shared folder where I can add future build without breaking any link https://mega.nz/#F!2UsjWBZY.
For license issue: send me a private message in order to get the decryption key.

1 Like

Hi erotavlas and thanks for the info, I have a question about your build. Does it use the proprietary blobs as provided by Fairphone on http://code.fairphone.com ? If it does, are you aware of the licensing issues that forbid sharing custom ROMs built with these blobs ?

1 Like

4 posts were merged into an existing topic: FP2: License for binary blobs

“I embraced OS X as soon as it was available and have never looked back. So a lot of In the Beginning … was the Command Line is now obsolete. I keep meaning to update it, but if I’m honest with myself, I have to say this is unlikely.” Neal Stephenson

I think in the lastest version of OS X (due to their new security system?) there is an issue with fastboot. Adb still works.

1 Like

Post #11 over there says that the bug is fixed. :slight_smile:

1 Like

I just had a chance to play around with a mac (El captain installed, not mine) & brew. Lastest brew package out of the box lets me connect to a phone with adb (shell, devices), but fastboot is hanging with similar operations. That’s all I can say for now. Not a Mac expert.

Some sites hint modifications, but I cannot try them right now. Also brew feels much cleaner. So maybe it’s best to wait a while until someone fixes this in brew? A bug report would help I guess … if other people have issues as well using fastboot.

All I used for adb/fastboot

brew install android-platform-tools

Update: The phone I was testing with was not taking adb reboot bootloader well. I used another phone and fastboot on the mac was answering (at least while using ‘devices or reboot’). So it looks like fastboot on the mac with brew/el captain seems to work.

2 Likes

We (Mozilla) have a workaround for that that we call “blob free builds”. The way it works is that the build doesn’t include any of the non-redistributable bits, but we provide a Firefox Addon (almost ready for public use, follow progress at https://bugzilla.mozilla.org/show_bug.cgi?id=1166276) that extracts the needed blobs from a device connected to the host, and rebuilds locally the images before flashing.
This process has been vetted by our legal team.

15 Likes

Which is exactly why I suggested to use this addon for distributing fp-osos builds as well. :sunny:

1 Like

Running ./flash.sh:

.config: No such file or directory
Could not load .config. Did you run config.sh?

So load-config.sh is not working properly.

I got it running by flashing the img’s manually, however Firefox OS always crashes on me after one minute.
I flashed boot, cache, recovery, system, userdata and splash, maybe that’s not enough?

1 Like

Hi,
I just updated the package with a new build. Yes, I forgot the file .config in the previous package since it is an hidden file. Now it should flash correctly.

I do not know why it crashes after a minute. Maybe the cause could be the manual flash even if I do not think so. The only important files are three: boot.img, system.img, recovery.img https://developer.mozilla.org/en-US/Firefox_OS/Building_and_installing_Firefox_OS/Firefox_OS_build_process_summary

Please, try now :slight_smile:

3 Likes

Hi
Is there a firefox OS build to get someware or even a tutorial how to install?
I read about the licence issue and that someone has a build but i have to PM. Just who?
And are there any known issues with it?
Regards, Novski

I don’t want to ruin the mood here, but I read somewhere today that “FirefoxOS” (will be moved) "into Tier 3 support " … it that a good or a bad thing? I assume it more or less means that they want to focus more on something else and are just using nice terms to hide it like “attempt to keep the platform working”, but I can be wrong. So please correct me :slightly_smiling:

1 Like

The flash script didn’t work for me (FP2 not recognized as a supported device), so I flashed the images manually again. No crashes this time, will do some more testing later!

4 Likes