Skip to content

Instantly share code, notes, and snippets.

@jedp
Created September 24, 2012 22:50
Show Gist options
  • Save jedp/3778932 to your computer and use it in GitHub Desktop.
Save jedp/3778932 to your computer and use it in GitHub Desktop.
B2G repo setup and build quickstart

B2G Quickstart for Payments and Identity

This sets you up to make two separate targets:

  • One for a desktop [simulator] 1
  • One for the ZTE [device] 2

These are the moving parts:

  • [mozilla-inbound repo] 3 clone (hg)
  • [gaia repo] 4 fork (git)
  • [B2G project clone] 5 (git)

Basic organization

I've structured my directories like so:

b2g-src/
  gaia/       # git clone of my gaia fork
  mi/         # hg clone of my mozilla-inbound user repo
  build/      # build dir that mi will create

b2g/          # git clone of mozilla-b2g/B2G

Prep steps: Setting up Mercurial Queues

Follow the steps in the [introduction to Mercurial queues] 6.

Read the [Mercurial queue workflow] [7] documentation.

Setting up the mozilla-inbound repo

This is where we will be working on navigator.id and friends.

First, cd b2g-src; mkdir mi; cd mi

In the mi directory:

hg init .
hg qinit -c    # initializes mercurial queues

Create and edit ./hg/hgrc, filling in your LDAP username correctly:

[paths]
default = ssh://<LDAP_username>@[email protected]/users/jparsons_mozilla.com/b2g-payments-identity/
mozilla-inbound = https://hg.mozilla.org/integration/mozilla-inbound/

Create and edit .hg/patches/.hg/hgrc

[paths]
default = http://hg.mozilla.org/users/jparsons_mozilla.com/b2g-payments-identity
default-push = ssh://hg.mozilla.org/users/jparsons_mozilla.com/b2g-payments-identity

Now you should be able to pull and build:

hg pull
hg update
make -f client.mk

While that runs, set up Gaia.

Setting up gaia

Setting up b2g to build the device target

cd $HOME/b2g

Create .userconfig and add these lines (adjusting paths accordingly):

# Configuration for custom device builds;  Desktop builds ignore this.

GAIA_PATH=/path/to/b2g-src/gaia
GECKO_PATH=/path/to/b2g-src/mi

VARIANT=user  # 'user' strangely means 'production'
              # this option omits the test apps from the phone

[7]: Read this: https://developer.mozilla.org/en-US/docs/Creating_Mercurial_User_Repositories#Mercurial_Queue_User_Repository_Workflow

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment