Lightsaber build documentation and tool to flash Gaia and custom apps.
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 ./build.sh
.
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 B2G
repo.
If you're on Linux, you must install the nodejs-legacy
package, which symlinks node
to nodejs
. Via apt-get:
sudo apt-get install nodejs-legacy
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
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 git@github.com:mozilla-b2g/B2G.git ~/B2G
cd ~/B2G
B2G must be configured to point to mozilla-central.
echo 'export GECKO_PATH=~/mozilla-central' > .userconfig
B2G must be configured for the Aries device
./config.sh aries
You must now acquire the device binaries using the ./build.sh
tool:
./build.sh
If the build completes without problems, you can flash the full image as follows:
./flash.sh
Go into the Settings app, then Developer > Debugging via USB > set this to "ADB only" or "ADB and DevTools".
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
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.
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.
make sync
make really-clean
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.
make
Build a Gaia profile and flash it onto your device.
make install-gaia
Destroy your Gaia profile, build a new one, and flash it onto your device.
make reset-gaia
Deletes all Lightsaber app build files and cleans the Gaia repo.
make clean