cros_setup_toolchains: split off variant names with --show-board-cfg
Some tools (like build_image) will call us with the full board name,
so handle that edge case.
BUG=None
TEST=`cros_setup_toolchains --show-board-cfg=tegra2_kaen` works
Change-Id: I8f2077e218f4ee0630fdc42180daab3f2f95558a
Reviewed-on: https://gerrit.chromium.org/gerrit/25607
Commit-Ready: Mike Frysinger <vapier@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
diff --git a/scripts/cros_setup_toolchains.py b/scripts/cros_setup_toolchains.py
index 14c421e..cc31b5f 100644
--- a/scripts/cros_setup_toolchains.py
+++ b/scripts/cros_setup_toolchains.py
@@ -231,7 +231,14 @@
if board == 'all':
cmd.append('--all_boards')
else:
- cmd.append('--board=' + board)
+ # TODO(vapier):
+ # Some tools will give us the base board name ('tegra2') while others will
+ # give us the board+variant ('tegra2_kaen'). The cros_overlay_list does
+ # not like getting variant names, so strip that off. Not entirely clear
+ # if this is what we want to do, or if the cros_overlay_list should give
+ # us back the overlays (including variants). I'm inclined to go with the
+ # latter, but that requires more testing to prevent fallout.
+ cmd.append('--board=' + board.split('_')[0])
overlays = cros_build_lib.RunCommand(
cmd, print_cmd=False, redirect_stdout=True).output.splitlines()