Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| misc:acpi_patch [2025/04/28 15:20] – 92.40.46.204 | misc:acpi_patch [2025/12/13 12:10] (current) – rqm | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| ====== The Dreaded ACPI Timeout Bug ====== | ====== The Dreaded ACPI Timeout Bug ====== | ||
| + | |||
| + | ---- | ||
| + | ===== ⚠️ IMPORTANT ===== | ||
| + | |||
| + | As of Sun Nov 23 19:56:24 2025 this bug has been [[https:// | ||
| + | |||
| + | Therefore **THE LAST OpenBSD 7.8-stable build [[https:// | ||
| + | |||
| + | **USERS AFFECTED BY THIS ARE ADVISED TO UPGRADE TO 7.8-current by grabbing a [[https:// | ||
| + | ---- | ||
| + | |||
| + | ===== The ACPI bug ===== | ||
| Some models can experience really, really long boot times with OpenBSD. This bug has been known for a while and seems to have appeared around OpenBSD 7.6. It has [[https:// | Some models can experience really, really long boot times with OpenBSD. This bug has been known for a while and seems to have appeared around OpenBSD 7.6. It has [[https:// | ||
| + | |||
| ===== The Symptoms ===== | ===== The Symptoms ===== | ||
| Line 14: | Line 27: | ||
| ===== Affected Models ===== | ===== Affected Models ===== | ||
| * [[:A1502]] Early 2015 Macbook Pro | * [[:A1502]] Early 2015 Macbook Pro | ||
| - | * Maybe others? | + | * [[:A1466]] Macbook Air ([[https:// |
| + | * [[:A1465]] Early 2015 Macbook Air ([[https:// | ||
| + | |||
| + | ==== Lazy way to fix the ACPI bug ==== | ||
| + | |||
| + | We've prepared a custom image that contains the ACPI patch. If you trust us enough (hint: you shouldn' | ||
| + | |||
| + | https:// | ||
| ==== Patch to fix the ACPI bug ==== | ==== Patch to fix the ACPI bug ==== | ||
| - | < | + | **Download links:** |
| - | Index: sys/ | + | * For OpenBSD 7.7 {{ :misc: |
| - | =================================================================== | + | * For OpenBSD 7.8 {{ :misc:macbook-acpi-patch-78.tar.gz |macbook-acpi-patch-78.tar.gz}} |
| - | RCS file: / | + | |
| - | diff -u -p -u -r1.444 acpi.c | + | |
| - | --- sys/ | + | |
| - | +++ sys/ | + | |
| - | @@ -823,8 +823,8 @@ acpi_pci_set_powerstate(pci_chipset_tag_ | + | |
| - | } | + | |
| - | # | + | |
| - | + | ||
| - | - if (state == ACPI_STATE_D0 && pre) | + | |
| - | - aml_evalname(sc, | + | |
| - | +// if (state == ACPI_STATE_D0 && pre) | + | |
| - | +// | + | |
| - | } | + | |
| - | + | ||
| - | int | + | |
| - | </ | + | |
| ==== How to patch ==== | ==== How to patch ==== | ||
| Line 104: | Line 108: | ||
| After you reboot, the new kernel should be the one in use. It will be easy to tell whether the patch worked, because if your system boots " | After you reboot, the new kernel should be the one in use. It will be easy to tell whether the patch worked, because if your system boots " | ||
| + | |||
| ---- | ---- | ||
| - | === II. The Custom Installer Way === | ||
| - | Creating a custom installer requires you to have another amd64 machine running OpenBSD. You will be able to build the kernel at the version your OpenBSD machine is already on. You need to make sure you are fetching the appropriate version of the sources, like above. | ||
| - | The procedure, in short, involves building the custom GENERIC.MP image as well as a custom RAMDISK, but WITHOUT running '' | + | ===== Updating the patched system ===== |
| + | If you want to avoid having to wait 2+ hours again TWICE everytime you have to update your system, there is, fortunately, | ||
| - | == 0. Preliminaries == | + | The below will be a walkthrough that follows '' |
| - | You will also need a copy of '' | + | ==== 0. Preparation ==== |
| + | === 0.a. READ UP. Seriously. === | ||
| + | Read through the [[https:// | ||
| - | If you are on '' | + | === 0.b. Preparation === |
| - | < | + | Follow the " |
| - | $ sysctl kern.version | + | |
| - | kern.version=OpenBSD 7.7-current (GENERIC.MP) #0: Wed Apr 23 20:21:10 BST 2025 | + | |
| - | [..snip..] | + | |
| - | </ | + | |
| - | Note the date; in the above example, it's **"Apr 23 2025" | + | ==== 1. Get the upgrade files ==== |
| - | + | Fetch the updates and move them to a new location. When you run '' | |
| - | A good place to get previous snapshots is on '' | + | |
| - | + | ||
| - | '' | + | |
| - | + | ||
| - | ==== Upgrading your system after patching ==== | + | |
| - | Should a new release come out, unless there' | + | |
| - | + | ||
| - | On your working, normally booting system, you need to patch in place like with "The Slow Boot Way" above. | + | |
| - | + | ||
| - | First, you need to **follow the " | + | |
| - | + | ||
| - | When updating it will skip " | + | |
| < | < | ||
| - | # cd /usr/src/sys/dev/acpi/ | + | # sysupgrade -ns |
| - | # cvs update | + | # mkdir /usr/update |
| + | # mv /home/_sysupgrade/* /usr/update/ | ||
| + | # rm /{bsd.update, | ||
| </ | </ | ||
| + | **NB**: On '' | ||
| - | This will then move your own version | + | ==== 2. Update the source tree ==== |
| + | Follow the **Anonymous CVS** guides for updating the source tree to the latest | ||
| + | ☛ **ASIDE** - What to do if acpi.c | ||
| < | < | ||
| - | # diff acpi.c .#acpi.c.1.444 | + | $ cd / |
| + | $ cvs update -C acpi.c | ||
| </ | </ | ||
| + | CVS will tell you where it stashed the previous file, it usually starts with " | ||
| - | If the only two lines that differ are the ones you commented out with the above patch, just '' | + | To update the source tree on '' |
| - | + | ||
| - | === Download | + | |
| - | Fetch the release you are upgrading to, but without rebooting and installing automatically. | + | |
| - | + | ||
| - | On '' | + | |
| - | < | + | |
| - | # sysupgrade -ns | + | |
| - | </ | + | |
| - | + | ||
| - | On '' | + | |
| < | < | ||
| - | # sysupgrade | + | $ cd /usr/src |
| + | $ cvs -q up -Pd -A | ||
| </ | </ | ||
| + | **NB**: On '' | ||
| - | Sysupgrade will download the new files for the download, you will find then under ''/ | + | ==== 3. Re-compile |
| - | + | See above, but run '' | |
| - | === Make and install | + | |
| - | To build '' | + | |
| < | < | ||
| - | $ doas -s | + | # cd / |
| - | # cd / | + | # make clean |
| # make obj | # make obj | ||
| # make config | # make config | ||
| # make | # make | ||
| - | [...eventually...] | ||
| - | ctfstrip -S -o bsd bsd.gdb | ||
| - | # install -bp / | ||
| </ | </ | ||
| + | Your newly compiled kernel file, '' | ||
| - | This will give you a " | + | Now we have: |
| + | * The latest update files stored away safely | ||
| + | * The latest kernel, compiled with our own patch | ||
| - | === Make and install | + | So it is time to move on to the installation. |
| - | Before rebooting, you need to re-compile '' | + | ==== 4. Manual installation ==== |
| + | This follows closely the official [[https://www.openbsd.org/ | ||
| + | === 4.a. Make sure you have done all the preparation in the official guide === | ||
| + | Did you? | ||
| + | |||
| + | === 4.b Install the newly compiled kernel === | ||
| + | We did not run '' | ||
| < | < | ||
| - | $ doas -s | + | # cd /usr/update |
| - | # cd /sys/arch/ | + | # ln -f /bsd /obsd |
| - | # make obj | + | # cp /usr/obj/ |
| - | # make config | + | # cp bsd.rd / |
| - | # make | + | # cp bsd /bsd.sp # You might not even have this file, relatively safe to skip this last one if you do not intend to run in single-processor mode |
| - | [...eventually...] | + | |
| - | ctfstrip | + | |
| - | # install -bp / | + | |
| </ | </ | ||
| - | Reboot... Done! | + | === 4.c follow the rest of the Manual Install Process === |
| + | Follow closely the linked manual installation guide, and continue the process: Enable KARL; Install new userland. Reboot. Run MAKEDEV, | ||
| + | |||
| + | DONE! | ||