Update build scripts to work under Kokoro+Repo

Kokoro does not support <linkfile> tags. That means two workarounds are
needed:
(a) build.sh is called as "./core/kokoro" (not "./kokoro") and therefore
must adjust ROOT_DIR location - done by checking for presence of
"../.repo_manifest" folder
(b) build.sh must first symlink files specified in <linkfile> tags of
the manifest - done by a Python script

Move init logic like this to a .inc file that can be shared between
build scripts for different projects.

Change-Id: I4d632c7200d34d08981e58d290883bd2cd9e5a04
4 files changed