mirror of
https://github.com/AsahiLinux/u-boot
synced 2025-02-26 20:37:16 +00:00
buildman: Detect boards with no CONFIG_TARGET defined
We generally expected exactly one of these. Add a check for it. Note: This warning is not displayed by default. An option will be added to enable it. Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
parent
bec06ed892
commit
ad99599ca2
2 changed files with 16 additions and 1 deletions
|
@ -262,6 +262,10 @@ class KconfigScanner:
|
||||||
else:
|
else:
|
||||||
target = tname
|
target = tname
|
||||||
|
|
||||||
|
if not target:
|
||||||
|
cfg_name = expect_target.replace('-', '_').upper()
|
||||||
|
warnings.append(f'WARNING: {leaf}: No TARGET_{cfg_name} enabled')
|
||||||
|
|
||||||
params['target'] = expect_target
|
params['target'] = expect_target
|
||||||
|
|
||||||
# fix-up for aarch64
|
# fix-up for aarch64
|
||||||
|
|
|
@ -951,6 +951,7 @@ Active aarch64 armv8 - armltd total_compute board2
|
||||||
|
|
||||||
# Add another TARGET to the Kconfig
|
# Add another TARGET to the Kconfig
|
||||||
tools.write_file(main, data, binary=False)
|
tools.write_file(main, data, binary=False)
|
||||||
|
orig_kc_data = tools.read_file(kc_file)
|
||||||
extra = (b'''
|
extra = (b'''
|
||||||
if TARGET_BOARD2
|
if TARGET_BOARD2
|
||||||
config TARGET_OTHER
|
config TARGET_OTHER
|
||||||
|
@ -958,9 +959,19 @@ config TARGET_OTHER
|
||||||
\tdefault y
|
\tdefault y
|
||||||
endif
|
endif
|
||||||
''')
|
''')
|
||||||
tools.write_file(kc_file, tools.read_file(kc_file) + extra)
|
tools.write_file(kc_file, orig_kc_data + extra)
|
||||||
params_list, warnings = self._boards.build_board_list(config_dir, src)
|
params_list, warnings = self._boards.build_board_list(config_dir, src)
|
||||||
self.assertEquals(2, len(params_list))
|
self.assertEquals(2, len(params_list))
|
||||||
self.assertEquals(
|
self.assertEquals(
|
||||||
['WARNING: board2_defconfig: Duplicate TARGET_xxx: board2 and other'],
|
['WARNING: board2_defconfig: Duplicate TARGET_xxx: board2 and other'],
|
||||||
warnings)
|
warnings)
|
||||||
|
|
||||||
|
# Remove the TARGET_BOARD0 Kconfig option
|
||||||
|
lines = [b'' if line == b'config TARGET_BOARD2\n' else line
|
||||||
|
for line in orig_kc_data.splitlines(keepends=True)]
|
||||||
|
tools.write_file(kc_file, b''.join(lines))
|
||||||
|
params_list, warnings = self._boards.build_board_list(config_dir, src)
|
||||||
|
self.assertEquals(2, len(params_list))
|
||||||
|
self.assertEquals(
|
||||||
|
['WARNING: board2_defconfig: No TARGET_BOARD2 enabled'],
|
||||||
|
warnings)
|
||||||
|
|
Loading…
Add table
Reference in a new issue