Skip to content

Instantly share code, notes, and snippets.

@bobchao
Last active December 30, 2015 08:49
Show Gist options
  • Save bobchao/7805113 to your computer and use it in GitHub Desktop.
Save bobchao/7805113 to your computer and use it in GitHub Desktop.
Building Firefox OS (B2G) - Geeksphone Keon + Ubuntu 12.04.03 + Mac OS X

Download

Prepare VM

  • Create a VM for Ubuntu 64bits
    • Memory: 4+ GB
    • HDD: ~40 GB
    • Network > Adapter 1 > Advanced > Port Forward:
      • NAME: ssh
      • PROTOCOL: TCP
      • HOST PORT: 3022
      • GUEST PORT: 22
      • Then you can ssh -p 3022 127.0.0.1 from your Mac's terminal.
    • Ports > USB
      • Enable USB Controller (check!)
      • Click the first icon on the left, enable all kinds of USB device with VM.

Prerequest

https://developer.mozilla.org/en-US/Firefox_OS/Firefox_OS_build_prerequisites

sudo apt-get update
sudo apt-get install autoconf2.13 bison bzip2 ccache curl flex gawk gcc g++ g++-multilib git ia32-libs lib32ncurses5-dev lib32z1-dev libgl1-mesa-dev libx11-dev make zip
ccache --max-size 3GB

http://developer.android.com/sdk/index.html, download ADT Bundle, unzip, and add ADB to ~/.bashrc

nano ~/.bashrc

Add this (where $SDK_HOME is the path to "platform-tools")

PATH=$SDK_HOME:$PATH

Then

sudo nano /etc/udev/rules.d/android.rules

Add these lines

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

Then

sudo chmod a+r /etc/udev/rules.d/android.rules
sudo service udev restart

Fetch and Build

https://developer.mozilla.org/en-US/Firefox_OS/Preparing_for_your_first_B2G_build

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

Plug-in your Keon

./config.sh keon

https://developer.mozilla.org/en-US/Firefox_OS/Building

./build.sh

https://developer.mozilla.org/en-US/Firefox_OS/Installing_on_a_mobile_device

./flash.sh

Update the tree right before your next building

git pull
./repo sync -d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment