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/cros_generate_sysroot.py b/scripts/cros_generate_sysroot.py
index a6233ae..a1e8cad 100644
--- a/scripts/cros_generate_sysroot.py
+++ b/scripts/cros_generate_sysroot.py
@@ -77,7 +77,7 @@
def _InstallBuildDependencies(self):
# Calculate buildtime deps that are not runtime deps.
- raw_sysroot = '/build/%s' % (self.options.board,)
+ raw_sysroot = cros_build_lib.GetSysroot(board=self.options.board)
cmd = ['qdepends', '-q', '-C', self.options.package]
output = cros_build_lib.RunCommandCaptureOutput(
cmd, extra_env={'ROOT': raw_sysroot}).output