diff --git a/sync_build_test.sh b/sync_build_test.sh index ce19479e92..4fb27151a5 100755 --- a/sync_build_test.sh +++ b/sync_build_test.sh @@ -52,6 +52,9 @@ DEFINE_boolean build ${FLAGS_TRUE} \ DEFINE_boolean build_autotest ${FLAGS_FALSE} "Build autotest" DEFINE_string buildbot_uri "${BUILDBOT_URI}" \ "Base URI to buildbot build location which contains LATEST file" +DEFINE_string chrome_root "" \ + "The root of your chrome browser source. Should contain a 'src' subdir. \ +If this is set, chrome browser will be built from source." DEFINE_string chronos_passwd "${CHRONOS_PASSWD}" \ "Use this as the chronos user passwd (defaults to \$CHRONOS_PASSWD)" DEFINE_string chroot "" "Chroot to build/use" @@ -82,7 +85,6 @@ DEFINE_boolean withdev ${FLAGS_TRUE} "Build development packages" DEFINE_boolean usepkg ${FLAGS_TRUE} "Use binary packages" DEFINE_boolean unittest ${FLAGS_TRUE} "Run unit tests" - # Returns a heuristic indicating if we believe this to be a google internal # development environment. # Returns: @@ -126,6 +128,11 @@ function validate_and_set_param_defaults() { FLAGS_force_make_chroot=${FLAGS_TRUE} fi + # If chrome_root option passed, set as option for ./enter_chroot + if [[ -n "${FLAGS_chrome_root}" ]]; then + chroot_options="--chrome_root=${FLAGS_chrome_root}" + fi + if [[ -z "${FLAGS_repo}" ]]; then if is_google_environment; then FLAGS_repo="ssh://git@chromiumos-git//chromeos" @@ -360,7 +367,8 @@ function run_phase() { function run_phase_in_chroot() { local desc="$1" shift - run_phase "${desc}" ./enter_chroot.sh "--chroot=${FLAGS_chroot}" -- "$@" + run_phase "${desc}" ./enter_chroot.sh "--chroot=${FLAGS_chroot}" \ + ${chroot_options} -- "$@" } @@ -533,6 +541,12 @@ function main() { fi fi + if [[ ${FLAGS_chrome_root} ]]; then + run_phase_in_chroot "Building Chromium browser" \ + USE="build_tests" FEATURES="-usersandbox" \ + CHROME_ORIGIN=LOCAL_SOURCE emerge-${FLAGS_board} chromeos-chrome + fi + if [[ ${FLAGS_master} -eq ${FLAGS_TRUE} ]]; then chdir_relative src/scripts if [[ -n "${FLAGS_chronos_passwd}" ]]; then