Add sku list script

Generate a list of each skuid for a specific UCM config of a variant of
a board. Code is messy but it gets the job done.
WeirdTreeThing 2023-08-22 21:27:29 -04:00
parent 9b92bd98a8
commit ae18d8c46d
No known key found for this signature in database
GPG Key ID: 1F56A4B52998B851
1 changed files with 30 additions and 0 deletions

30 Executable file
View File

@ -0,0 +1,30 @@
#!/usr/bin/env python3
import os
import sys
import json
variant = ""
ucm_suffixes = []
sku_ids = {}
with open("project-config.json", "r") as project:
p_json = json.load(project)
configs = p_json['chromeos']['configs']
for config in configs:
if config['audio']['main']['cras-config-dir'] == variant:
if not config['audio']['main']['ucm-suffix'] in ucm_suffixes:
sku_ids[config['audio']['main']['ucm-suffix']] = []
for suffix in sku_ids:
suffixes_formatted = ""
for sku in sku_ids[suffix]:
if suffixes_formatted == "":
suffixes_formatted = str(sku)
suffixes_formatted = f"{suffixes_formatted}|{str(sku)}"
print(f"{suffix}: {suffixes_formatted}")