Building Pure Fusion OS

Building Pure Fusion OS

You are here:
< Back

Getting Started

To build PureFusion from source, you’ll need to be familiar with Git and Repo and with Establishing a build environment.

Build Environment

  • Tested and Working on any version of Ubuntu – 14.04,14.10,15.04,16.04,17.04,17.10 (64-bit)
  • Any other distribution based of the Ubuntu Distro such as Lubuntu, Xubuntu and etc.
  • Any form of Terminal
  • Decent hardware (minimum of at least a dual core CPU and 8 GB of RAM)
  • A storage unit of any kind (We recommend utilizing SSDs as Mechanical HDDs slow down the build proccess drastically and the minimum storage size is 70GB. Having more will be useful with CCache[More on that later])
  • Required Packages should have been installed

Required Packages

Simply copy and paste this in a terminal window:

[Hint: Running this command installs the required packages to build android]

For Ubuntu 16.04+
 $ sudo apt-get update && sudo apt-get install git-core gnupg flex bison gperf libsdl1.2-dev libesd0-dev libwxgtk3.0-dev squashfs-tools build-essential zip curl libncurses5-dev zlib1g-dev openjdk-8-jre openjdk-8-jdk pngcrush schedtool libxml2 libxml2-utils xsltproc lzop libc6-dev schedtool g++-multilib lib32z1-dev lib32ncurses5-dev lib32readline6-dev gcc-multilib maven tmux screen w3m ncftp imagemagick
For Ubuntu <16.04
 $ sudo apt-get update && sudo apt-get install git-core gnupg flex bison gperf libsdl1.2-dev libesd0-dev libwxgtk2.8-dev squashfs-tools build-essential zip curl libncurses5-dev zlib1g-dev openjdk-8-jre openjdk-8-jdk pngcrush schedtool libxml2 libxml2-utils xsltproc lzop libc6-dev schedtool g++-multilib lib32z1-dev lib32ncurses5-dev lib32readline-gplv2-dev gcc-multilib maven tmux screen w3m ncftp imagemagick

Getting the source

  • Making required directories
  • Obtaining the repo binary
  • Adding repo binary to your path
  • Giving the repo binary proper permissions
  • Initializing an empty repo
  • Syncing the repo
Make directory for the repo binary
  $ mkdir ~/bin
Add directory for the repo binary to its path
  $ PATH=~/bin:$PATH
Downloading repo binary and placing it in the proper directory
  $ curl http://commondatastorage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
Giving the repo binary the proper permissions
  $ chmod a+x ~/bin/repo
Creating directory for where the Fusion repo will be stored and synced
  $ mkdir ~/PureFusion
  $ cd ~/PureFusion

Syncing the source

To initialize your local repository, use this command:

repo init -u https://github.com/PureFusionOS/manifest.git -b n-mr2

Then to sync up:

repo sync -c -f -j8 --force-sync --no-clone-bundle --no-tags
Setting Up CCache
  • CCache is a method of utilizing a specified storage space to speed up building. It can be referred to as the same caching your android device does to speed up application and system boot times. In this case, CCache will help build Pure Fusion faster than standard build times (Able to cut-down 50% of time taken to build).
  • To set up CCache, follow the following:
    $ echo "export USE_CCACHE=1" >> ~/.bashrc
    
    $ prebuilts/misc/linux-x86/ccache/ccache -M 50G

    -M 50G The number before the letter G at the end specifies the amount of space CCache can use in your storage unit. As such, ensure that not too much of space is specified as this might result in unexpected errors although, the more storage you have, its recommended to have more CCache as it will increase the build times. Most efficient build systems are able to utilize CCache to about 120G or more.

After syncing is done, do one of the following to build:

bash build.sh --help

OR

1) . build/envsetup.sh
2) brunch device-user/userdebug/eng