Skip to content

Commit 32cd434

Browse files
committed
apple/t2: sync patches
also made the update script use threading for speed
1 parent ecaa2d9 commit 32cd434

File tree

4 files changed

+43
-21
lines changed

4 files changed

+43
-21
lines changed

apple/t2/pkgs/linux-t2/latest.json

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"base_url": "https://raw.githubusercontent.com/t2linux/linux-t2-patches/4109f2144b626097a34b21def849a5d8cbcf3f7c/",
2+
"base_url": "https://raw.githubusercontent.com/t2linux/linux-t2-patches/60a2912ad2d05f8a2d6c68a94641d912c3a555fd/",
33
"patches": [
44
{
55
"name": "1001-Add-apple-bce-driver.patch",
@@ -43,11 +43,11 @@
4343
},
4444
{
4545
"name": "1015-drm-tiny-add-driver-for-Apple-Touch-Bars-in-x86-Macs.patch",
46-
"hash": "sha256-zFeDJeoM/XS+Ds3DBLEcv4JbUhlEk9z4rHQ4t6XaghA="
46+
"hash": "sha256-Ga0LlaS1jWTXSKh1ClcETPJctAymC6jYBQK9wwDU4Xs="
4747
},
4848
{
4949
"name": "2008-i915-4-lane-quirk-for-mbp15-1.patch",
50-
"hash": "sha256-f/PTDwRGEyVkGHFyypTKi+gIni3R4TmcsOneGc7Ay5A="
50+
"hash": "sha256-Ui9tK4IGSWfEscmD92emX/NfulO0m8zwLc9ivIClCFQ="
5151
},
5252
{
5353
"name": "2009-apple-gmux-allow-switching-to-igpu-at-probe.patch",
@@ -91,27 +91,35 @@
9191
},
9292
{
9393
"name": "4001-asahi-trackpad.patch",
94-
"hash": "sha256-NOuGgUxDQEfFPlij/EnhWmgqeG3/l+j+r2T1YJG7raY="
94+
"hash": "sha256-yfkTKKokb/+JtTwE0Dzht14S0nrSIwLFAFND90P/Cis="
9595
},
9696
{
9797
"name": "4002-HID-quirks-remove-T2-devices-from-hid_mouse_ignore_l.patch",
98-
"hash": "sha256-DdUo4/4254VD+MzEaLI3opSS0Z7+UwsitJaS2lAlpI8="
98+
"hash": "sha256-0PMCE3IWHekir5YV1BD6Jakc7dOV6Fj2HfIGWZnXZV0="
9999
},
100100
{
101101
"name": "4003-HID-apple-ignore-the-trackpad-on-T2-Macs.patch",
102-
"hash": "sha256-PZpdvPKvVsLsg3vx3jmq3QCapBUcUVE35N37usBRb6g="
102+
"hash": "sha256-JTeYtaBqMyTu5IdGb8x7wbP9ZE1rXT4lpEjudR1ySFI="
103103
},
104104
{
105105
"name": "4004-HID-magicmouse-Add-support-for-trackpads-found-on-T2.patch",
106-
"hash": "sha256-pmGR0JdMMwGWG3zwMwMBuSyzltLvvzjTgfi1Ii1cglk="
106+
"hash": "sha256-HcPX7gY3hnlwM/tY06pbtXnch04AqwHgC596E8ZqGY8="
107+
},
108+
{
109+
"name": "4005-HID-apple-Add-necessary-IDs-and-support-for-replacem.patch",
110+
"hash": "sha256-SRKESCbpxSYm7U0VyCmvkmT/er6/GEHhwo8tgJDO6mQ="
111+
},
112+
{
113+
"name": "4006-HID-magicmouse-Add-MacBookPro15-1-replacement-trackp.patch",
114+
"hash": "sha256-uAlT/4ADwYyKvbuPQaGwqCjZ2/myruC63etVV6cfFLk="
107115
},
108116
{
109117
"name": "7001-drm-i915-fbdev-Discard-BIOS-framebuffers-exceeding-h.patch",
110118
"hash": "sha256-O6RHFxmKZn7aCq1D+r5z2T3jLt0r5+01EABD9rs0E5M="
111119
},
112120
{
113121
"name": "8001-Add-APFS-driver.patch",
114-
"hash": "sha256-T0ZmO99nmnpNVLjlzMRc7wrkBON7w2F6HaPk4pQVV7A="
122+
"hash": "sha256-py4DNKBsUWvw6o730ApmNdUlSyabOFnFDoAPrF40DNE="
115123
},
116124
{
117125
"name": "8002-Necessary-modifications-to-build-APFS-with-the-kerne.patch",

apple/t2/pkgs/linux-t2/latest.nix

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
{ callPackage, linux_6_13, ... }@args:
1+
{ callPackage, linux_6_14, ... }@args:
22

33
callPackage ./generic.nix args {
4-
kernel = linux_6_13;
4+
kernel = linux_6_14;
55
patchesFile = ./latest.json;
66
}

apple/t2/pkgs/linux-t2/stable.json

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"base_url": "https://raw.githubusercontent.com/t2linux/linux-t2-patches/dd2e78d234fc289d3ebadf1852d761498e668a02/",
2+
"base_url": "https://raw.githubusercontent.com/t2linux/linux-t2-patches/0543a832ecf1400798e8aef6727110ec21c3484a/",
33
"patches": [
44
{
55
"name": "1001-Add-apple-bce-driver.patch",
@@ -95,23 +95,31 @@
9595
},
9696
{
9797
"name": "4002-HID-quirks-remove-T2-devices-from-hid_mouse_ignore_l.patch",
98-
"hash": "sha256-DdUo4/4254VD+MzEaLI3opSS0Z7+UwsitJaS2lAlpI8="
98+
"hash": "sha256-0PMCE3IWHekir5YV1BD6Jakc7dOV6Fj2HfIGWZnXZV0="
9999
},
100100
{
101101
"name": "4003-HID-apple-ignore-the-trackpad-on-T2-Macs.patch",
102-
"hash": "sha256-PZpdvPKvVsLsg3vx3jmq3QCapBUcUVE35N37usBRb6g="
102+
"hash": "sha256-JTeYtaBqMyTu5IdGb8x7wbP9ZE1rXT4lpEjudR1ySFI="
103103
},
104104
{
105105
"name": "4004-HID-magicmouse-Add-support-for-trackpads-found-on-T2.patch",
106-
"hash": "sha256-pmGR0JdMMwGWG3zwMwMBuSyzltLvvzjTgfi1Ii1cglk="
106+
"hash": "sha256-HcPX7gY3hnlwM/tY06pbtXnch04AqwHgC596E8ZqGY8="
107+
},
108+
{
109+
"name": "4005-HID-apple-Add-necessary-IDs-and-support-for-replacem.patch",
110+
"hash": "sha256-SRKESCbpxSYm7U0VyCmvkmT/er6/GEHhwo8tgJDO6mQ="
111+
},
112+
{
113+
"name": "4006-HID-magicmouse-Add-MacBookPro15-1-replacement-trackp.patch",
114+
"hash": "sha256-uAlT/4ADwYyKvbuPQaGwqCjZ2/myruC63etVV6cfFLk="
107115
},
108116
{
109117
"name": "7001-drm-i915-fbdev-Discard-BIOS-framebuffers-exceeding-h.patch",
110118
"hash": "sha256-O6RHFxmKZn7aCq1D+r5z2T3jLt0r5+01EABD9rs0E5M="
111119
},
112120
{
113121
"name": "8001-Add-APFS-driver.patch",
114-
"hash": "sha256-xjB7lqE4bweUvDa6Tx6LurxWlUlX4nUN+DbTRQb5bQI="
122+
"hash": "sha256-1VHKrO2haBqXDCef2xt2fHfCCPv2q/AhFmmM4Xxu24E="
115123
},
116124
{
117125
"name": "8002-Necessary-modifications-to-build-APFS-with-the-kerne.patch",

apple/t2/pkgs/linux-t2/update-patches.py

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import subprocess
88
import sys
99
from tempfile import NamedTemporaryFile
10+
from concurrent.futures import ThreadPoolExecutor, as_completed
1011

1112
import requests
1213

@@ -50,6 +51,11 @@ def get_sri_hash(data: bytes):
5051
)
5152
return proc.stdout.decode("utf8").strip()
5253

54+
def download_task(patch: dict):
55+
patch_content = requests.get(patch["download_url"])
56+
patch_hash = get_sri_hash(patch_content.content)
57+
print(f"{patch['name']}: {patch_hash}")
58+
return {"name": patch["name"], "hash": patch_hash}
5359

5460
def main():
5561
args = parser.parse_args()
@@ -73,13 +79,13 @@ def main():
7379
patches = filter(lambda e: PATCH_PATTERN.match(e.get("name")), contents)
7480

7581
patches_with_hash = []
76-
for patch in patches:
77-
patch_content = requests.get(patch["download_url"])
78-
patch_hash = get_sri_hash(patch_content.content)
79-
print(f"{patch['name']}: {patch_hash}")
80-
patches_with_hash.append({"name": patch["name"], "hash": patch_hash})
82+
with ThreadPoolExecutor() as executor:
83+
futures = {executor.submit(download_task, patch) for patch in patches}
8184

82-
result = {"base_url": base_url, "patches": patches_with_hash}
85+
for future in as_completed(futures):
86+
patches_with_hash.append(future.result())
87+
88+
result = {"base_url": base_url, "patches": sorted(patches_with_hash, key=lambda p: p["name"])}
8389

8490
with open(args.filename, "w+") as f:
8591
json.dump(result, f, indent=2)

0 commit comments

Comments
 (0)