Add GetSysroot function in cros_build_lib to return sysroot of a board
Many existing scripts use '/build/board' directly as the sysroot. We
should unify this and have a function that returns the sysroot of a
board.
BUG=None
TEST=`buildbot/run_tests` passes
Change-Id: I13bc130c6f156f70a09cbed9d38ff82204cca0d7
Reviewed-on: https://chromium-review.googlesource.com/182923
Reviewed-by: Yu-Ju Hong <yjhong@chromium.org>
Commit-Queue: Yu-Ju Hong <yjhong@chromium.org>
Tested-by: Yu-Ju Hong <yjhong@chromium.org>
diff --git a/scripts/parallel_emerge.py b/scripts/parallel_emerge.py
index db54021..25bc53c 100644
--- a/scripts/parallel_emerge.py
+++ b/scripts/parallel_emerge.py
@@ -278,9 +278,10 @@
# point our tools at /build/BOARD and to setup cross compiles to the
# appropriate board as configured in toolchain.conf.
if self.board:
- os.environ["PORTAGE_CONFIGROOT"] = "/build/" + self.board
- os.environ["PORTAGE_SYSROOT"] = "/build/" + self.board
- os.environ["SYSROOT"] = "/build/" + self.board
+ sysroot = cros_build_lib.GetSysroot(board=self.board)
+ os.environ["PORTAGE_CONFIGROOT"] = sysroot
+ os.environ["PORTAGE_SYSROOT"] = sysroot
+ os.environ["SYSROOT"] = sysroot
# Although CHROMEOS_ROOT isn't specific to boards, it's normally setup
# inside emerge-${BOARD}, so we set it up here for compatibility. It