Skip to content

Commit

Permalink
asahi_firmware: Copy ASMedia firmware for u-boot
Browse files Browse the repository at this point in the history
Signed-off-by: Hector Martin <marcan@marcan.st>
  • Loading branch information
marcan committed Jun 6, 2023
1 parent 43042d8 commit 3e4acba
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions asahi_firmware/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
from hashlib import sha256
from . import cpio

UBOOT_FILES = set([
"asmedia/asm2214a-apple.bin"
])

class FWFile(object):
def __init__(self, name, data):
self.name = name
Expand Down Expand Up @@ -76,6 +80,12 @@ def add_file(self, name, data):
ti.linkname = os.path.join("vendorfw", ti.linkname)
self.cpiofile.addfile(ti, fd)

if name in UBOOT_FILES:
path = os.path.join(self.path, "u-boot", name)
os.makedirs(os.path.dirname(path), exist_ok=True)
with open(path, "wb") as fd:
fd.write(data.data)

def add_files(self, it):
for name, data in it:
self.add_file(name, data)
Expand Down

0 comments on commit 3e4acba

Please sign in to comment.