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 ]

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

# * NEED TO SCRIPT *
# 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
# * NEED TO SCRIPT *
# 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

# * NEED TO SCRIPT *
# 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

# * NEED TO SCRIPT *
# 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/

# * NEED TO SCRIPT *
# 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
# export GAIA_DEFAULT_LOCALE=es
# GAIA_KEYBOARD_LAYOUTS=en,es,it
# HOST_CXX := g++-4.6

# Marionette install:
# * NEED TO SCRIPT *
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

MARIONETTE_ENV=marionette
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

Advertisements

About shizen008

Breaking things and getting in trouble for it since '74. Disclaimer: I am not responsible if I make your head explode reading this blog! The writings here are my own expression and not of any companies. I currently work on being a QA for B2G aka Firefox OS
This entry was posted in Uncategorized. Bookmark the permalink.

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s