Latest commit 0650a72 Jan 19, 2017 @hedwig34 hedwig34 committed with Gerrit Code Review Merge "Create link of as in root of source d…
…irectory for easier access so all you have to do is "./ [option] [device name]"" into oct-14.1


Team-OctOS Android Source

Getting Started

To get started with the Team-OctOS sources, you'll need to get familiar with Git and Repo.

Creating Your SSH Keys

Check to see if you already have existing SSH Keys.

ls ~/.ssh

By default, SSH Keys are saved as: id_rsa and

If you do NOT have these files, continue. If you DO have these, skip the next step!

Note: If you already have existing SSH Keys, doing this will overwrite them!

cd ~
ssh-keygen -t rsa

It will ask you where to store the key (defaults to ~/.ssh/id_rsa) and will ask if you wish to enter a password. If you enter a password, you will need to enter this EVERY TIME.

Registering Your SSH Keys

We recommend (and will assume) that you are using your SSH Keys for GitHub and Gerrit review.

cat ~/.ssh/

This will display your PUBLIC SSH Key. This is what you will put on GitHub and Gerrit, and will be used to identify you to those services.

Please see GitHub's Step 3: Add your SSH key to GitHub to add your key to your account.

Creating your SSH Config File

After creating your SSH Key, you will need to create a configuration file so the system will know to use these keys automatically.

Open your ~/.ssh/config file in your favorite editor (nano, gedit, vim, etc).

nano ~/.ssh/config

and add the following code blocks.

    User <Gerrit_UserName>
    IdentityFile ~/.ssh/id_rsa
    StrictHostKeyChecking no
    UserKnownHostsFile /dev/null
    User <GitHub_Registered_Email>
    IdentityFile ~/.ssh/id_rsa
    StrictHostKeyChecking no
    UserKnownHostsFile /dev/null

and then save. This will allow your system to automatically supply your SSH key when connecting to these hosts.

Create the Directories

You will need to set up some directories in your build environment.

To create them run:

mkdir -p ~/bin
mkdir -p ~/octos

Install the Repository Binary

Enter the following to download the "repo" binary and make it executable:

curl > ~/bin/repo && chmod a+x ~/bin/repo

You may need to reboot for these changes to take effect. Now enter the following to initialize the repository:

Install External Libraries Needed for Building

These libraries are needed for building, but not installed by default or carried by the ROM.

Ensure System is up-to-date and add libraries needed that are not included in stock Linux

sudo apt-get update && sudo apt-get upgrade
sudo apt-get install libcap-dev texinfo automake autoconf libgmp-dev libexpat-dev python-dev liblz4-tool

Required when using SaberMOD's toolchain

wget -O && unzip && sudo cp -R prebuilts_cloog_isl-master/lib/* -f /usr/lib/x86_64-linux-gnu && sudo ln -s /usr/include/asm-generic /usr/include/asm

Set the Team OctOs environmental flags - Add these to the bottom of ~/.bashrc

# OctOs Build Flags
export CCACHE_DIR=$HOME/.ccache
export USE_CCACHE=1

alias git-pl="git log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit"

#set up ccache if not present
if [ ! -d "$CCACHE_DIR" ]; then
    $HOME/octos/prebuilts/misc/linux-x86/ccache/ccache -M 50G

The below flag(s) are OPTIONAL

export TO_OR=xx

The TO_OR variable allows the user to set the concurrent threads when builds (-j#). If it is not set, it will be automatically set to the number of CPU cores available to the system.

Initialize the Repositories

cd ~/octos
repo init -u -b oct-14.1 && repo sync

This will initialize the new repository and begin the initial sync. This will take a while!

Building the System

Initialize the environment with the script. Note: Replacing "source" with a single dot saves a few characters, and the short form is more commonly used in documentation.

. build/

Enter the number of the build you want to start and press enter

The first time you build a device, the system will identify and fetch the required device repos.

Submitting Patches

Patches are always welcome! Please submit your patches via Team-OctOS Gerrit!

<This section to be filled in at a later time>

Make your changes and commit with a detailed message, starting with what you are working with (i.e. vision: Update Kernel) Commit your patches in a single commit. Squash multiple commit using this command: git rebase -i HEAD~<# of commits>

To view the status of your and others' patches, visit Team-OctOS Code Review