Skip to content

Commit 492d7e5

Browse files
authored
Merge pull request #19 from seankd3/t3/drop-static-dsdt
Keep the firmware DSDT to avoid stale GNVS addresses
2 parents 725000c + 3809bed commit 492d7e5

9 files changed

Lines changed: 116 additions & 87 deletions

File tree

‎README.md‎

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ Confirm replacement of `power-profiles-daemon` if Pacman prompts for it. The Oma
122122
## 3. Generate the ACPI overrides
123123

124124
The [ACPI builder and battery-method transformations](https://github.com/pfeifferj/archlinuxarm-proart-p16/tree/3484cc008a9ee00b34c086c729e28e935cbc3430/01-platform/acpi/payload/provenance/hardware)
125-
come from Josephine Pfeiffer's repository. Their source is retained unchanged;
125+
come from Josephine Pfeiffer's repository. Their source is adapted here;
126126
this repository adds the Omarchy build/install wrappers and kernel-specific
127127
initramfs integration. See [the retained MIT license](acpi/LICENSE).
128128

@@ -133,17 +133,25 @@ sudo ./scripts/dump-acpi.sh
133133
python3 scripts/build-acpi.py
134134
```
135135

136-
The build uses the included ACPICA **20260408** source and checks the original tables and both generated overrides against pinned SHA-256 hashes. It rejects other firmware tables and tables that have already been patched. The dump script creates the parent `build/` directory with ownership assigned to the user who will compile the sources. It refuses to overwrite an existing `build/firmware/` directory.
136+
The build uses the included ACPICA **20260408** source and checks the original tables and the generated ASUS SSDT override against pinned SHA-256 hashes. It rejects other firmware tables and tables that have already been patched. The dump script creates the parent `build/` directory with ownership assigned to the user who will compile the sources. It refuses to overwrite an existing `build/firmware/` directory.
137+
138+
If you generated ACPI files with an older version, retain `build/firmware/` and move the old output aside before rebuilding:
139+
140+
```bash
141+
mv -T --no-clobber build/acpi build/acpi-before-native-dsdt
142+
python3 scripts/build-acpi.py
143+
```
144+
145+
If the backup directory already exists, choose another unused name. The builder refuses to replace different existing output bytes.
137146

138147
Outputs:
139148

140149
```text
141-
build/acpi/kernel/firmware/acpi/DSDT.aml
142150
build/acpi/kernel/firmware/acpi/SSDT.aml
143151
build/acpi/manifest.json
144152
```
145153

146-
The DSDT corrects SSPM enumeration; the SSDT corrects EC and battery methods. The kernel includes the ARM64 allocation fix required for these overrides. Load the tables through the included initramfs hook for the P16 kernel. This does not flash the BIOS.
154+
The SSDT corrects EC and battery methods. The existing `acpi_osi="!Windows 2022"` boot option enables SSPM. Keep the native DSDT: its firmware-data address can move between boots on the same BIOS. A copied DSDT can then hide CPU devices and prevent CPU frequency controls from loading. The initramfs hook includes only the ASUS SSDT. This does not flash the BIOS.
147155

148156
## 4. Build the P16 kernel
149157

@@ -459,7 +467,7 @@ They identify the inputs used here, independently of later upstream changes.
459467

460468
| Component | Source and treatment in this repository |
461469
|---|---|
462-
| ACPI builder and battery transformations | [Pfeiffer's ACPI sources](https://github.com/pfeifferj/archlinuxarm-proart-p16/tree/3484cc008a9ee00b34c086c729e28e935cbc3430/01-platform/acpi/payload/provenance/hardware): `acpi_builder.py`, `power-method-changes.json`, `power-source.sed` and `power-splice.json` are byte-identical copies under `acpi/`. Our scripts wrap them for local firmware dumps, builds and Omarchy installation. |
470+
| ACPI builder and battery transformations | [Pfeiffer's ACPI sources](https://github.com/pfeifferj/archlinuxarm-proart-p16/tree/3484cc008a9ee00b34c086c729e28e935cbc3430/01-platform/acpi/payload/provenance/hardware): `power-method-changes.json`, `power-source.sed` and `power-splice.json` are byte-identical copies under `acpi/`. We adapted `acpi_builder.py` to retain the native DSDT. Our scripts wrap it for local firmware dumps, builds and Omarchy installation. |
463471
| ARM64 ACPI allocation fix | [Source patch](https://github.com/pfeifferj/archlinuxarm-proart-p16/blob/3484cc008a9ee00b34c086c729e28e935cbc3430/01-platform/kernel/patches/provenance/hardware/backports/acpi/0001-arm64-bound-acpi-override-allocation.patch): copied unchanged as [kernel/arm64-acpi-allocation.patch](kernel/arm64-acpi-allocation.patch), integrated into the Omarchy kernel recipe. |
464472
| Touchpad pressure workaround | [Source quirk](https://github.com/pfeifferj/archlinuxarm-proart-p16/blob/3484cc008a9ee00b34c086c729e28e935cbc3430/03-system/input-audio/payload/runtime/usr/share/libinput/60-h7607a-touchpad.quirks): same device IDs and pressure settings; local section name/DMI pattern and installation into `/etc/libinput/local-overrides.quirks` instead of a packaged `/usr/share/libinput/` file. |
465473
| Speaker firmware | [Source lock](https://github.com/pfeifferj/archlinuxarm-proart-p16/blob/3484cc008a9ee00b34c086c729e28e935cbc3430/07-build/media/payload/locks/hardware.json): extraction metadata for the three `spkid0` files is retained in [config/speaker-firmware.json](config/speaker-firmware.json). Firmware is downloaded from ASUS and extracted locally; no firmware binaries are redistributed. |

‎acpi/acpi_builder.py‎

Lines changed: 37 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"""Build the H7607BA.300 ACPI overrides from this P16's own firmware tables.
33
44
No firmware table, nor anything derived from one, is distributed. Dump the
5-
DSDT and SSDTs of your own P16 into a directory and pass it as --dump:
5+
ASUS SSDT of your own P16 into a directory and pass it as --dump:
66
77
UEFI: scripts/stage-acpi-dump.py stages the EDK2 Shell and a dump script on
88
a mounted FAT32 stick. Boot the P16 from it with Secure Boot disabled; the
@@ -11,17 +11,19 @@
1111
Linux booted without h7607a-acpi.cpio, such as another distribution's live
1212
system on this P16:
1313
mkdir DIR
14-
for table in /sys/firmware/acpi/tables/DSDT /sys/firmware/acpi/tables/SSDT*; do
14+
for table in /sys/firmware/acpi/tables/SSDT*; do
1515
sudo cat "$table" | tee "DIR/${table##*/}" > /dev/null
1616
done
1717
18-
The DSDT and the ASUS SSDT (OEM ID _ASUS_, table ID ASUSSSDT) must be those of
19-
firmware H7607BA.300. power-source.dsl is that SSDT disassembled by ACPICA iasl
20-
20260408 and edited by power-source.sed. SSPM changes only its _STA predicate,
21-
and six compiled ASUS methods are spliced into the original SSDT, since
22-
compiling the whole table would rewrite unrelated AML. The two tables, the ASL
23-
and the archive are written to their collection paths once every pinned hash
24-
matches.
18+
The ASUS SSDT (OEM ID _ASUS_, table ID ASUSSSDT) must be from firmware
19+
H7607BA.300. power-source.dsl is that table disassembled by ACPICA iasl
20+
20260408 and edited by power-source.sed. Six compiled ASUS methods are
21+
spliced into the original SSDT. The SSDT, ASL and archive are written only
22+
after every pinned hash matches.
23+
24+
The native DSDT stays in use. Its firmware-data addresses can change between
25+
boots even on the same BIOS. The required acpi_osi="!Windows 2022" boot option
26+
already enables SSPM without replacing that table.
2527
"""
2628
import argparse
2729
import hashlib
@@ -37,15 +39,12 @@
3739

3840
REPO = Path(__file__).resolve().parents[2]
3941
FIRMWARE = "H7607BA.300"
40-
DSDT_INPUT = "0b9ed92671568cf36bade16262d068d1a4f3c85634159de46ae00bf0f727a402"
4142
SSDT_INPUT = "46d9ed16af06093cdb849df69646683317d53d7342dfd38f24eab00795d396f0"
4243
ASL_INPUT = "cff6e8be5665686c95bd83b5e2d73ed0abbacddecc416e57dbd29f91a746472a"
43-
DSDT_OUTPUT = "80e0ad4a051704003d09029cb600a9814e1cd370ce774b9749dc09d2232b5aaf"
4444
SSDT_OUTPUT = "9b28ffc14c19f8b7ea2278de88ff9ec070f5f70401107d81fef067a916aa9695"
45-
ARCHIVE_OUTPUT = "311dc5b456f1b7a9728814cd8ca105370bdca8383facec141f23217f43eac51d"
45+
ARCHIVE_OUTPUT = "68420c5248a237b01267bf8713867f53358252d0d3935fb09c0e66b02c39153e"
4646
METHODS = ("RRA9", "RRA8", "WRA9", "WRA8", "RWEC", "GBST")
4747
ASUS_SSDT = b"_ASUS_ASUSSSDT"
48-
DSDT_PATH = "assets/hardware/uefi/n1x-dsdt-baseline.bin"
4948
SSDT_PATH = "assets/hardware/uefi/n1x-asus-ssdt-baseline.bin"
5049
ASL_PATH = "provenance/hardware/power-source.dsl"
5150
ARCHIVE_PATH = "assets/hardware/acpi/h7607a-acpi.cpio"
@@ -97,21 +96,6 @@ def encode_length(length, width):
9796
[(length >> (4 + i * 8)) & 255 for i in range(width - 1)])
9897

9998

100-
def patch_dsdt(original):
101-
exact(original, DSDT_INPUT, "Firmware DSDT")
102-
table(original, b"DSDT", b"NVDA\0\0ANGUS ", 4)
103-
start = 0x10269
104-
predicate = b"_OSI\x0dWindows 2022\0"
105-
require(original[start:start + len(predicate)] == predicate, "SSPM predicate changed")
106-
modified = bytearray(original)
107-
modified[start:start + len(predicate)] = b"\0" + b"\xa3" * (len(predicate) - 1)
108-
struct.pack_into("<I", modified, 24, 5)
109-
modified[9] = 0
110-
modified[9] = -sum(modified) % 256
111-
table(modified, b"DSDT", b"NVDA\0\0ANGUS ", 5)
112-
return exact(bytes(modified), DSDT_OUTPUT, "SSPM override")
113-
114-
11599
def compiled_method(compiled, name, digest):
116100
matches = []
117101
for offset in range(36, len(compiled) - 6):
@@ -173,23 +157,21 @@ def member(name, data, mode, inode):
173157
return entry + bytes(-len(entry) % 4)
174158

175159

176-
def archive(dsdt, ssdt):
177-
exact(dsdt, DSDT_OUTPUT, "SSPM override")
160+
def archive(ssdt):
178161
exact(ssdt, SSDT_OUTPUT, "ASUS power override")
179162
result = b"".join(member(name, b"", stat.S_IFDIR | 0o755, inode)
180163
for inode, name in enumerate(("kernel", "kernel/firmware", "kernel/firmware/acpi"), 1))
181-
result += member("kernel/firmware/acpi/DSDT.aml", dsdt, stat.S_IFREG | 0o644, 4)
182-
result += member("kernel/firmware/acpi/SSDT.aml", ssdt, stat.S_IFREG | 0o644, 5)
183-
result += member("TRAILER!!!", b"", 0, 6)
164+
result += member("kernel/firmware/acpi/SSDT.aml", ssdt, stat.S_IFREG | 0o644, 4)
165+
result += member("TRAILER!!!", b"", 0, 5)
184166
result += bytes(-len(result) % 512)
185167
return exact(result, ARCHIVE_OUTPUT, "Production ACPI archive")
186168

187169

188170
def dumped_tables(dump):
189-
"""Map b"DSDT" and b"SSDT" to {table: [file names]} for the DSDT and ASUS SSDT dumps in dump."""
171+
"""Map ASUS SSDT bytes to their dump file names."""
190172
dump = Path(dump)
191173
require(dump.is_dir(), f"{dump} is not a directory")
192-
found = {b"DSDT": {}, b"SSDT": {}}
174+
found = {b"SSDT": {}}
193175
for path in sorted(dump.iterdir()):
194176
if not path.is_file():
195177
continue
@@ -309,47 +291,36 @@ def pins(files):
309291
return {name: {"bytes": len(data), "sha256": sha(data)} for name, data in files.items()}
310292

311293

312-
def build(dump, *, repo=REPO, iasl="iasl", sspm_only=False):
294+
def build(dump, *, repo=REPO, iasl="iasl"):
313295
repo = Path(repo).resolve()
314296
found = dumped_tables(dump)
315-
dsdt_name, dsdt = dumped(found, b"DSDT", "DSDT", dump)
316-
firmware(dsdt_name, dsdt, DSDT_INPUT, DSDT_OUTPUT, "DSDT")
317-
overrides = {"DSDT.aml": patch_dsdt(dsdt)}
318-
files = {DSDT_PATH: dsdt}
319-
names = {"DSDT": dsdt_name}
320-
compiler = None
321-
if not sspm_only:
322-
ssdt_name, ssdt = dumped(found, b"SSDT", "ASUS SSDT (OEM ID _ASUS_, table ID ASUSSSDT)", dump)
323-
firmware(ssdt_name, ssdt, SSDT_INPUT, SSDT_OUTPUT, "ASUS SSDT")
324-
names["SSDT"] = ssdt_name
325-
source = repo / "provenance/hardware"
326-
methods = json.loads((source / "power-method-changes.json").read_text())
327-
require(tuple(row["method"] for row in methods) == METHODS, "Unexpected ASL method changes")
328-
with tempfile.TemporaryDirectory(prefix="h7607a-acpi-") as work:
329-
work = Path(work)
330-
iasl = check_iasl(iasl, work)
331-
asl = derive_asl(ssdt, (source / "power-source.sed").read_text(), iasl, work)
332-
(work / "power.dsl").write_bytes(asl)
333-
run_iasl(iasl, ["-p", "power", "power.dsl"], work)
334-
compiled = (work / "power.aml").read_bytes()
335-
compiler = "ACPICA iasl 20260408"
336-
overrides["SSDT.aml"] = splice_ssdt(ssdt, compiled, json.loads((source / "power-splice.json").read_text()))
337-
files.update({SSDT_PATH: ssdt, ASL_PATH: asl,
338-
ARCHIVE_PATH: archive(overrides["DSDT.aml"], overrides["SSDT.aml"])})
297+
ssdt_name, ssdt = dumped(found, b"SSDT", "ASUS SSDT (OEM ID _ASUS_, table ID ASUSSSDT)", dump)
298+
firmware(ssdt_name, ssdt, SSDT_INPUT, SSDT_OUTPUT, "ASUS SSDT")
299+
source = repo / "provenance/hardware"
300+
methods = json.loads((source / "power-method-changes.json").read_text())
301+
require(tuple(row["method"] for row in methods) == METHODS, "Unexpected ASL method changes")
302+
with tempfile.TemporaryDirectory(prefix="h7607a-acpi-") as work:
303+
work = Path(work)
304+
iasl = check_iasl(iasl, work)
305+
asl = derive_asl(ssdt, (source / "power-source.sed").read_text(), iasl, work)
306+
(work / "power.dsl").write_bytes(asl)
307+
run_iasl(iasl, ["-p", "power", "power.dsl"], work)
308+
compiled = (work / "power.aml").read_bytes()
309+
overrides = {"SSDT.aml": splice_ssdt(ssdt, compiled, json.loads((source / "power-splice.json").read_text()))}
310+
files = {SSDT_PATH: ssdt, ASL_PATH: asl, ARCHIVE_PATH: archive(overrides["SSDT.aml"])}
339311
written = publish(repo, files)
340-
return {"schema": 2, "firmware": FIRMWARE, "compiler": compiler, "dump": names,
312+
return {"schema": 2, "firmware": FIRMWARE, "compiler": "ACPICA iasl 20260408", "dump": {"SSDT": ssdt_name},
341313
"overrides": pins(overrides), "outputs": pins(files), "written": written}
342314

343315

344-
def cli(*, sspm_only=False):
316+
def cli():
345317
parser = argparse.ArgumentParser(description=__doc__, formatter_class=argparse.RawDescriptionHelpFormatter)
346318
parser.add_argument("--dump", required=True, type=Path, metavar="DIR",
347-
help="Directory holding this P16's DSDT and SSDT dumps")
348-
if not sspm_only:
349-
parser.add_argument("--iasl", default="iasl", help="ACPICA iasl 20260408 executable")
319+
help="Directory holding this P16's original ASUS SSDT dump")
320+
parser.add_argument("--iasl", default="iasl", help="ACPICA iasl 20260408 executable")
350321
args = parser.parse_args()
351322
try:
352-
result = build(args.dump, iasl=getattr(args, "iasl", "iasl"), sspm_only=sspm_only)
323+
result = build(args.dump, iasl=args.iasl)
353324
except (ValueError, OSError, subprocess.SubprocessError) as error:
354325
parser.exit(1, f"ACPI build failed: {error}\n")
355326
print(json.dumps(result, indent=2))

‎config/p16-acpi‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,8 @@ build() {
44
error 'P16 ACPI override requires the dedicated kernel allocation fix'
55
return 1
66
}
7-
add_file_early /etc/initcpio/p16-acpi/DSDT.aml /kernel/firmware/acpi/DSDT.aml
87
add_file_early /etc/initcpio/p16-acpi/SSDT.aml /kernel/firmware/acpi/SSDT.aml
98
}
109
help() {
11-
echo 'Hash-validated H7607BA.300 SSPM and EC/battery fixes, for the dedicated P16 kernel only.'
10+
echo 'Hash-validated H7607BA.300 ASUS EC/battery fix, for the dedicated P16 kernel only.'
1211
}

‎packages/build-local.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515

1616
PLATFORM = [
1717
'/etc/initcpio/install/p16-acpi',
18-
'/etc/initcpio/p16-acpi/DSDT.aml',
1918
'/etc/initcpio/p16-acpi/SSDT.aml',
2019
'/etc/mkinitcpio.conf.d/zz-p16-hardware-fixes.conf',
2120
'/etc/mkinitcpio.conf.d/zz-p16-input.conf',
@@ -57,6 +56,7 @@
5756
'p16-mayflower': MAYFLOWER,
5857
}
5958
SOURCES = {
59+
'/etc/initcpio/install/p16-acpi': REPO / 'config/p16-acpi',
6060
'/usr/local/sbin/p16-mkinitcpio-managed': REPO / 'scripts/p16-mkinitcpio-managed',
6161
'/usr/local/sbin/p16-guard-preflight': REPO / 'scripts/p16-guard-preflight',
6262
'/usr/share/p16-platform/90-mkinitcpio-install.hook': REPO / 'config/90-mkinitcpio-install.hook',

‎scripts/build-acpi.py‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727
report = module.build(build / 'firmware', repo=out, iasl=str(compiler / 'generate/unix/bin/iasl'))
2828
(out / 'manifest.json').write_text(json.dumps(report, indent=2) + '\n')
2929
subprocess.run(['bsdtar', '-xf', str(out / module.ARCHIVE_PATH), '-C', str(out)], check=True)
30-
for name, expected in [('DSDT.aml', module.DSDT_OUTPUT), ('SSDT.aml', module.SSDT_OUTPUT)]:
31-
if not hashlib.sha256((out / 'kernel/firmware/acpi' / name).read_bytes()).hexdigest() == expected:
32-
raise ValueError('Validierung fehlgeschlagen')
30+
if not hashlib.sha256((out / 'kernel/firmware/acpi/SSDT.aml').read_bytes()).hexdigest() == module.SSDT_OUTPUT:
31+
raise ValueError('Validierung fehlgeschlagen')
3332
print('ACPI-Dateien:', out / 'kernel/firmware/acpi')

‎scripts/install-kernel.sh‎

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ python3 - "$REPO" <<'PY'
2323
from pathlib import Path
2424
import hashlib, sys
2525
root = Path(sys.argv[1]) / 'build/acpi/kernel/firmware/acpi'
26-
for name, pin in {'DSDT.aml':'80e0ad4a051704003d09029cb600a9814e1cd370ce774b9749dc09d2232b5aaf', 'SSDT.aml':'9b28ffc14c19f8b7ea2278de88ff9ec070f5f70401107d81fef067a916aa9695'}.items():
26+
for name, pin in {'SSDT.aml':'9b28ffc14c19f8b7ea2278de88ff9ec070f5f70401107d81fef067a916aa9695'}.items():
2727
if hashlib.sha256((root/name).read_bytes()).hexdigest() != pin:
2828
raise ValueError('ACPI-Prüfsumme stimmt nicht: ' + name)
2929
PY
@@ -83,9 +83,7 @@ done
8383
for conf in 00-omarchy-n1x-usb4.conf 00-omarchy-n1x-gpu.conf 00-omarchy-n1x-sleep.conf; do
8484
install -Dm644 "$REPO/config/$conf" "/etc/limine-entry-tool.d/$conf"
8585
done
86-
for table in DSDT.aml SSDT.aml; do
87-
install -Dm644 "$REPO/build/acpi/kernel/firmware/acpi/$table" "/etc/initcpio/p16-acpi/$table"
88-
done
86+
install -Dm644 "$REPO/build/acpi/kernel/firmware/acpi/SSDT.aml" /etc/initcpio/p16-acpi/SSDT.aml
8987
install -Dm755 "$REPO/scripts/p16-charge-limit" /usr/local/libexec/p16-charge-limit
9088
install -Dm755 "$REPO/scripts/p16-temperatures" /usr/local/bin/p16-temperatures
9189
for unit in p16-asus-controls.service p16-charge-limit.service; do

‎scripts/install_state.py‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
'/etc/systemd/system/power-profiles-daemon.service.d/20-p16-asus.conf',
2323
'/etc/systemd/system/multi-user.target.wants/p16-charge-limit.service',
2424
'/usr/local/libexec/p16-charge-limit', '/usr/local/bin/p16-temperatures',
25+
# Keep the old DSDT in checkpoints so rollback can restore earlier installs.
2526
'/etc/initcpio/p16-acpi/DSDT.aml', '/etc/initcpio/p16-acpi/SSDT.aml',
2627
]
2728

‎scripts/verify-boot.py‎

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
import subprocess
99
import tempfile
1010
from p16_release import IMAGE, PACKAGE, RELEASE
11-
PINS = {'DSDT.aml': '80e0ad4a051704003d09029cb600a9814e1cd370ce774b9749dc09d2232b5aaf', 'SSDT.aml': '9b28ffc14c19f8b7ea2278de88ff9ec070f5f70401107d81fef067a916aa9695'}
11+
PINS = {'SSDT.aml': '9b28ffc14c19f8b7ea2278de88ff9ec070f5f70401107d81fef067a916aa9695'}
1212

1313
def sections(path):
1414
data = Path(path).read_bytes()
@@ -55,21 +55,25 @@ def verify_image(path):
5555
raise ValueError('Unzulässige ACPI-Deaktivierung im UKI')
5656
data = sec['.initrd']
5757
offset = 0
58-
files = {}
58+
files = []
5959
while data[offset:offset + 6] in (b'070701', b'070702'):
6060
fields = [int(data[offset + 6 + i * 8:offset + 14 + i * 8], 16) for i in range(13)]
6161
size, namesize = (fields[6], fields[11])
6262
start = offset + 110
63-
name = data[start:start + namesize - 1].decode().removeprefix('./')
63+
name = data[start:start + namesize - 1].decode().removeprefix('./').rstrip('/')
6464
start = start + namesize + 3 & ~3
6565
if not start + size <= len(data):
6666
raise ValueError('Abgeschnittenes frühes CPIO-Archiv')
67-
files[name] = data[start:start + size]
67+
if name.startswith('kernel/firmware/acpi/'):
68+
files.append((name, data[start:start + size]))
6869
offset = start + size + 3 & ~3
6970
if name == 'TRAILER!!!':
7071
break
71-
for name, pin in PINS.items():
72-
if not hashlib.sha256(files['kernel/firmware/acpi/' + name]).hexdigest() == pin:
72+
expected = sorted('kernel/firmware/acpi/' + name for name in PINS)
73+
if sorted(name for name, content in files) != expected:
74+
raise ValueError('Only the ASUS SSDT override is allowed; use the native firmware DSDT')
75+
for name, content in files:
76+
if not hashlib.sha256(content).hexdigest() == PINS[name.removeprefix('kernel/firmware/acpi/')]:
7377
raise ValueError('Falsche ACPI-Tabelle im UKI: ' + name)
7478
with tempfile.NamedTemporaryFile() as tmp:
7579
tmp.write(data)

0 commit comments

Comments
 (0)