Added a new script to do chroot bootstrapping.

This script is used to bootstrap-build the host compiler and then all
host packages, including all toolchain for all boards.

Bootstrapping the chroot is a mandatory step before we roll out any
compiler changes. Currently we have no script to formalize this process.

The basic idea of this script is to populate a user-provided gcc tree
onto a local branch in chromeos/src/third_party/gcc git and then
modify the active ebuild file to pick up this specific gcc tree.

The usage of this script -

Usage: bootstrap_compiler.py [options]

Options:
  -h, --help            show this help message and exit
  -c CHROMEOS_ROOT, --chromeos_root=CHROMEOS_ROOT
                        ChromeOs root dir.
  -b BRANCH, --branch=BRANCH
                        The branch to test against. This branch must be a
                        local branch inside "src/third_party/gcc". Notice,
                        this must not be used with "--gcc".
  -g GCC_DIR, --gcc_dir=GCC_DIR
                        Use a local gcc tree to do bootstrapping. Notice, this
                        must not be used with "--branch".
  --fixperm             Fix the (notorious) permission error while trying to
                        bootstrap the chroot. Note this takes an extra 10-15
                        minutes and is only needed once per chromiumos tree.
  --setup_gcc_ebuild_file_only
                        Setup gcc ebuild file to pick up the branch (--branch)
                        or user gcc source (--gcc_dir) and exit. Keep chroot
                        as is.
  --reset_gcc_ebuild_file
                        Reset the modification that is done by this
                        script.Note, when this script is running, it will
                        modify the active gcc ebuild file. Use this option to
                        reset (what this script has done) and exit.

Change-Id: Iab07d60c3ccb2e1b8feda9df0fb13d5474a50cbe
Reviewed-on: https://gerrit-int.chromium.org/34165
Reviewed-by: Luis Lozano <llozano@chromium.org>
Commit-Queue: Han Shen <shenhan@google.com>
Tested-by: Han Shen <shenhan@google.com>
2 files changed