lorenz / asrock-x300-s3-fix

Enabling S3 sleep on a DeskMini X300
MIT License
25 stars 8 forks source link

Patching does not work with BIOS v1.90 #11

Closed p-p-q closed 1 month ago

p-p-q commented 1 month ago

Hi, I tried this with the new 1.90 BIOS which ASRock released today (suspend still does not work ootb, unfortunately). I updated the BIOS, loaded default settings, then applied my own settings, booted Linux (Ubuntu 24.04), copied the ACPI tables and tried to patch them using your script. I get the following error, not sure what it means. There is no file "dsdt.dsl.rej" anywhere, btw. Any help is much appreciated. Thank you!

$ ./mkoverride.sh error: file 'nixpkgs' was not found in the Nix search path (add it using $NIX_PATH or -I)

   at «string»:1:9:

        1| (import <nixpkgs> {}).bashInteractive
         |         ^

will use bash from your environment

Intel ACPI Component Architecture ASL+ Optimizing Compiler/Disassembler version 20240827 Copyright (c) 2000 - 2023 Intel Corporation

File appears to be binary: found 7523 non-ASCII characters, disassembling Binary file appears to be a valid ACPI table, disassembling Input file dsdt.aml, Length 0x5B08 (23304) bytes ACPI: DSDT 0x0000000000000000 005B08 (v02 ALASKA A M I 00000001 INTL 20120913) External object resolution file ssdt6.aml Input file ssdt6.aml, Length 0x10C1 (4289) bytes ACPI: SSDT 0x0000000000000000 0010C1 (v02 AMD ArticTPX 00000001 INTL 20120913) Pass 1 parse of [SSDT] Pass 2 parse of [SSDT] External object resolution file ssdt1.aml Input file ssdt1.aml, Length 0x72B0 (29360) bytes ACPI: SSDT 0x0000000000000000 0072B0 (v02 AMD Artic 00000002 MSFT 04000000) Pass 1 parse of [SSDT] Pass 2 parse of [SSDT] Pass 1 parse of [DSDT] Pass 2 parse of [DSDT] Parsing Deferred Opcodes (Methods/Buffers/Packages/Regions)

Parsing completed

Found 3 external control methods, reparsing with new information Pass 1 parse of [DSDT] Pass 2 parse of [DSDT] Parsing Deferred Opcodes (Methods/Buffers/Packages/Regions)

Parsing completed Disassembly completed ASL Output: dsdt.dsl - 222559 bytes patching file dsdt.dsl Hunk #1 FAILED at 18. 1 out of 1 hunk FAILED -- saving rejects to file dsdt.dsl.rej

lorenz commented 1 month ago

Can you upload your DSDT? It doesn't contain anything specific to your machine so it should be fine to just upload here.

p-p-q commented 1 month ago

dsdt.aml.zip Sure, I hope this is the right file, thank you

lorenz commented 1 month ago

I pushed a fix which should make it independent of the OEM revision ID of the vendor table. As far as I can see that's the only problem with later BIOSes.

p-p-q commented 1 month ago

Ooh nice, that was fast. Could you tell me how to test this on Ubuntu? I have added the line GRUB_EARLY_INITRD_LINUX_CUSTOM="acpi_dsdt_override.cpio" to my /etc/default/grub and ran sudo update-grub, so where do I put the file acpi_dsdt_override.cpio which was created in ~/x300/acpi_dsdt_override.cpio? Thank you for your help!

EDIT: I copied the cpio file to /boot/ and re-generated the initramfs using sudo cp -a acpi_dsdt_override.cpio /boot/ sudo dpkg-reconfigure linux-image-6.8.0-45-generic and rebooted twice, now suspend works! Thank you!