[Galaxy S II General] gabx:
DUAL BOOT CM9/B2G : A QUICK & DIRTY HOW-TO

DEVELOPMENT ON SGS2 HAS BEEN STOPED. IT SEEMS WE WILL NEVER SEE THIS OS FULLY WORKING ON OUR DEVICES

B2G is Boot To Gecko, a Mozilla OS for device project. I have been following it since a while, and it is a very active and promising OS for your SGS2. It is in its very early stage, so do not expect to use it daily, but it is improving very fast.

When Gokham talked about dual boot, I immediatly think to B2G, as I am not interested in any other custom ROM than CM9. Thanks to its new 3.2.2 Kernel, it is now very easy to give it a try.

The work has been done by PULSER, building the B2G image, and GOKHAM, for dual boot capability. So a warm thanks to both of them, and of course to the B2G Team.

I will come back in the coming weeks with a more fine tuned How-To, as I did the install in the rush this morning.

How-To

I did everything on Ubuntu 11.10. Windows users will use Odin, and I am sure it works with other Linux distro.

I assume you have SyiahKernel v3.2.2. on your SGS2

I assume you have a working SGS2/Linux communication. It means a working ADB, USB and Heimdall. I used heimdall 1.3.1, and some users report issues with 1.3.2. Furthermore, I used Command Line, as the heimdall GUI front-end didn't work for me, and I didn't take time to investigate.

I assume B2G will be your second ROM.

Download the last two files of the list here (system and data image):

http://villainrom.co.uk/pulser/B2G/

Untar <Boot2GeckoDualBootsystem.tar> and rename it <hidden.img> if Pulser haven't changed the name (was mistakenly named <hiddenfs.img>)

Unzip <data.img.zip> and get a 2G <data.img>

Boot your device in CWM Recovery.

As mentionned on SyiahKernel website, Mounts and storage > format /secondrom_data and /secondrom_cache.

Reboot your device in Download Mode.

Plug your device

Run this command is to make sure heimdall is working

$ heimdall detect
Device detected

It shall return <detected>

$ heimdall flash --hidden <PATH/TO/HIDDEN.IMG>

---- you will see progress until 100%. It hangs a litle bit around 88%, just wait.

Reboot device on Android

Run this command on Linux:

$ adb push <PATH/TO/DATA.IMG> </sdcard/.secondrom/data.img>

File is big, so it takes a while (a few mn).

Reboot. On the dual boot screen, you have 3 sec to press your Home Button. Then you shall see :

Booting for the second ROM...

IF second ROM doesn't boot quickly (around 10-20 sec), then there is a mess somewhere.

Normally, you will quickly boot to B2G Lock Screen.

!!At this state, you will have nothing more than the lock screen. You need then to make-isntall Gaia!!

Let's make-install Gaia now

1-Dirty and quickest way-TRY THIS ONE FIRST

I did not yet tested this shortest way. It will save you a lot of time cloning unusefull stuff from Git.

You may have in this case an error with adb. Try to copy your own adb executable in the path where make gaia is supposed to find it.

Plug your device running the second ROM, B2G.

Then:

$mkdir ~/B2G
$ cd ~/B2G
$ git clone https://github.com/mozilla-b2g/gaia
$ mkdir /glue/gonk/out/host/linux-x86/bin
==> copy your adb executable in this directroy. Check permission
$cd gaia
$ make install-gaia

This is very minimal, but shall work.

2-Academic way

$mkdir ~/mozilla/gits/B2G
$ cd ~/mozilla/gits/B2G
$ git clone https://github.com/mozilla-b2g/B2G
$ cd B2G
$ make sync

Time for a beer...or two!! It takes long

Boot your device to second ROM, B2G now.

Plug your device to the computer.

Check if adb is fully working :

$ cd ~/mozilla/gits/B2G/
$ adb devices
List of devices attached
00194a183cd97e	device

!!If you have no number and device, adb is not properly working on your system.!!

copy adb executable in /usr/bin

*EDIT : do not stress on adb, as in this case, when making gaia, an adb will be built.

Assuming you are still in the gaia folder

$cd ..
$ make install-gaia

ET VOILA.

You will soon see the gaia frontend.

useful links:

https://developer.mozilla.org/en/Mozilla/Boot_to_Gecko/Setting_Up_Boot_to_Gecko_Build_Environment

https://developer.mozilla.org/en/Mozilla/Boot_to_Gecko/Building_B2G_for_Samsung_Galaxy_S2

http://xdaforums.com/showthread.php?t=1518467

https://www.villainrom.co.uk/forum/threads/introduction-to-dual-boot-of-boot2gecko-b2g.5436/

http://johnhammink.blogspot.ca/2012/05/part-3-updating-your-gingerbread.html

There is a very active B2G mailing list.

All credits to B2G dev, PULSER and Gokham.