Skip to content

Commit 8365712

Browse files
committed
Add edge branch support to community targets
Fix corner case where community boards that only have the edge kernel (e.g., radxa-cubie-a5e) were not being included in the generated YAML. Changes: - Add edge branch categorization (fast/slow/headless/riscv64/loongarch) - Add edge branch YAML anchor sections - Include edge branch in all target items lists - Filter edge boards to exclude those that also have current branch (prefer current over edge when both are available) Signed-off-by: Igor Pecovnik <igor@armbian.com>
1 parent 8bf75df commit 8365712

1 file changed

Lines changed: 67 additions & 3 deletions

File tree

scripts/generate_targets.py

Lines changed: 67 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -907,6 +907,16 @@ def generate_community_yaml(csc_tvb_boards, manual_content=""):
907907
vendor_riscv64 = [b for b in csc_tvb_boards if b['branch'] == 'vendor' and b['is_fast'] == 'riscv64']
908908
vendor_loongarch = [b for b in csc_tvb_boards if b['branch'] == 'vendor' and b['is_fast'] == 'loongarch']
909909

910+
# Build set of boards that have current branch (to exclude from edge)
911+
current_boards = {b['board'] for b in csc_tvb_boards if b['branch'] == 'current'}
912+
913+
# Only include edge boards for boards that don't have current branch
914+
edge_fast = [b for b in csc_tvb_boards if b['branch'] == 'edge' and b['is_fast'] is True and b['board'] not in current_boards]
915+
edge_slow = [b for b in csc_tvb_boards if b['branch'] == 'edge' and b['is_fast'] is False and b['board'] not in current_boards]
916+
edge_headless = [b for b in csc_tvb_boards if b['branch'] == 'edge' and b['is_fast'] is None and b['board'] not in current_boards]
917+
edge_riscv64 = [b for b in csc_tvb_boards if b['branch'] == 'edge' and b['is_fast'] == 'riscv64' and b['board'] not in current_boards]
918+
edge_loongarch = [b for b in csc_tvb_boards if b['branch'] == 'edge' and b['is_fast'] == 'loongarch' and b['board'] not in current_boards]
919+
910920
yaml += """# Community builds - fast HDMI (current branch)
911921
community-current-fast-hdmi: &community-current-fast-hdmi
912922
# auto generated section
@@ -980,6 +990,42 @@ def generate_community_yaml(csc_tvb_boards, manual_content=""):
980990
yaml += format_board_item(board_data, include_extensions=True) + '\n'
981991
yaml += ' # end of auto generated section\n\n'
982992

993+
# Edge branch lists
994+
if edge_fast:
995+
yaml += ' community-edge-fast-hdmi: &community-edge-fast-hdmi\n'
996+
yaml += ' # auto generated section\n'
997+
for board_data in sorted(edge_fast, key=lambda x: x['board']):
998+
yaml += format_board_item(board_data, include_extensions=True) + '\n'
999+
yaml += ' # end of auto generated section\n\n'
1000+
1001+
if edge_slow:
1002+
yaml += ' community-edge-slow-hdmi: &community-edge-slow-hdmi\n'
1003+
yaml += ' # auto generated section\n'
1004+
for board_data in sorted(edge_slow, key=lambda x: x['board']):
1005+
yaml += format_board_item(board_data, include_extensions=True) + '\n'
1006+
yaml += ' # end of auto generated section\n\n'
1007+
1008+
if edge_headless:
1009+
yaml += ' community-edge-headless: &community-edge-headless\n'
1010+
yaml += ' # auto generated section\n'
1011+
for board_data in sorted(edge_headless, key=lambda x: x['board']):
1012+
yaml += format_board_item(board_data, include_extensions=True) + '\n'
1013+
yaml += ' # end of auto generated section\n\n'
1014+
1015+
if edge_riscv64:
1016+
yaml += ' community-edge-riscv64: &community-edge-riscv64\n'
1017+
yaml += ' # auto generated section\n'
1018+
for board_data in sorted(edge_riscv64, key=lambda x: x['board']):
1019+
yaml += format_board_item(board_data, include_extensions=True) + '\n'
1020+
yaml += ' # end of auto generated section\n\n'
1021+
1022+
if edge_loongarch:
1023+
yaml += ' community-edge-loongarch: &community-edge-loongarch\n'
1024+
yaml += ' # auto generated section\n'
1025+
for board_data in sorted(edge_loongarch, key=lambda x: x['board']):
1026+
yaml += format_board_item(board_data, include_extensions=True) + '\n'
1027+
yaml += ' # end of auto generated section\n\n'
1028+
9831029
yaml += """# automated lists stop
9841030
9851031
targets:
@@ -1016,6 +1062,16 @@ def generate_community_yaml(csc_tvb_boards, manual_content=""):
10161062
yaml += ' - *community-vendor-riscv64\n'
10171063
if vendor_loongarch:
10181064
yaml += ' - *community-vendor-loongarch\n'
1065+
if edge_fast:
1066+
yaml += ' - *community-edge-fast-hdmi\n'
1067+
if edge_slow:
1068+
yaml += ' - *community-edge-slow-hdmi\n'
1069+
if edge_headless:
1070+
yaml += ' - *community-edge-headless\n'
1071+
if edge_riscv64:
1072+
yaml += ' - *community-edge-riscv64\n'
1073+
if edge_loongarch:
1074+
yaml += ' - *community-edge-loongarch\n'
10191075

10201076
yaml += """
10211077
# Ubuntu noble GNOME desktop for fast HDMI community boards
@@ -1037,9 +1093,11 @@ def generate_community_yaml(csc_tvb_boards, manual_content=""):
10371093
"""
10381094
if vendor_fast:
10391095
yaml += ' - *community-vendor-fast-hdmi\n'
1096+
if edge_fast:
1097+
yaml += ' - *community-edge-fast-hdmi\n'
10401098

10411099
# Ubuntu noble XFCE desktop for slow HDMI community boards
1042-
if current_slow or vendor_slow:
1100+
if current_slow or vendor_slow or edge_slow:
10431101
yaml += """
10441102
# Ubuntu noble XFCE desktop for slow HDMI community boards
10451103
community-noble-xfce:
@@ -1061,9 +1119,11 @@ def generate_community_yaml(csc_tvb_boards, manual_content=""):
10611119
yaml += ' - *community-current-slow-hdmi\n'
10621120
if vendor_slow:
10631121
yaml += ' - *community-vendor-slow-hdmi\n'
1122+
if edge_slow:
1123+
yaml += ' - *community-edge-slow-hdmi\n'
10641124

10651125
# Ubuntu noble XFCE desktop for RISC-V community boards
1066-
if current_riscv64 or vendor_riscv64:
1126+
if current_riscv64 or vendor_riscv64 or edge_riscv64:
10671127
yaml += """
10681128
# Ubuntu noble XFCE desktop for RISC-V community boards
10691129
community-noble-riscv64-xfce:
@@ -1085,9 +1145,11 @@ def generate_community_yaml(csc_tvb_boards, manual_content=""):
10851145
yaml += ' - *community-current-riscv64\n'
10861146
if vendor_riscv64:
10871147
yaml += ' - *community-vendor-riscv64\n'
1148+
if edge_riscv64:
1149+
yaml += ' - *community-edge-riscv64\n'
10881150

10891151
# Ubuntu noble minimal CLI for headless community boards
1090-
if current_headless or vendor_headless:
1152+
if current_headless or vendor_headless or edge_headless:
10911153
yaml += """
10921154
# Ubuntu noble minimal CLI for headless community boards
10931155
community-noble-minimal:
@@ -1106,6 +1168,8 @@ def generate_community_yaml(csc_tvb_boards, manual_content=""):
11061168
yaml += ' - *community-current-headless\n'
11071169
if vendor_headless:
11081170
yaml += ' - *community-vendor-headless\n'
1171+
if edge_headless:
1172+
yaml += ' - *community-edge-headless\n'
11091173

11101174
# Note: loongarch boards don't get noble images, only bookworm minimal
11111175

0 commit comments

Comments
 (0)