Skip to content

Instantly share code, notes, and snippets.

@timdream
Last active March 16, 2016 15:08
Show Gist options
  • Save timdream/7716684 to your computer and use it in GitHub Desktop.
Save timdream/7716684 to your computer and use it in GitHub Desktop.
Build and update your own B2G build daily-ish without blow away data. Now comes with localization testing.

B2G Personal daily dogfooding instruction

This is how I generate my dogfood build, daily-ish. I do so to ensure I have (almost) total control over what goes into my phone so I could pick up the changes anytime I wanted (and indentifying the version of Gaia/Gecko I am using).

This instruction is used for Geeksphone Peak and with zh-TW locale. Replace/remove instruction for your own phone.

File locations:

  • update.sh should go to $B2G (the place you clone B2G repo with git).
  • local.mk contains specific instructions for Gaia, put it in $B2G/gaia.
  • languages_mine.json should go to $B2G/gaia/locales.
{
"en-US" : "English (US)",
"zh-TW" : "正體中文 (繁體)"
}
# For 1.5dppx Peak -- switch visual assets to 1.5dppx ones.
GAIA_DEV_PIXELS_PER_PX=1.5
# Use official branding (do not distribute your resulting build without written permission from Mozilla)
PRODUCTION=1
MOZILLA_OFFICIAL=1
# This sets DevTools access to allowed in mozSettings
DEVICE_DEBUG=1
# Select your favorite keyboard layouts/IME
# Here are some of the layouts/IME of my special interests.
GAIA_KEYBOARD_LAYOUTS=en,zh-Hant-Zhuyin,el,de,fr,pl,ru,zh-Hans-Pinyin,ko
# Include your favorite locales
# Your locales should be listed in the languages_mine.json file. Copy the labels from languages_all.json.
LOCALE_BASEDIR=locales/
LOCALES_FILE=locales/languages_mine.json
# Update your locale repo first
# Note that you'll need to manually clone the locale repo to B2G/gaia/locales directory from one of the repo in
# https://hg.mozilla.org/gaia-l10n/ first, like
# hg clone https://hg.mozilla.org/gaia-l10n/zh-TW/ B2G/gaia/locales/zh-TW
hg -R gaia/locales/zh-TW pull -u default
# Before bug 922463 is fixed, we will need to reset the local changes made by multilocale script before we sync
# Warning: this reset all the uncommitted changes in the repo too!
# git --git-dir=./gaia/.git --work-tree=./gaia/ checkout .
# Update and config B2G itself and start building
# Build a "user" build so that Gaia will be put in the system partation
git pull &&\
BRANCH=master TARGET_BUILD_VARIANT=user ./config.sh peak &&\
./build.sh TARGET_BUILD_VARIANT=user ||\
exit
# Pause
read
# Flash *only* the system partation to NOT removing data.
# Mind that you might want to remove data when you flash the phone for the first time.
./flash.sh system
@bobchao
Copy link

bobchao commented Dec 14, 2013

ah! "indentifying the version of Gaia/Gecko I am using," got it... so you'll update the code manually?

@timdream
Copy link
Author

FYI: Since we are on master of gaia, I'll clone http://hg.mozilla.org/gaia-l10n/zh-TW/ instead of v1_3.

Done.

Do we need a line to ./repo sync ?

No, config.sh do that for you.

ah! "indentifying the version of Gaia/Gecko I am using," got it... so you'll update the code manually?

No, simply allow me to include the change just reach master.

@gasolin
Copy link

gasolin commented Jan 2, 2014

the line # "hg clone https://hg.mozilla.org/gaia-l10n/zh-TW/ B2G/gaia/locales/zh-TW" could be
# hg clone https://hg.mozilla.org/gaia-l10n/zh-TW/ gaia/locales/zh-TW

so people can uncomment and use it directly at first time

@timdream
Copy link
Author

timdream commented Jan 3, 2014

@gasolin, fixed, thanks.

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