From 3e4acba4b6fc6b8acdf326ee7c8f29ae75af804b Mon Sep 17 00:00:00 2001 From: Hector Martin Date: Tue, 6 Jun 2023 16:46:38 +0900 Subject: [PATCH] asahi_firmware: Copy ASMedia firmware for u-boot Signed-off-by: Hector Martin --- asahi_firmware/core.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/asahi_firmware/core.py b/asahi_firmware/core.py index a5e1579..3a5e5c9 100644 --- a/asahi_firmware/core.py +++ b/asahi_firmware/core.py @@ -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 @@ -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)