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/10/29 22:26] (current) – h3artbl33d | ||
|---|---|---|---|
| Line 14: | Line 14: | ||
| ===== 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 95: | ||
| 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 |
| - | $ 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"**, so you need the installXX.img from that same snapshot - as it's on **7.7-current** it will be '' | + | |
| - | + | ||
| - | 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 "acpi.c" because | + | ==== 1. Get the upgrade files ==== |
| + | Fetch the updates and move them to a new location. When you run '' | ||
| < | < | ||
| - | # 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 | + | $ cd /usr/src |
| - | </code> | + | $ cvs -q up -Pd -A |
| - | + | ||
| - | On '' | + | |
| - | < | + | |
| - | # sysupgrade | + | |
| </ | </ | ||
| + | **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! | ||