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: 298058
  • Created:
  • Creator: Sheppy
  • Is current revision? No
  • Comment

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.

On Linux, if you get this,

< waiting for device >

that probably means that you haven't added a udev rule for the fastboot device, which is not the same as the one for adb. You can get the USB vendor ID by running lsusb now, but typically it's Google's: 18d1, so adding this line in your /etc/udev/rules.d/51-android.rules would work:

SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", MODE="0666", GROUP="plugdev"
Note: If you get a very helpful libusb error "-3" on Linux, it means you need to be root to have the needed access to the USB device. Run the script again using sudo.

Special notes for the Samsung 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 additional information. This is actually a success condition, and you can ignore the advice.

To get rid of this strange behavior, grab a source copy of heimdall, downgrading to the 1.3.1 release ("git checkout fbbed42c1e5719cc7a4dceeba098981f19f37c06"), then compile it  according to the README, then install that to make the error go away. However, this isn't strictly 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.

Added step for the Samsung Galaxy S2

If you're flashing onto the Galaxy S2, there is an additional step to follow (unless you used the special instructions in {{ anch("Avoiding automatic updates") }} above). 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.

Troubleshooting

Here are a some tips for what to do if your device doesn't work right after installing B2G, or updating it to a new version

If the UI doesn't start up

If you update your phone and the user interface doesn't start up, you can reset it to clear out out-of-date configuration and the like. This may bring it back to life. Here's how:

cd gaia
make reset-gaia

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 id="Flashing_your_phone">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>On Linux, if you get this,</p>
<pre>
&lt; waiting for device &gt;</pre>
<p>that probably means that you haven't added a udev rule for the fastboot device, which is not the same as the one for adb. You can get the USB vendor ID by running lsusb now, but typically it's Google's: 18d1, so adding this line in your /etc/udev/rules.d/51-android.rules would work:</p>
<pre>
SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", MODE="0666", GROUP="plugdev"</pre>
<div class="note">
  <strong>Note:</strong> If you get a very helpful <code>libusb</code> error "-3" on Linux, it means you need to be root to have the needed access to the USB device. Run the script again using <code>sudo</code>.</div>
<h3 id="Special_notes_for_the_Samsung_Galaxy_S2">Special notes for the Samsung Galaxy S2</h3>
<p>If your phone is a Galaxy S2 and you are using heimdall 1.3.2 (the latest version; use <code>heimdall version</code> to check), you may see an alarming error "FACTORYFS upload failed!" followed by "Heimdall flashing failed" and some additional information. This is actually a success condition, and you can ignore the advice.</p>
<p>To get rid of this strange behavior, grab 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 ("<code>git checkout fbbed42c1e5719cc7a4dceeba098981f19f37c06</code>"), then compile it&nbsp; according to the <code>README</code>, then install that to make the error go away. However, this isn't strictly 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>
<h2 id="Added_step_for_the_Samsung_Galaxy_S2">Added step for the Samsung Galaxy S2</h2>
<p>If you're flashing onto the Galaxy S2, there is an additional step to follow (unless you used the special instructions in {{ anch("Avoiding automatic updates") }} above). 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 id="Flashing_specific_partitions_to_fastboot_phones">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 id="Updating_specific_modules">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 id="Next_steps">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>
<h2 class="note" id="Troubleshooting">Troubleshooting</h2>
<p>Here are a some tips for what to do if your device doesn't work right after installing B2G, or updating it to a new version</p>
<h3 class="note" id="If_the_UI_doesn't_start_up">If the UI doesn't start up</h3>
<p>If you update your phone and the user interface doesn't start up, you can reset it to clear out out-of-date configuration and the like. This may bring it back to life. Here's how:</p>
<pre>
cd gaia
make reset-gaia
</pre>
Revert to this revision