scripts: remove ZEPHYR_BASE as default root for board listing
Remove ZEPHYR_BASE as default root in list_boards.py.
This allows list_boards.py to be used to only print boards at given
root(s) without printing Zephyr default boards.
Secondly it remove the need in list_boards.py to have any knowledge of
ZEPHYR_BASE.
The `west boards` command already has ZEPHYR_BASE knowledge and can
easily add ZEPHYR_BASE to the list of roots it is already constructing,
thus removing the need for knowing that ZEPHYR_BASE is always added.
Update boards.cmake to pass ZEPHYR_BASE as an additional arch root, as
arch.cmake has not yet been processed,which means ZEPHYR_BASE is missing
in ARCH_ROOT list at this point in time.
Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
diff --git a/scripts/list_boards.py b/scripts/list_boards.py
index 88753ae..92478f9 100755
--- a/scripts/list_boards.py
+++ b/scripts/list_boards.py
@@ -9,8 +9,6 @@
from pathlib import Path
from typing import NamedTuple
-ZEPHYR_BASE = Path(__file__).resolve().parents[1]
-
#
# This is shared code between the build system's 'boards' target
# and the 'west boards' extension command. If you change it, make
@@ -41,14 +39,14 @@
arches = sorted(find_arches(args))
ret = defaultdict(set)
- for root in itertools.chain([ZEPHYR_BASE], args.board_roots):
+ for root in args.board_roots:
for arch, boards in find_arch2board_set_in(root, arches).items():
ret[arch] |= boards
return ret
def find_arches(args):
- arch_set = find_arches_in(ZEPHYR_BASE)
+ arch_set = set()
for root in args.arch_roots:
arch_set |= find_arches_in(root)
@@ -99,12 +97,10 @@
# flags
parser.add_argument("--arch-root", dest='arch_roots', default=[],
type=Path, action='append',
- help='''add an architecture root (ZEPHYR_BASE is
- always present), may be given more than once''')
+ help='add an architecture root, may be given more than once')
parser.add_argument("--board-root", dest='board_roots', default=[],
type=Path, action='append',
- help='''add a board root (ZEPHYR_BASE is always
- present), may be given more than once''')
+ help='add a board root, may be given more than once')
def dump_boards(arch2boards):
for arch, boards in arch2boards.items():