Building B2G for Samsung Nexus S

  • Revision slug: Mozilla/Boot_to_Gecko/Building_B2G_for_Samsung_Nexus_S
  • Revision title: Building B2G for Samsung Nexus S
  • Revision id: 5693
  • Created:
  • Creator: dflanagan
  • Is current revision? No
  • Comment 100 words added, 4 words removed

Revision Content

It is assumed you've already setup your build environment and cloned the repositories.

Note: The known working model numbers of Nexus S devices are GT-I9020A and GT-I9023. The list of variants is available on the Nexus S Wikipedia page.

Backing up the vendor OS

Unlike with other devices, Android ROMs for the Nexus S are provided by Google. It is therefore not necessary to back up this device.

Building

Do NOT run any of the following commands as root!  From the directory to where you've cloned your git repositories:

$ cd B2G
$ make sync

Next, you will setup your build directory with the binary blobs necessary for building for your device. This step will download the blobs from Google and clone the ICS version of Gonk:

$ make config-nexuss-ics

Now, build gonk backend and the system itself:
$ make gonk
$ make

 

Flashing

Unlocking the bootloader when flashing for the first time

Boot the phone directly into the bootloader by pressing the Volume Up and Power button at the same time. Connect the phone to your computer and unlock the bootloader with the following command:

$ fastboot oem unlock

On the device, confirm this step by selecting "Yes" with the Volume Up button and then pressing the Power button. The phone is now unlocked and is almost ready to be flashed with B2G.

Select the "Reboot" option from the bootloader screen with the Volume Up button and then presss the Power button to reboot. Unlocking the phone causes a factory reset, so you'll have to go through the "first-use" steps as if this was a brand-new phone.  Next, go into Settings and select Applications and then Development and then check Debug Mode.  This will allow you to commuicate with the phone over USB.

Finally, you can flash the phone and install B2G.  Just type:

$ make flash-only

Important: Make sure to boot into Android or B2G before executing the above command or else this will fail with a "device not found" message.

Building and flashing the Gaia frontend only

Assuming you're in the root of B2G repo, pull files from the remote repo and merge them to your local repo. To just update gaia on the device:

$ cd gaia
$ git pull origin master
$ cd ..
$ make install-gaia
$ make kill-b2g

Building and flashing Gecko only

$ make install-gecko
$ make kill-b2g

Forcing the Git repo into clean state

Sometimes it's necessary to do this - but cloning a fresh repo and running make sync takes too much time.

$ make mrproper

Important: This will reset your B2G repository completely. It will appear as if you just checked out. You will lose all local modifications and files not tracked by Git!

Revision Source

<p>It is assumed you've already <a href="Setting_Up_Boot_to_Gecko_Build_Environment" rel="internal" title="https://developer.mozilla.org/en/Mozilla/Boot_to_Gecko/Setting_Up_Boot_to_Gecko_Build_Environment">setup your build environment and cloned the repositories</a>.</p>
<p>Note: The known working model numbers of Nexus S devices are GT-I9020A and GT-I9023. The list of variants is available on the <a class="link-https" href="https://en.wikipedia.org/wiki/Nexus_S#Variants" title="https://en.wikipedia.org/wiki/Nexus_S#Variants">Nexus S Wikipedia page</a>.</p>
<h2>Backing up the vendor OS</h2>
<p>Unlike with other devices, Android ROMs for the Nexus S are provided by Google. It is therefore not necessary to back up this device.</p>
<h2>Building</h2>
<p style="margin-left: ;">Do NOT run any of the following commands as root!  From the directory to where you've cloned your git repositories:<br> <br> <code>$ cd B2G<br> $ make sync</code></p>
<p>Next, you will setup your build directory with the binary blobs necessary for building for your device. This step will download the blobs from Google and clone the ICS version of Gonk:</p>
<p><code>$ </code><code>make config-nexuss-ics</code></p>
<p>Now, build gonk backend and the system itself:<br> <code>$ make gonk<br> $ make</code></p>
<p><a class="external" href="http://4.bp.blogspot.com/-IaDmq-AlC_I/TydgNEkHvAI/AAAAAAAAAMs/G2DJfdUkIts/s320/Make.tiff"><img alt="" class="default" src="http://4.bp.blogspot.com/-IaDmq-AlC_I/TydgNEkHvAI/AAAAAAAAAMs/G2DJfdUkIts/s320/Make.tiff"></a></p>
<p> </p>
<h2><strong>Flashing</strong></h2>
<h3>Unlocking the bootloader when flashing for the first time</h3>
<p>Boot the phone directly into the bootloader by pressing the Volume Up and Power button at the same time. Connect the phone to your computer and unlock the bootloader with the following command:</p>
<p><code>$ fastboot oem unlock</code></p>
<p>On the device, confirm this step by selecting "Yes" with the Volume Up button and then pressing the Power button. The phone is now unlocked and is almost ready to be flashed with B2G.</p>
<p>Select the "Reboot" option from the bootloader screen with the Volume Up button and then presss the Power button to reboot. Unlocking the phone causes a factory reset, so you'll have to go through the "first-use" steps as if this was a brand-new phone.  Next, go into Settings and select Applications and then Development and then check Debug Mode.  This will allow you to commuicate with the phone over USB.</p>
<p>Finally, you can flash the phone and install B2G.  Just type:</p>
<p><code>$ make flash-only<br> </code></p>
<p><code><strong>Important:</strong> Make sure to boot into Android or B2G before executing</code> the above command or else this will fail with a "device not found" message.</p>
<h3>Building and flashing the Gaia frontend only</h3>
<p>Assuming you're in the root of B2G repo, pull files from the remote repo and merge them to your local repo. To just update gaia on the device:</p>
<p><code>$ cd gaia</code><br> <code>$ git pull origin master</code><br> <code>$ cd ..</code><br> <code>$ make install-gaia</code><br> <code>$ make kill-b2g</code></p>
<h3>Building and flashing Gecko only</h3>
<p><span style='font-family: "Courier New",Courier,monospace;'>$ make install-gecko</span><br> <span style='font-family: "Courier New",Courier,monospace;'>$ make kill-b2g</span></p><h2 class="editable"><span>Forcing the Git repo into clean state</span></h2>
<p>Sometimes it's necessary to do this - but cloning a fresh repo and running <code>make sync </code>takes too much time.</p>
<p><code>$ make mrproper</code></p>
<p style="margin-left: 40px;"><strong>Important:</strong> This will reset your B2G repository completely. It will appear as if you just checked out. You will lose all local modifications and files not tracked by Git!</p>
Revert to this revision