Mozilla's getting a new look. What do you think? https://mzl.la/brandsurvey

Building for Fairphone

RUN B2GOS on FAIRPHONE

Hi Fairphoner!
This site will let you build and install
all neccassary stuf to run B2GOS on a Fairphone!

 

It contains:

Build instructions for OSX
Build instructions for Ubuntu 14.4
Build instructions for Ubuntu 16.4
How to flash a device without having to fetch the code!

Build on OSX

Due to a wrong or different md5 checksum calculation you won't be able to build on OSX. But you can go for a Virtual Linux!

Build on Ubuntu 14.4.

I made a speedup of the process by chaining commands.

-> open terminal (ctrl, alt & T)

Type these commands separately:

sudo dpkg --add-architecture i386
sudo dpkg --add-architecture amd64
sudo apt-get install git
git config --global user.email " *youremail@url.tld* "
git config --global user.name " *yourusername* "
git config --global color.ui False
Installation
sudo apt-get install --no-install-recommends autoconf2.13 bison bzip2 ccache curl flex gawk gcc g++ g++-multilib git lib32ncurses5-dev lib32z1-dev libgconf2-dev zlib1g:amd64 zlib1g-dev:amd64 zlib1g:i386 zlib1g-dev:i386 libgl1-mesa-dev libx11-dev make zip lzop libxml2-utils openjdk-7-jdk nodejs unzip python mercurial && ccache -M 50G && echo $PWD && echo "commanding: git clone git://github.com/mozilla-b2g/B2G.git" && git clone git://github.com/mozilla-b2g/B2G.git && cd B2G && echo $PWD && echo "commanding: ./config.sh fairphone2" && ./config.sh fairphone2 && echo $PWD && echo "commanding: cd .. " && cd .. && echo $PWD && echo "commanding: curl -O http://dl.google.com/android/repository/android-ndk-r11b-linux-x86_64.zip" && curl -O http://dl.google.com/android/repository/android-ndk-r11b-linux-x86_64.zip && echo "commanding: unzip android-ndk-r11b-linux-x86_64.zip -d ~/ -home dir- " && unzip android-ndk-r11b-linux-x86_64.zip -d ~/ && echo $PWD && echo "commanding: curl -O https://nodejs.org/download/release/v4.4.7/node-v4.4.7.tar.gz" && curl -O https://nodejs.org/download/release/v4.4.7/node-v4.4.7.tar.gz && echo "commanding: tar -zxvf node-v4.4.7.tar.gz" && tar -zxvf node-v4.4.7.tar.gz && echo "commanding: cd node-v4.4.7" && cd node-v4.4.7 && echo "commanding: ./configure" && ./configure && echo "commanding: make install" && sudo make install && echo $PWD && echo "commanding: back to B2G folder!" && cd ~/B2G  

check or make .userconfig in the B2G folder and do not forget to update the BOLD text with your system username:

echo "*** entering .userconfig ***" 
export B2G_ANDROID_NDK_PATH=/home/WRITE YOUR SYSTEM-USERNAME HERE/android-ndk-r11b
echo "B2G_ANDROID_NDK_PATH=$B2G_ANDROID_NDK_PATH"
export B2G_DIR=${B2G_DIR:-$(cd $(dirname $0); pwd)}
echo "B2G_DIR=${B2G_DIR}"
echo "GECKO_OBJDIR = ${GECKO_OBJDIR}"
echo "*** exit .userconfig ***"

If you whant to make a Version to flash your phone:

./build.sh

If you whant to make a Version to flash your phone and update the community build:

./build.sh blobfree

If you run in to errors and need a log of your build:

./build.sh showcommands 2>&1 | tee build.log

everytime you run a new build clean your directories with this commands:

sudo rm -rf out && rm -rf objdir-gecko && rm -rf gaia/profile* && ccache -C

 

B2G-Installer for Fairphone

You don't like to build your own B2GOS? You can flash your device with the b2g-installer and a Community build!

Document Tags and Contributors

 Contributors to this page: Novski
 Last updated by: Novski,