This is an old revision of the document!
The Dreaded ACPI Timeout 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 featured in a lot of discussions, and resolving it caused so much unbridled joy that it prompted the creation of this entire wiki.
The Symptoms
Booting the stock installer or kernel will cause the boot procedure to hang quite early on, usually after identifying the hard disks:
INSERT PHOTO
As @brynet@bsd.network pointed out, it is caused by “some kind of regression that triggers a weird ACPI firmware bug on this machine.”
The machine will boot, eventually, if you leave it long enough, usually 2+ hours. However, without applying a simple patch to the kernel, it will do the same thing every single time you boot the machine.
Affected Models
- A1502 Early 2015 Macbook Pro
- Maybe others?
Patch to fix the ACPI bug
Index: sys/dev/acpi/acpi.c =================================================================== RCS file: /cvs/src/sys/dev/acpi/acpi.c,v diff -u -p -u -r1.444 acpi.c --- sys/dev/acpi/acpi.c 24 Mar 2025 09:53:20 -0000 1.444 +++ sys/dev/acpi/acpi.c 20 Apr 2025 19:45:13 -0000 @@ -823,8 +823,8 @@ acpi_pci_set_powerstate(pci_chipset_tag_ } #endif /* NACPIPWRRES > 0 */ - if (state == ACPI_STATE_D0 && pre) - aml_evalname(sc, pdev->node, "_PS0", 0, NULL, NULL); +// if (state == ACPI_STATE_D0 && pre) +// aml_evalname(sc, pdev->node, "_PS0", 0, NULL, NULL); } int
How to patch
You have two options: build a custom installer and install your system with a patched kernel, or going the “slow way” and wait out the long boot time on booting the installer; installing the system; waiting out the first boot; then patching the kernel for the machine you are on.
Before you start, give the following manual pages a good read, you will have a much clearer understanding of what's going on:
- If going the “Custom installer” route, OpenBSD FAQ - Creating Install Media
The Slow Boot Way
Waiting out the slow boot times is probably a little bit easier, and it doesn't require you to have another working OpenBSD install that you can use to compile a custom kernel and create a custom installer image.
So after you have downloaded the latest installXX.img
, flashed it to a USB drive or whatever, plugged it in, booted up the Mac by holding down Option until you see the bootloader screen, selected the USB drive (“EFI BOOT” usually), started the installer, waited / slept / went for a walk until it got over the ACPI nonsense, installed, rebooted, waited / slept / went for a walk until it got over the ACPI nonsense again, and logged in…
0. Setting some ENV variables
It makes your life easier if you set the $CVSROOT env variable in your ~/.profile
or ~/.kshrc
or preferred place that will get sourced on login.
First, pick a server close to you from the list at the bottom of the OpenBSD Anonymous CVS page
Then add to your dotfile of choice the below:
export CVSROOT=anoncvs@url-to-your-cvs-server-of-cho.ice:/cvs
And source it:
$ . ~/.my-favourite-dotfile
1. Add your user to the source groups
You need to be a member of wsrc
and wobj
groups. As root, therefore, run:
# usermod -G wsrc,wobj $YOURUSERNAME
2. CVS Checkout the Tree of the Sauce
It is important that you get the sources for the branch you follow. Check the instructions under “Getting an Initial Tree” on the OpenBSD Anonymous CVS page.
If you are on -current
, it's advised you make sure you are on the latest snapshot before downloading the source tree, by running # sysupgrade -s
first.
First checkout takes a while, but once done, you should have the source tree in /usr/src
.
3. Patch / Edit the appropriate files
Paste the contents of the Patch above into a new file (let's call it best-patch-ever.diff mac_acpi_patch.diff
for our purposes), and then run:
$ patch < mac_acpi_patch.diff
You can of course simply comment out the two (!) affected lines manually; you need to delete / comment out two lines in /usr/src/sys/dev/acpi/acpi.c
. (In OpenBSD 7.7 they start at :823).