This repository has been archived by the owner on Jan 25, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
sort-ucms.py
38 lines (34 loc) · 2.06 KB
/
sort-ucms.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/usr/bin/env python3
import os
from functions import *
if __name__ == "__main__":
# Set verbose in functions.py
set_verbose(True)
# Loop through overlays
for file in os.listdir("board-overlays"):
if "overlay" in file:
overlay = file.replace("overlay-", "") # pure overlay name
try:
for board in os.listdir(
f"board-overlays/overlay-{overlay}/chromeos-base/chromeos-bsp-{overlay}/files/"):
if "audio-config" in board:
print(f"Found legacy audio config for {board}")
mkdir(f"upstream/{overlay}", create_parents=True)
cpdir(f"board-overlays/overlay-{overlay}/chromeos-base/chromeos-bsp-{overlay}/files/audio-"
f"config/ucm-config", f"upstream/{overlay}")
elif os.path.isdir(
f"board-overlays/overlay-{overlay}/chromeos-base/chromeos-bsp-{overlay}/files/{board}"
f"/audio-5_4/ucm-config"):
print(f"Found 5.4 audio config for {board}")
mkdir(f"upstream/{overlay}/{board}", create_parents=True)
cpdir(
f"board-overlays/overlay-{overlay}/chromeos-base/chromeos-bsp-{overlay}/files/{board}"
f"/audio-5_4/ucm-config", f"upstream/{overlay}/{board}")
elif os.path.isdir(f"board-overlays/overlay-{overlay}/chromeos-base/chromeos-bsp-{overlay}/files/"
f"{board}/audio/ucm-config"):
print(f"Found normal audio config for {board}")
mkdir(f"upstream/{overlay}/{board}", create_parents=True)
cpdir(f"board-overlays/overlay-{overlay}/chromeos-base/chromeos-bsp-{overlay}/files/{board}"
f"/audio/ucm-config", f"upstream/{overlay}/{board}")
except FileNotFoundError:
print(f"Didnt find 'files' in {overlay}, skipping")