Skip to content

Commit 1dd9e65

Browse files
committed
Move src/firmware -> asahi_firmware
Prepare for this to be a Python package that can be installed stand-alone Signed-off-by: Hector Martin <[email protected]>
1 parent e05a450 commit 1dd9e65

10 files changed

Lines changed: 12 additions & 9 deletions

File tree

asahi_firmware/__init__.py

Whitespace-only changes.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import logging, os, os.path, re, sys
33
from collections import namedtuple, defaultdict
44

5-
from . import FWFile
5+
from .core import FWFile
66

77
BluetoothChip = namedtuple(
88
"BluetoothChip", ("chip", "stepping", "board_type", "vendor")
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# SPDX-License-Identifier: MIT
2-
import tarfile, io, os, logging
2+
import tarfile, io, logging
33
from hashlib import sha256
44

55
class FWFile(object):
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# SPDX-License-Identifier: MIT
22
import sys, os, os.path, pprint, statistics, logging
33

4-
from . import FWFile
4+
from .core import FWFile
55

66
class FWNode(object):
77
def __init__(self, this=None, leaves=None):

build.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ make -C "$M1N1" RELEASE=1 CHAINLOADING=1 -j4
5050
echo "Copying files..."
5151

5252
cp -r "$SRC"/* "$PACKAGE/"
53+
cp -r asahi_firmware "$PACKAGE/"
5354
cp "$ARTWORK/logos/icns/AsahiLinux_logomark.icns" "$PACKAGE/logo.icns"
5455
mkdir -p "$PACKAGE/boot"
5556
cp "$M1N1/build/m1n1.bin" "$PACKAGE/boot"

src/asahi_firmware

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../asahi_firmware

src/main.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import os, os.path, shlex, subprocess, sys, time, termios, json, getpass
44
from dataclasses import dataclass
55

6-
import system, osenum, stub, diskutil, osinstall, firmware
6+
import system, osenum, stub, diskutil, osinstall, asahi_firmware
77
from util import *
88

99
PART_ALIGN = psize("1MiB")
@@ -297,7 +297,7 @@ def do_install(self, total_size=None):
297297

298298
pkg = None
299299
if self.osins.needs_firmware:
300-
pkg = firmware.FWPackage("firmware.tar")
300+
pkg = asahi_firmware.core.FWPackage("firmware.tar")
301301
self.ins.collect_firmware(pkg)
302302
pkg.close()
303303
self.osins.firmware_package = pkg

src/osinstall.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# SPDX-License-Identifier: MIT
2-
import os, shutil, sys, stat, subprocess, urlcache, zipfile, logging, firmware
2+
import os, shutil, sys, stat, subprocess, urlcache, zipfile, logging
33

44
from util import *
55

src/stub.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# SPDX-License-Identifier: MIT
22
import os, os.path, plistlib, shutil, sys, stat, subprocess, urlcache, zipfile, logging, json
3-
import osenum, firmware.wifi, firmware.bluetooth
3+
import osenum, asahi_firmware.wifi, asahi_firmware.bluetooth
44
from util import *
55

66
class StubInstaller(PackageInstaller):
@@ -322,10 +322,10 @@ def collect_firmware(self, pkg):
322322
subprocess.run(["hdiutil", "attach", "-quiet", "-readonly", "-mountpoint", "recovery", img],
323323
check=True)
324324
logging.info("Collecting WiFi firmware")
325-
col = firmware.wifi.WiFiFWCollection("recovery/usr/share/firmware/wifi/")
325+
col = asahi_firmware.wifi.WiFiFWCollection("recovery/usr/share/firmware/wifi/")
326326
pkg.add_files(sorted(col.files()))
327327
logging.info("Collecting Bluetooth firmware")
328-
col = firmware.bluetooth.BluetoothFWCollection("recovery/usr/share/firmware/bluetooth/")
328+
col = asahi_firmware.bluetooth.BluetoothFWCollection("recovery/usr/share/firmware/bluetooth/")
329329
pkg.add_files(sorted(col.files()))
330330
logging.info("Making fallback firmware archive")
331331
subprocess.run(["tar", "czf", "all_firmware.tar.gz",

test.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ git describe --tags --always --dirty > /tmp/asahi-install/version.tag
2020

2121
cd /tmp/asahi-install
2222
ln -sf "$base/src"/* .
23+
ln -sf "$base/asahi_firmware" .
2324
mkdir -p boot
2425
ln -sf "$base/m1n1/build/m1n1.bin" boot/m1n1.bin
2526
ln -sf "$base/artwork/logos/icns/AsahiLinux_logomark.icns" logo.icns

0 commit comments

Comments
 (0)