cros_choose_profile: add a board_root flag

This allows us to use setup_board for another directory than /build/${BOARD}.

BUG=chromium:423159
TEST=* ./setup_board --board=gizmo
  * ./setup_board --board=gizmo --board_root=/tmp/mysysroot
  * diff -r /build/gizmo /tmp/mysysroot are the same except for
  * packages/Packages, timestamps, random ids and make.conf.board_setup.
TEST=trybot run on lumpy-incremental, chromiumos-sdk

Change-Id: I4e4c2f9a62c47cdd166546f17bd60d5f1055f79f
Reviewed-on: https://chromium-review.googlesource.com/223140
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Commit-Queue: Bertrand Simonnet <bsimonnet@chromium.org>
Tested-by: Bertrand Simonnet <bsimonnet@chromium.org>
diff --git a/host/cros_choose_profile b/host/cros_choose_profile
index e8219b0..bd0c2af 100755
--- a/host/cros_choose_profile
+++ b/host/cros_choose_profile
@@ -31,6 +31,7 @@
 DEFINE_string board_overlay "" "Location of the board overlay."
 DEFINE_string variant "" "Board variant."
 DEFINE_string profile "" "The portage configuration profile to use."
+DEFINE_string board_root "" "Board root where the profile should be created."
 
 # Parse command line flags
 FLAGS "$@" || exit 1
@@ -47,7 +48,7 @@
 
 get_board_and_variant $FLAGS_board $FLAGS_variant
 
-BOARD_ROOT="/build/${BOARD_VARIANT}"
+BOARD_ROOT="${FLAGS_board_root:-/build/${BOARD_VARIANT}}"
 CHROMIUMOS_OVERLAY="/usr/local/portage/chromiumos"
 CHROMIUMOS_PROFILES="${CHROMIUMOS_OVERLAY}/profiles"
 MAKE_PROFILE="${BOARD_ROOT}/etc/make.profile"