Installing Firefox OS on a mobile device

  • Revision slug: Mozilla/Boot_to_Gecko/Installing_Boot_to_Gecko_on_a_mobile_device
  • Revision title: Installing Boot to Gecko on a mobile device
  • Revision id: 234210
  • Created:
  • Creator: Gerv
  • Is current revision? No
  • Comment 160 words added

Revision Content

{{ B2GMain() }}

Once you've built Boot to Gecko for a mobile device, you can install it. This article will guide you through the process.

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.

Flashing your phone

To flash everything to your phone, simply connect your phone and type:

./flash.sh

That's it. The B2G you've currently got built will flash onto your device.

If you get a very helpful libusb error "-3" on Linux, it means you need to be root to have appropriate access to the USB device. Run the script again using sudo.

Galaxy S2

If your phone is a Galaxy S2 and you are using heimdall 1.3.2 (the latest version; use "heimdall version" to check), you may see an alarming error "FACTORYFS upload failed!" followed by "Heimdall flashing failed" and some advice. This is actually success (!); ignore the advice. Grabbing a source copy of heimdall, downgrading to the 1.3.1 release ("git checkout fbbed42c1e5719cc7a4dceeba098981f19f37c06"), compiling according to the README and installing will make the error go away, but it's not necessary.

All versions of heimdall are unable to flash a system.img larger than 100MB. Do:

ls -l ./out/target/product/galaxys2/system.img

to see how big yours is. If it's too large, ask in IRC for advice - there are ways to do it in two stages.

Avoiding automatic updates

If you're doing frequent installs of up-to-date code, you may want to avoid having your phone automatically update Gaia and the "built-in" apps. To do this, add this extra step to your install process:

cd gaia
GAIA_DOMAIN=foo.org make install-gaia

This configures Gaia to use an invalid domain for looking for updates to install. Since the default gaiamobile.org site is generally out-of-date, you don't want to pull updates from there while testing current code.

Added step for the Samsung Galaxy S2

If you're flashing onto the Galaxy S2, there is an additional step to follow. Gaia does not get flashed automatically by the flash.sh script; you'll need to also do:

./flash.sh gaia

Flashing specific partitions to fastboot phones

You can flash specific partitions to fastboot phones (that is, any phone other than the Samsung Galaxy S2). For example:

./flash.sh system
./flash.sh boot
./flash.sh user

Updating specific modules

You can update specific components of B2G by specifying their names when flashing. For example:

./flash.sh gaia
./flash.sh gecko

Next steps

At this point, your phone should be running Boot to Gecko! It's time to experiment, write some code, test, or do some debugging!

Note: A helpful usage tip: if your build of B2G starts up with the lock screen requesting a pass code to unlock the phone, the default code is 0000.

Revision Source

<p>{{ B2GMain() }}</p>
<p>Once you've built Boot to Gecko for a mobile device, you can install it. This article will guide you through the process.</p>
<div class="note"><strong>Note:</strong> The first time you flash your phone, it <strong>must</strong> 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.</div>
<h2>Flashing your phone</h2>
<p>To flash everything to your phone, simply connect your phone and type:</p>
<pre>./flash.sh
</pre>
<p>That's it. The B2G you've currently got built will flash onto your device.</p>
<p>If you get a very helpful libusb error "-3" on Linux, it means you need to be root to have appropriate access to the USB device. Run the script again using sudo.</p>
<h4>Galaxy S2</h4>
<p>If your phone is a Galaxy S2 and you are using heimdall 1.3.2 (the latest version; use "heimdall version" to check), you may see an alarming error "FACTORYFS upload failed!" followed by "Heimdall flashing failed" and some advice. This is actually success (!); ignore the advice. Grabbing a <a class=" link-https" href="https://github.com/Benjamin-Dobell/Heimdall" title="https://github.com/Benjamin-Dobell/Heimdall">source copy</a> of heimdall, downgrading to the 1.3.1 release ("git checkout fbbed42c1e5719cc7a4dceeba098981f19f37c06"), compiling according to the README and installing will make the error go away, but it's not necessary.</p>
<p>All versions of heimdall are unable to flash a system.img larger than 100MB. Do:</p>
<pre>ls -l ./out/target/product/galaxys2/system.img
</pre>
<p>to see how big yours is. If it's too large, ask in IRC for advice - there are ways to do it in two stages.</p>
<h3>Avoiding automatic updates</h3>
<p>If you're doing frequent installs of up-to-date code, you may want to avoid having your phone automatically update Gaia and the "built-in" apps. To do this, add this extra step to your install process:</p>
<pre>cd gaia
GAIA_DOMAIN=foo.org make install-gaia
</pre>
<p>This configures Gaia to use an invalid domain for looking for updates to install. Since the default gaiamobile.org site is generally out-of-date, you don't want to pull updates from there while testing current code.</p>
<h3>Added step for the Samsung Galaxy S2</h3>
<p>If you're flashing onto the Galaxy S2, there is an additional step to follow. Gaia does not get flashed automatically by the <code>flash.sh</code> script; you'll need to also do:</p>
<pre>./flash.sh gaia
</pre>
<h2>Flashing specific partitions to fastboot phones</h2>
<p>You can flash specific partitions to fastboot phones (that is, any phone other than the Samsung Galaxy S2). For example:</p>
<pre>./flash.sh system
./flash.sh boot
./flash.sh user
</pre>
<h2>Updating specific modules</h2>
<p>You can update specific components of B2G by specifying their names when flashing. For example:</p>
<pre>./flash.sh gaia
./flash.sh gecko
</pre>
<h2>Next steps</h2>
<p>At this point, your phone should be running Boot to Gecko! It's time to experiment, <a href="/en/Mozilla/Boot_to_Gecko/Writing_apps_for_Boot_to_Gecko" title="en/Mozilla/Boot_to_Gecko/Writing_apps_for_Boot_to_Gecko">write some code</a>, <a href="/en/Mozilla/Boot_to_Gecko/Testing_Boot_to_Gecko" title="en/Mozilla/Boot_to_Gecko/Testing_Boot_to_Gecko">test</a>, or <a href="/en/Mozilla/Boot_to_Gecko/Debugging_on_Boot_to_Gecko" title="en/Mozilla/Boot_to_Gecko/Debugging_on_Boot_to_Gecko">do some debugging</a>!</p>
<div class="note"><strong>Note:</strong> A helpful usage tip: if your build of B2G starts up with the lock screen requesting a pass code to unlock the phone, the default code is 0000.</div>
Revert to this revision