Lightsaber build documentation and tool to flash Gaia and custom apps.
Preparing your Aries device
We recommend that you run this on an Aries device. It will, however, run correctly on a Flame or theoretically any other device.
If you haven't already, you should follow the general (B2G build instructions)[https://developer.mozilla.org/en-US/Firefox_OS/Building_and_installing_Firefox_OS] up until they ask you to run
All paths here and beyond are relative to your user folder,
~/. If you are on OS X, you should be using a case sensitive image to store all of these files. For example,
/Volumes/firefoxos. For instructions on how to create this image, see Mac file system case sensitivity.
Do not put the
lightsaber repo in your
If you're on Linux, you must install the
nodejs-legacy package, which symlinks
nodejs. Via apt-get:
sudo apt-get install nodejs-legacy
Linux and OS X
Install the node global dependencies:
sudo npm install -g bower && sudo npm install -g gulp && sudo npm install -g apm && sudo npm install -g grunt-cli && sudo npm install -g browserify
mozilla-central is the Gecko branch used for Lightsaber.
hg clone https://hg.mozilla.org/mozilla-central ~/mozilla-central
Setup B2G repository
You should already have a B2G repository cloned if you followed the general B2G build instructions. If not, clone the B2G repository locally:
git clone firstname.lastname@example.org:mozilla-b2g/B2G.git ~/B2G cd ~/B2G
Configure B2G repository
B2G must be configured to point to mozilla-central.
echo 'export GECKO_PATH=~/mozilla-central' > .userconfig
Configure for Aries device
B2G must be configured for the Aries device
Acquire binaries and build
You must now acquire the device binaries using the
Flash the full image
If the build completes without problems, you can flash the full image as follows:
Enable USB debugging
Go into the Settings app, then Developer > Debugging via USB > set this to "ADB only" or "ADB and DevTools".
Installing Lightsaber Gaia branch and apps
git clone https://github.com/fxos/lightsaber cd lightsaber make install make sync GAIA_DEV_PIXELS_PER_PX=2.25 DEVICE_DEBUG=1 MOZILLA_OFFICIAL=1 make reset-gaia
Enable Developer Mode
adb shell "stop b2g" adb shell "cd /data/b2g/mozilla/*.default/;echo 'user_pref(\"dom.apps.developer_mode\", true);' >> prefs.js;" adb shell "start b2g"
You should now have a device, running Lightsaber, to play around with.
Using this tool
These instructions are separate from installing Lightsaber on an Aries device. Instructions from here onward are just for using this tool. This tool is a wrapper for repo (https://code.google.com/p/git-repo/). It packages Lightsaber apps into a Gaia Lightsaber branch.
Install, build, and flash Lightsaber (CAUTION: this will destroy your profile!)
If you're on Linux, first run
sudo apt-get install nodejs-legacy
sudo npm install -g bower && sudo npm install -g gulp && sudo npm install -g apm && sudo npm install -g grunt-cli && sudo npm install -g browserify git clone https://github.com/fxos/lightsaber cd lightsaber make install make sync DEVICE_DEBUG=1 NOFTU=1 GAIA_DEV_PIXELS_PER_PX=2.25 make reset-gaia
Only run this if you already have Lightsaber installed, and you want to update your Lightsaber Gaia branch and apps
make sync make install-gaia
git clone https://github.com/fxos/lightsaber cd lightsaber make install
You will need to do this everytime a sub-repo is updated.
Delete all downloaded content, built files, etc.
Similar to Gaia. Note that all
make commands accept env vars such as
DEVICE_DEBUG, just like Gaia does.
Choose any of the following:
Build a Gaia profile.
Build a Gaia profile and flash it onto your device.
Destroy your Gaia profile, build a new one, and flash it onto your device.
Deletes all Lightsaber app build files and cleans the Gaia repo.