: New feature! MozillaWiki is now mobile-friendly. Visit from a mobile device to see new mobile theme + try editing. Release details.

Firefox OS/TCP/Patching

From MozillaWiki
< Firefox OS‎ | TCP(Redirected from FirefoxOS/TCP/Patching)
Jump to: navigation, search

Developing for the Tablet

The primary Firefox OS build documentation, including pre-requisites, set-up, building, flashing, and FAQs are all available at https://developer.mozilla.org/en-US/Firefox_OS/Building_and_installing_Firefox_OS

This is meant to be a quick reference guide specific to the Tablet Contribution Program and the first tablet device which is named in the project as "flatfish".

Here's a great introductory slide deck on hacking Firefox OS.

Preparation

The following instructions of this document are all verified on Ubuntu 12.04 & 12.10 and also Mac OS.

  1. Firefox OS (B2G) environment, including Android ADB and fastboot

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

    sudo apt-get install libxml2-utils

  2. Create an account in github

    https://github.com/

Gotcha: udev rules for Linux

When building on Linux, you may need to manually set up udev rules as noted in the above directions. Beware that the Flatfish appears to report different USB vendor IDs depending on whether it's already booted up or in the fastboot mode! You may need to add both of these udev rules to /etc/udev/rules.d/51-android.rules in order to do a full system flash:

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

Download B2G and AOSP source codes of flatfish

  1. git clone b2g scripts and config files

    git clone git://github.com/mozilla-b2g/B2G.git -b master b2g_flatfish

  2. configure flatfish and repo sync aosp and b2g source codes

    cd b2g_flatfish

    ./config.sh flatfish

    You have to wait for a long while to download the source codes depending on the network bandwidth. The files will need approx. 11gb disc space.

Start to build flatfish

  1. Connect flatfish device for extract necessary files at first build

    The first build will pull necessary files into backup-flatfish which is automatic created by extract-files.sh. You DO NOT need to connect flatfish device if backup-flatfish is created.

  2. How to build all of B2G

    For flatfish, we need some prefix to support tablet distribution and enable some functions. GAIA_DEVICE_TYPE=tablet is used for supporting tablet distribution of gaia (older versions used GAIA_DISTRIBUTION_DIR=distribution_tablet instead). B2G_SYSTEM_APPS=1 is for moving webapp from /data to /system, and B2G_UPDATER=1 is enable OTA.

    GAIA_DEVICE_TYPE=tablet B2G_SYSTEM_APPS=1 B2G_UPDATER=1 ./build.sh

    Building whole system might take a long time, you can take a rest or try to build gecko/gaia if you just modify gecko/gaia.

  3. How to build Gecko or Gaia only

    Gecko only

    B2G_UPDATER=1 ./build.sh gecko

    Gaia only

    GAIA_DEVICE_TYPE=tablet B2G_SYSTEM_APPS=1 ./build.sh gaia

Flash the images you build

Please make sure adb can connect to your device successfully before flash images. You can do a simple test to check adb connection; you will see something like “FLATFISH_123456 device” after typing “adb devices” if adb connection successfully.

  1. Flash whole images

    ./flash.sh

  2. Flash gecko only

    ./flash.sh gecko

  3. Flash gaia only

    ./flash.sh gaia

Flashing problems

If you have problems with the flashing process failing with timeout errors try disabling any USB 3.0 controllers in the BIOS

If your tablet becomes bricked, please follow the steps in Repairing a bricked device to reflash your device.

If you need the driver for your Windows computer, see this Jing for instructions.

Subsequent code pulls

To update all the code:

git pull

./repo sync -d

Or to sync only a single make target:

./repo sync gaia

Contributing your code

You can either submit a GitHub pull request or file a bug in Bugzilla with a patch. However, you should almost certainly first discuss it with the B2G or Gaia teams. See the MDN documentation on contributing to Gaia.

WIP bug list

Bug 965145 - [Camera] refactor .sensorAngle patch in bug 947956 for new camera app

FAQ

To be continued