From c9c1efd276a97f754527c29d67687cf14299f55e Mon Sep 17 00:00:00 2001 From: Michael Marineau Date: Sun, 1 Dec 2013 15:05:05 -0800 Subject: [PATCH] fix(build_image): Add --fast to control use of parallel_emerge This makes it possible to toggle parallel_emerge just as other scripts do. In other scripts update the help string to be more specific, the --jobs option can be used to control parallelism. --- build_image | 2 ++ build_library/build_image_util.sh | 10 ++++++++-- build_packages | 2 +- sdk_lib/make_chroot.sh | 3 ++- setup_board | 3 ++- update_chroot | 3 ++- 6 files changed, 17 insertions(+), 6 deletions(-) diff --git a/build_image b/build_image index 891aca3d28..d06e1440a7 100755 --- a/build_image +++ b/build_image @@ -49,6 +49,8 @@ show_help_if_requested "$@" # not needed for the typical developer workflow. DEFINE_integer build_attempt 1 \ "The build attempt for this image build." +DEFINE_boolean fast "${DEFAULT_FAST}" \ + "Use the parallel_emerge wrapper script." DEFINE_integer jobs -1 \ "How many packages to build in parallel at maximum." DEFINE_boolean replace ${FLAGS_FALSE} \ diff --git a/build_library/build_image_util.sh b/build_library/build_image_util.sh index f9288e0627..f2ce6406d0 100755 --- a/build_library/build_image_util.sh +++ b/build_library/build_image_util.sh @@ -133,8 +133,14 @@ generate_au_zip () { emerge_to_image() { local mask="${INSTALL_MASK:-$(portageq-$BOARD envvar PROD_INSTALL_MASK)}" test -n "$mask" || die "PROD_INSTALL_MASK not defined" - local emerge_cmd="$GCLIENT_ROOT/chromite/bin/parallel_emerge" - emerge_cmd+=" --board=$BOARD --root-deps=rdeps --usepkgonly -v" + + local emerge_cmd + if [[ "${FLAGS_fast}" -eq "${FLAGS_TRUE}" ]]; then + emerge_cmd="$GCLIENT_ROOT/chromite/bin/parallel_emerge --board=$BOARD" + else + emerge_cmd="emerge-$BOARD" + fi + emerge_cmd+=" --root-deps=rdeps --usepkgonly -v" if [[ $FLAGS_jobs -ne -1 ]]; then emerge_cmd+=" --jobs=$FLAGS_jobs" diff --git a/build_packages b/build_packages index a986d0b8fd..1304dc4dd1 100755 --- a/build_packages +++ b/build_packages @@ -50,7 +50,7 @@ show_help_if_requested "$@" DEFINE_string accept_licenses "" \ "Licenses to append to the accept list." DEFINE_boolean fast "${DEFAULT_FAST}" \ - "Call many emerges in parallel." + "Use the parallel_emerge wrapper script." DEFINE_integer jobs -1 \ "How many packages to build in parallel at maximum." DEFINE_boolean norebuild "${FLAGS_FALSE}" \ diff --git a/sdk_lib/make_chroot.sh b/sdk_lib/make_chroot.sh index 67e0f72ec3..c517993ec3 100755 --- a/sdk_lib/make_chroot.sh +++ b/sdk_lib/make_chroot.sh @@ -41,7 +41,8 @@ DEFINE_boolean getbinpkg $FLAGS_TRUE \ DEFINE_boolean delete $FLAGS_FALSE "Delete an existing chroot." DEFINE_boolean replace $FLAGS_FALSE "Overwrite existing chroot, if any." DEFINE_integer jobs -1 "How many packages to build in parallel at maximum." -DEFINE_boolean fast ${DEFAULT_FAST} "Call many emerges in parallel" +DEFINE_boolean fast "${DEFAULT_FAST}" \ + "Use the parallel_emerge wrapper script." DEFINE_string stage3_date "20130130" \ "Use the stage3 with the given date." DEFINE_string stage3_path "" \ diff --git a/setup_board b/setup_board index e89a065280..601341d819 100755 --- a/setup_board +++ b/setup_board @@ -37,7 +37,8 @@ DEFINE_string accept_licenses "" \ "Licenses to append to the accept list." DEFINE_string board_overlay "" \ "Location of the board overlay." -DEFINE_boolean fast ${DEFAULT_FAST} "Call many emerges in parallel" +DEFINE_boolean fast "${DEFAULT_FAST}" \ + "Use the parallel_emerge wrapper script." DEFINE_integer jobs -1 \ "How many packages to build in parallel at maximum." DEFINE_boolean latest_toolchain $FLAGS_FALSE \ diff --git a/update_chroot b/update_chroot index 71c9943401..4d203bcdd4 100755 --- a/update_chroot +++ b/update_chroot @@ -28,7 +28,8 @@ show_help_if_requested "$@" # The following options are advanced options, only available to those willing # to read the source code. They are not shown in help output, since they are # not needed for the typical developer workflow. -DEFINE_boolean fast ${DEFAULT_FAST} "Call many emerges in parallel" +DEFINE_boolean fast ${DEFAULT_FAST} \ + "Use the parallel_emerge wrapper script." DEFINE_integer jobs -1 \ "How many packages to build in parallel at maximum." DEFINE_boolean skip_toolchain_update $FLAGS_FALSE \