Skip to content

Commit 23e204c

Browse files
committed
asahi_firmware: Copy ASMedia firmware for u-boot
Signed-off-by: Hector Martin <[email protected]>
1 parent ee57452 commit 23e204c

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

asahi_firmware/core.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@
33
from hashlib import sha256
44
from . import cpio
55

6+
UBOOT_FILES = set([
7+
"asmedia/asm2214a-apple.bin"
8+
])
9+
610
class FWFile(object):
711
def __init__(self, name, data):
812
self.name = name
@@ -76,6 +80,12 @@ def add_file(self, name, data):
7680
ti.linkname = os.path.join("vendorfw", ti.linkname)
7781
self.cpiofile.addfile(ti, fd)
7882

83+
if name in UBOOT_FILES:
84+
path = os.path.join(self.path, "u-boot", name)
85+
os.makedirs(os.path.dirname(path), exist_ok=True)
86+
with open(path, "wb") as fd:
87+
fd.write(data.data)
88+
7989
def add_files(self, it):
8090
for name, data in it:
8191
self.add_file(name, data)

0 commit comments

Comments
 (0)