Possible script to standup an linux box with b2g… still need to work out some parts:

# Ubuntu 12.04 64 bit OS: B2G installer

# the following will get your machine all updated
sudo apt-get update
sudo apt-get upgrade

# add repos
sudo apt-add-repository ppa:chris-lea/node.js
sudo add-apt-repository ppa:ubuntu-toolchain-r/test

sudo apt-get update
sudo apt-get install python-software-properties

sudo apt-get install libxml2-utils
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

sudo apt-get install openjdk-7-jdk

# [ if that does not work or if you want oracle’s jdk :
# sudo add-apt-repository ppa:webupd8team/java
# sudo apt-get update
# sudo apt-get install oracle-java7-installer
# sudo update-java-alternatives -s java-7-oracle ]

# download studio : http://developer.android.com/sdk/index.html
# run studio.sh
# go to the sdk directory
# run tools/android update sdk –no-ui

# vi ~/.bashrc ( or profile or whatever)
# add : PATH=$PATH:<android sdk location>/tools:<android sdk location>/platform-tools

ccache –max-size 3GB

sudo vi /etc/udev/rules.d/android.rules
# get file from github.com/nhirata/android_rules instead of vi

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

sudo apt-get install mercurial

# option
# backing up a device:
# adb pull /system -backup target dir=/system
# adb pull /data -backup target dir=/data
# adb pull /vendor -backup target dir=/vendor
# adb pull /boot -backup target dir=/boot

git clone git://github.com/mozilla-b2g/B2G.git
cd B2G
BRANCH=master ./config.sh flame-kk

sudo apt-get install gcc-4.7 g++-4.7
sudo rm /usr/bin/gcc
sudo ln -s /usr/bin/gcc-4.7 /usr/bin/gcc
sudo rm /usr/bin/g++
sudo ln -s /usr/bin/g++-4.7 /usr/bin/g++

sudo apt-add-repository ppa:chris-lea/node.js-legacy
sudo apt-get update
sudo apt-get install nodejs-legacy
sudo apt-get install nodejs

# option : changing gecko paths
# vi .userconfig:
# export GECKO_PATH=/path/to/mozilla-central
# export GECKO_OBJDIR=/path/to/mozilla-central/objdir-gonk
# back up device
# ANDROIDFS_DIR=<absolute path to parent dir of system dir> ./config.sh <target>

# copy b2g tree
# rsync -a source/ dest/

# option : adding locales
# Adding locales
# cd gaia/locales/
# hg clone https://hg.mozilla.org/releases/gaia-l10n/v1_2/es
# export LOCALE_BASEDIR=$PWD/locales
# export LOCALES_FILE=$PWD/locales/languages_dev.json
# HOST_CXX := g++-4.6

# Marionette install:
wget –no-check-certificate https://bootstrap.pypa.io/ez_setup.py
sudo python ez_setup.py –insecure

# GECKO_DIR= B2G_Gecko
cd $GECKO_DIR/testing/marionette/client
sudo python setup.py develop
# not sure why you have to run it twice
sudo python setup.py develop
sudo apt-get install python-pip
sudo pip install virtualenv

virtualenv $MARIONETTE_ENV
cd $GECKO_DIR/testing/marionette/client
$MARIONETTE_ENV/bin/python setup.py develop

# verify install:
# $MARIONETTE_ENV/bin/python
#  >>> from marionette import Marionette
# On device run
# adb forward tcp:2828 tcp:2828
# cd $GECKO_DIR/testing/marionette/client/marionette
# python runtests.py –address localhost:2828 –type=b2g tests/unit/unit-tests.ini

Posted in Uncategorized | Leave a comment

From the desk of Mark Surman,

Hi there,

We’re reaching out to you now because three sections of the PATRIOT Act expire soon, which gives us a rare opportunity to push for reforms that will protect our privacy while also keeping us safe.

Congress is going to decide whether to reauthorize sections of the PATRIOT Act used by the National Security Administration (NSA) to collect the phone records of millions of people who have never been suspected of any involvement in terrorism.

At Mozilla, we believe keeping us safe shouldn’t have to cost us our privacy. Individuals’ security and privacy on the Internet are fundamental and must not be treated as optional.

We have a chance to rein in mass surveillance. Sign this important petition asking Congress to stop the bulk collection of private information.  ( https://sendto.mozilla.org/page/m/29b5e0b4/6aa39c3e/15ff8999/5c5c5c95/581847190/VEsE/ )

This is only the beginning. Mozilla is working on multiple fronts to improve user security, privacy, and trust online — things like ensuring strong encryption and better oversight and accountability. The decisions coming up about sections of the PATRIOT Act are a big chance to begin scaling back some of the most egregious invasions of our privacy.

Congress is negotiating whether to reauthorize these mass surveillance programs right now. Please tell your elected officials to stand up for our privacy. ( https://sendto.mozilla.org/page/m/29b5e0b4/6aa39c3e/15ff8999/5c5c5c6f/581847190/VEsF/ )

If we come together now, we can take a major step toward the reforms that we need to protect the free and open Web.

Thanks for speaking out right now, at this critical moment, and for all you do to fight for the open Web.


Mark Surman
Executive Director

P.S. You might wonder why Mozilla cares about bulk collection of phone calls — and what that has to do with protecting the free and open Web. Here’s why: While the provisions in question allow for the bulk collection of telephone records, this same provision also might be used to conduct mass surveillance of Internet data. Because of a lack of transparency, it’s hard to know how broad the net is being cast. Reform of these sections of the PATRIOT Act will help set a major precedent, one we can leverage to rein in overly broad surveillance on the free and open Web, so we have to join together to speak out now ( https://sendto.mozilla.org/page/m/29b5e0b4/6aa39c3e/15ff8999/5c5c5c79/581847190/VEsC/ )

Posted in Uncategorized | Leave a comment

Considering the chipsets of the mobile products are starting to get more and more powerful…

I get the feeling that chipsets in mobile will get to a point where it’s just as powerful as the desktop machines.

What if… we make a computer cluster of mobile devices + desktop devices whether through web or through OS…


If it’s an easy setup…  you could end up having a pretty powerful machine.

Posted in Uncategorized | Leave a comment

Device Pref, Device Settings w/ WebIDE

So apparently talking to fabrice, you should be able to add:

pref(“network.proxy.type”, 1);
pref(“network.proxy.http”, “”);
pref(“network.proxy.http_port”, 3128);

to b2g.js to change the proxy server.

You can also do this in the Simulator.
From WebIDE > Runtime > Device Preferences
Add the settings (same as you would by editing the js file)

There’s a pref added so that it affects just the browser/ftp on b2g:

Also to note, if you download the nightly and connect the device, you can change the device settings with the webide.

Posted in Uncategorized | Leave a comment

Playing with inserting JS into apps

Thanks to one of our contributors ( Jamie_ ), I learned that we can insert some JS code into the simulator to have it trigger certain things.

Here are the steps to get to the scratch pad in WebIDE:

1. launch browser

2. go to Tools -> Web Developer -> WebIDE

3. select Runtime and select a simulator ( if you don’t have a simulator installed you will want to install one first ).  For this example, we’ll use 2.2

4. on the left side, select the app you want to use JS to trigger an event.  For this example, we’ll use the main process.

5. select the wrench icon and select Scratchpad

6. you should then be able to place in your js script : For this example, we’ll use some code snippet from : https://developer.mozilla.org/en-US/Add-ons/Code_snippets/Alerts_and_Notifications

function popup(title, text) {
  try {
              .showAlertNotification(null, title, text, false, '', null);
  } catch(e) {
    // prevents runtime error on platforms that don't implement nsIAlertsService

popup('Test', 'This is a test; So exciting!')

Screen Shot 2015-04-01 at 10.56.10 AM

7.  Click on Run.

You should get an output like this :

Screen Shot 2015-04-01 at 10.55.22 AM

Posted in Uncategorized | Leave a comment

Adventures in resets

Personally, I don’t like to do resets on hg.  Git resets are so much easier.

B2G happens to be a mirror off of git.mozilla.org so it works off of git.

Unfortunately, gecko devs work off of hg.

So in order to find the same revision you have to either have a mapping or I found an easier way: git log –grep=”Bug 1107139″

or whatever bug you’re looking up.

Both gecko and gaia dev have a work flow that includes the bug number.  This will show you all the revs with that bug number.

You can then do a: git reset –hard d103771dfdee3f8475a10f3de9ff5998ac2d686e

or whatever your hash you want to reset is.

On hg, installing extensions helps out a lot in terms of backout and such…. still got a bit to learn about how hg works.

[edit: If you want to try reset on hg, there’s some reading material… http://stackoverflow.com/questions/2672454/how-do-i-git-reset-hard-head-on-mercurial ]

Posted in Uncategorized | Leave a comment

Backouts for gecko / gaia

from https://bitbucket.org/sfink/qbackout : 
To enable this extension, create an entry for it in your hgrc, like this:

qbackout = ~/mozilla/qbackout

For more information, see http://mercurial.selenic.com/wiki/UsingExtensions

and then see : 
Posted in Uncategorized | Leave a comment