Skip to content

Commit 0003e47

Browse files
committed
Fix KERNEL_TEST_TARGET reading from BOARD_TOP_LEVEL_VARS
KERNEL_TEST_TARGET is located in BOARD_TOP_LEVEL_VARS section of inventory, not at the top level. Update both extract_boards_by_support_level and select_one_branch_per_board to read from the correct location. This ensures boards with KERNEL_TEST_TARGET="current" only generate current branch targets, excluding edge and legacy branches.
1 parent c4a8ba3 commit 0003e47

1 file changed

Lines changed: 84 additions & 12 deletions

File tree

scripts/generate_targets.py

Lines changed: 84 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -391,7 +391,9 @@ def extract_boards_by_support_level(image_info, extensions_map=None, remove_exte
391391
# If set, only include branches that are in KERNEL_TEST_TARGET
392392
entry = data['entry']
393393
inventory = entry.get('in', {}).get('inventory', {})
394-
kernel_test_target = inventory.get('KERNEL_TEST_TARGET', '')
394+
# KERNEL_TEST_TARGET is in BOARD_TOP_LEVEL_VARS
395+
toplevel_vars = inventory.get('BOARD_TOP_LEVEL_VARS', {})
396+
kernel_test_target = toplevel_vars.get('KERNEL_TEST_TARGET', '')
395397

396398
if kernel_test_target:
397399
# Parse KERNEL_TEST_TARGET - comma-separated list of branches
@@ -431,7 +433,9 @@ def select_one_branch_per_board(boards):
431433
branch = board_data['branch']
432434
entry = board_data['entry']
433435
inventory = entry.get('in', {}).get('inventory', {})
434-
kernel_test_target = inventory.get('KERNEL_TEST_TARGET', '')
436+
# KERNEL_TEST_TARGET is in BOARD_TOP_LEVEL_VARS
437+
toplevel_vars = inventory.get('BOARD_TOP_LEVEL_VARS', {})
438+
kernel_test_target = toplevel_vars.get('KERNEL_TEST_TARGET', '')
435439

436440
# Determine branch priority for this board
437441
if kernel_test_target:
@@ -588,16 +592,22 @@ def generate_stable_yaml(conf_wip_boards, manual_content=""):
588592
yaml = generate_yaml_header()
589593

590594
# Separate by branch and performance/architecture
595+
# Only separate by actual branch names, not by category
591596
current_fast = [b for b in conf_wip_boards if b['branch'] == 'current' and b['is_fast'] is True]
592597
current_slow = [b for b in conf_wip_boards if b['branch'] == 'current' and b['is_fast'] is False]
593598
current_riscv64 = [b for b in conf_wip_boards if b['branch'] == 'current' and b['is_fast'] == 'riscv64']
594599
current_loongarch = [b for b in conf_wip_boards if b['branch'] == 'current' and b['is_fast'] == 'loongarch']
595600
current_headless = [b for b in conf_wip_boards if b['branch'] == 'current' and b['is_fast'] is None]
596-
vendor_fast = [b for b in conf_wip_boards if b['branch'] in ('vendor', 'legacy') and b['is_fast'] is True]
597-
vendor_slow = [b for b in conf_wip_boards if b['branch'] in ('vendor', 'legacy') and b['is_fast'] is False]
598-
vendor_riscv64 = [b for b in conf_wip_boards if b['branch'] in ('vendor', 'legacy') and b['is_fast'] == 'riscv64']
599-
vendor_loongarch = [b for b in conf_wip_boards if b['branch'] in ('vendor', 'legacy') and b['is_fast'] == 'loongarch']
600-
vendor_headless = [b for b in conf_wip_boards if b['branch'] in ('vendor', 'legacy') and b['is_fast'] is None]
601+
vendor_fast = [b for b in conf_wip_boards if b['branch'] == 'vendor' and b['is_fast'] is True]
602+
vendor_slow = [b for b in conf_wip_boards if b['branch'] == 'vendor' and b['is_fast'] is False]
603+
vendor_riscv64 = [b for b in conf_wip_boards if b['branch'] == 'vendor' and b['is_fast'] == 'riscv64']
604+
vendor_loongarch = [b for b in conf_wip_boards if b['branch'] == 'vendor' and b['is_fast'] == 'loongarch']
605+
vendor_headless = [b for b in conf_wip_boards if b['branch'] == 'vendor' and b['is_fast'] is None]
606+
legacy_fast = [b for b in conf_wip_boards if b['branch'] == 'legacy' and b['is_fast'] is True]
607+
legacy_slow = [b for b in conf_wip_boards if b['branch'] == 'legacy' and b['is_fast'] is False]
608+
legacy_riscv64 = [b for b in conf_wip_boards if b['branch'] == 'legacy' and b['is_fast'] == 'riscv64']
609+
legacy_loongarch = [b for b in conf_wip_boards if b['branch'] == 'legacy' and b['is_fast'] == 'loongarch']
610+
legacy_headless = [b for b in conf_wip_boards if b['branch'] == 'legacy' and b['is_fast'] is None]
601611

602612
# Current branch lists
603613
yaml += """# Stable builds - fast HDMI (quad-core+ or modern SoCs)
@@ -672,6 +682,42 @@ def generate_stable_yaml(conf_wip_boards, manual_content=""):
672682
yaml += format_board_item(board_data, include_extensions=True) + '\n'
673683
yaml += ' # end of auto generated section\n\n'
674684

685+
# Legacy branch lists
686+
if legacy_fast:
687+
yaml += ' stable-legacy-fast-hdmi: &stable-legacy-fast-hdmi\n'
688+
yaml += ' # auto generated section\n'
689+
for board_data in sorted(legacy_fast, key=lambda x: x['board']):
690+
yaml += format_board_item(board_data, include_extensions=True) + '\n'
691+
yaml += ' # end of auto generated section\n\n'
692+
693+
if legacy_slow:
694+
yaml += ' stable-legacy-slow-hdmi: &stable-legacy-slow-hdmi\n'
695+
yaml += ' # auto generated section\n'
696+
for board_data in sorted(legacy_slow, key=lambda x: x['board']):
697+
yaml += format_board_item(board_data, include_extensions=True) + '\n'
698+
yaml += ' # end of auto generated section\n\n'
699+
700+
if legacy_riscv64:
701+
yaml += ' stable-legacy-riscv64: &stable-legacy-riscv64\n'
702+
yaml += ' # auto generated section\n'
703+
for board_data in sorted(legacy_riscv64, key=lambda x: x['board']):
704+
yaml += format_board_item(board_data, include_extensions=True) + '\n'
705+
yaml += ' # end of auto generated section\n\n'
706+
707+
if legacy_loongarch:
708+
yaml += ' stable-legacy-loongarch: &stable-legacy-loongarch\n'
709+
yaml += ' # auto generated section\n'
710+
for board_data in sorted(legacy_loongarch, key=lambda x: x['board']):
711+
yaml += format_board_item(board_data, include_extensions=True) + '\n'
712+
yaml += ' # end of auto generated section\n\n'
713+
714+
if legacy_headless:
715+
yaml += ' stable-legacy-headless: &stable-legacy-headless\n'
716+
yaml += ' # auto generated section\n'
717+
for board_data in sorted(legacy_headless, key=lambda x: x['board']):
718+
yaml += format_board_item(board_data, include_extensions=True) + '\n'
719+
yaml += ' # end of auto generated section\n\n'
720+
675721
yaml += """# automated lists stop
676722
677723
targets:
@@ -707,6 +753,16 @@ def generate_stable_yaml(conf_wip_boards, manual_content=""):
707753
yaml += ' - *stable-vendor-loongarch\n'
708754
if vendor_headless:
709755
yaml += ' - *stable-vendor-headless\n'
756+
if legacy_fast:
757+
yaml += ' - *stable-legacy-fast-hdmi\n'
758+
if legacy_slow:
759+
yaml += ' - *stable-legacy-slow-hdmi\n'
760+
if legacy_riscv64:
761+
yaml += ' - *stable-legacy-riscv64\n'
762+
if legacy_loongarch:
763+
yaml += ' - *stable-legacy-loongarch\n'
764+
if legacy_headless:
765+
yaml += ' - *stable-legacy-headless\n'
710766

711767
yaml += """
712768
# Ubuntu stable minimal
@@ -741,6 +797,16 @@ def generate_stable_yaml(conf_wip_boards, manual_content=""):
741797
yaml += ' - *stable-vendor-loongarch\n'
742798
if vendor_headless:
743799
yaml += ' - *stable-vendor-headless\n'
800+
if legacy_fast:
801+
yaml += ' - *stable-legacy-fast-hdmi\n'
802+
if legacy_slow:
803+
yaml += ' - *stable-legacy-slow-hdmi\n'
804+
if legacy_riscv64:
805+
yaml += ' - *stable-legacy-riscv64\n'
806+
if legacy_loongarch:
807+
yaml += ' - *stable-legacy-loongarch\n'
808+
if legacy_headless:
809+
yaml += ' - *stable-legacy-headless\n'
744810

745811
# Ubuntu stable XFCE desktop (slow HDMI only)
746812
if current_slow:
@@ -1079,11 +1145,17 @@ def generate_community_yaml(csc_tvb_boards, manual_content=""):
10791145
current_riscv64 = [b for b in csc_tvb_boards if b['branch'] == 'current' and b['is_fast'] == 'riscv64']
10801146
current_loongarch = [b for b in csc_tvb_boards if b['branch'] == 'current' and b['is_fast'] == 'loongarch']
10811147

1082-
vendor_fast = [b for b in csc_tvb_boards if b['branch'] in ('vendor', 'legacy') and b['is_fast'] is True]
1083-
vendor_slow = [b for b in csc_tvb_boards if b['branch'] in ('vendor', 'legacy') and b['is_fast'] is False]
1084-
vendor_headless = [b for b in csc_tvb_boards if b['branch'] in ('vendor', 'legacy') and b['is_fast'] is None]
1085-
vendor_riscv64 = [b for b in csc_tvb_boards if b['branch'] in ('vendor', 'legacy') and b['is_fast'] == 'riscv64']
1086-
vendor_loongarch = [b for b in csc_tvb_boards if b['branch'] in ('vendor', 'legacy') and b['is_fast'] == 'loongarch']
1148+
vendor_fast = [b for b in csc_tvb_boards if b['branch'] == 'vendor' and b['is_fast'] is True]
1149+
vendor_slow = [b for b in csc_tvb_boards if b['branch'] == 'vendor' and b['is_fast'] is False]
1150+
vendor_headless = [b for b in csc_tvb_boards if b['branch'] == 'vendor' and b['is_fast'] is None]
1151+
vendor_riscv64 = [b for b in csc_tvb_boards if b['branch'] == 'vendor' and b['is_fast'] == 'riscv64']
1152+
vendor_loongarch = [b for b in csc_tvb_boards if b['branch'] == 'vendor' and b['is_fast'] == 'loongarch']
1153+
1154+
legacy_fast = [b for b in csc_tvb_boards if b['branch'] == 'legacy' and b['is_fast'] is True]
1155+
legacy_slow = [b for b in csc_tvb_boards if b['branch'] == 'legacy' and b['is_fast'] is False]
1156+
legacy_headless = [b for b in csc_tvb_boards if b['branch'] == 'legacy' and b['is_fast'] is None]
1157+
legacy_riscv64 = [b for b in csc_tvb_boards if b['branch'] == 'legacy' and b['is_fast'] == 'riscv64']
1158+
legacy_loongarch = [b for b in csc_tvb_boards if b['branch'] == 'legacy' and b['is_fast'] == 'loongarch']
10871159

10881160
# Build set of boards that have current branch (to exclude from edge)
10891161
current_boards = {b['board'] for b in csc_tvb_boards if b['branch'] == 'current'}

0 commit comments

Comments
 (0)