UPDATE: Installing Boot2Gecko on Nexus S

A couple of months ago I gave instructions on flashing B2G onto an unlocked Nexus S. Since that time, the B2G folks have made it a heck of a lot easier to do this. I though I’d provide some updated instructions.

The pre-requisites are largely the same. You need to have the Java SDK (I used 1.7 this time around, even though they say it’s unsupported) and the latest Android SDK including Plaftform-tools installed. You also need Linux (I used Ubuntu 12.04). You also still need quite a bit of space on your hard drive.
1. Install build dependencies
Run the following at the command line:

sudo apt-get install git mercurial libasound2-dev libcurl4-openssl-dev libnotify-dev libxt-dev libiw-dev mesa-common-dev autoconf2.13 ia32-libs gcc-multilib g++-multilib bison gperf lib32z-dev lib32ncurses5-dev lib32ncursesw5-dev libidl-dev lib32gomp1 autoconf2.13 ccache libx11-dev lib32readline-gplv2-dev autoconf2.13 flex make libc6-dev-i386

Accept the additional installs as well.

2. Set up /etc/udev/rules.d/51-android.rules for the Nexus S

Create a new file at /etc/udev/rules.d/51-android.rules and enter the following line:

SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", MODE="0666", GROUP="plugdev"

3. Clone the B2G repository and configure for Nexus S
Enter the following at the command line:

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

When finished, enter the following:

cd B2G
./config.sh nexus-s

This will take a bit of time.

4. Build B2G

Enter the following, still in the B2G directory:


…and wait. For a long time.

5. Flash clockworkmod recovery image to phone.

Instructions can be found here.

6. Flash results to phone.
Connect phone to computer via USB. Start phone in flashboot mode by simultaneously pressing power and volume up buttons. Select recovery mode.
While still in the B2G directory, run the following from the command line:


This will flash your B2G build onto the phone. You’ll lose everything previously on the phone!

This will re-boot your phone, and you will be the proud owner of a B2G-based Nexus S! To keep up-to-date, simply run

git pull
./repo sync

…in that order.

There you have it! Much easier, with three fewer steps than before.


About buffalobillion

Web Developer, JavaScript Balrog, Java dude, Ruby/Rails enthusiast. Guitar Playa.
This entry was posted in Mobile, Web Dev. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s