default=False, help="Use full toolchain path in CROSS_COMPILE")
parser.add_argument('-P', '--per-board-out-dir', action='store_true',
default=False, help="Use an O= (output) directory per board rather than per thread")
+ parser.add_argument('--print-arch', action='store_true',
+ default=False, help="Print the architecture for a board (ARCH=)")
parser.add_argument('-r', '--reproducible-builds', action='store_true',
help='Set SOURCE_DATE_EPOCH=0 to suuport a reproducible build')
parser.add_argument('-R', '--regen-board-list', type=str,
tchain = tc_set.pop()
print(tchain.GetEnvArgs(toolchain.VAR_CROSS_COMPILE))
+def show_arch(brds):
+ """Show information about a the architecture used by one or more boards
+
+ The function checks that all boards use the same architecture, then prints
+ the correct value for ARCH.
+
+ Args:
+ boards: Boards object containing selected boards
+
+ Return:
+ None on success, string error message otherwise
+ """
+ board_selected = brds.get_selected_dict()
+ arch_set = set()
+ for brd in board_selected.values():
+ arch_set.add(brd.arch)
+ if len(arch_set) != 1:
+ sys.exit('Supplied boards must share one arch')
+ print(arch_set.pop())
+
def get_allow_missing(opt_allow, opt_no_allow, num_selected, has_branch):
"""Figure out whether to allow external blobs
show_toolchain_prefix(brds, toolchains)
return 0
+ if args.print_arch:
+ show_arch(brds)
+ return 0
+
series = determine_series(selected, col, git_dir, args.count,
args.branch, args.work_in_output)
self._RunControl('--boards', 'board1,board2', '--boards', 'board4')
self.assertEqual(3, self._builder.count)
+
+ def test_print_arch(self):
+ """Test that we can print the board architecture"""
+ with test_util.capture_sys_output() as (stdout, stderr):
+ result = self._RunControl('--print-arch', 'board0')
+ self.assertEqual('arm\n', stdout.getvalue())
+ self.assertEqual('', stderr.getvalue())