It is assumed you've already setup your build environment and cloned the repositories.
Backing up your Galaxy S2's native OS
You'll want to back up your phone's factory image before attempting to build or flash anything to it. As it happens, the builds or flash process itself can be unstable and you don't want to end up with a brick.
These instructions assume that you have already installed heimdall.
From some other directory than where you have B2G installed:
$ cd /tmp
$ wget http://cmw.22aaf3.com/c1/recovery/re...4-galaxys2.tar
$ tar xvf recovery-clockwork-*tar
$ adb reboot download
When your phone is in "download" mode, it's ready to be flashed using Odin protocol.
To Flash Clockworked (and backup image):
With your phone in "download" mode, run the following:
$ heimdall flash --kernel zImage
Next, reboot the phone to recovery mode.
$ adb reboot recovery
With the phone in recovery mode, follow the on-screen instructions to make a backup image.