Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
misc:acpi_patch [2025/04/26 23:37] rqmmisc:acpi_patch [2025/04/29 00:10] (current) rqm
Line 104: Line 104:
  
 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 "normally", it worked, if you are back at waiting for 2+ hours at "sd0", it failed and you need to check over whether you did everything correctly. 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 "normally", it worked, if you are back at waiting for 2+ hours at "sd0", it failed and you need to check over whether you did everything correctly.
 +
 +
  
 ---- ----
 +FIXME FIXME FIXME
 +PLEASE DISREGARD BELOW FOR THE TIME BEING, IT IS A WIP AND KNOWN TO BE INCORRECT.
 +FIXME FIXME FIXME
 +----
 +
 === II. The Custom Installer Way === === II. The Custom Installer Way ===
  
Line 129: Line 136:
 ''%%https://ftp.hostserver.de/archive/%%**2025-04-23-0105**/snapshots/amd64/**install77.img**'' ''%%https://ftp.hostserver.de/archive/%%**2025-04-23-0105**/snapshots/amd64/**install77.img**''
  
 +==== Upgrading your system after patching ====
 +Should a new release come out, unless there's a rewrite of ''acpi.c'', you will need to re-patch your kernel upon upgrade.
 +
 +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 "anoncvs" tutorial on the OpenBSD website and upgrade the source tree.**
 +
 +When updating it will skip "acpi.c" because you have manually changed the file locally. Overwrite the local changes by running:
 +<code>
 +# cd /usr/src/sys/dev/acpi/
 +# cvs update -C acpi.c
 +</code>
 +
 +This will then move your own version of ''acpi.c'' to a hidden backup file, something like ''.#acpi.c.1.444'' or similar, keep a note of the command output. Run a diff on the freshly fetched acpi.c and the one you had:
 +<code>
 +# diff acpi.c .#acpi.c.1.444
 +</code>
 +
 +If the only two lines that differ are the ones you commented out with the above patch, just ''mv'' back ''.#acpi.c*'' to ''acpi.c'' because there were no changes. If the output of ''diff'' is more substantial, you might need to edit out the two lines by hand again; if they  still exist, and give us a shout so we can also update this tutorial.
 +
 +=== Download the upgrade ===
 +Fetch the release you are upgrading to, but without rebooting and installing automatically. 
 +
 +On ''-current'' this will be:
 +<code>
 +# sysupgrade -ns
 +</code> 
 +
 +On ''-stable'' this will be:
 +<code>
 +# sysupgrade -n
 +</code>
 +
 +Sysupgrade will download the new files for the download, you will find then under ''/home/_sysupgrade''.
 +
 +=== Make and install the Ramdisk ===
 +To build ''bsd.rd'', follow the instructions for building as above, but instead of ''GENERIC.MP'' you need to build build ''RAMDISK''.
 +<code>
 +$ doas -s
 +# cd /sys/arch/amd64/compile/RAMDISK
 +# make obj
 +# make config
 +# make
 +[...eventually...]
 +ctfstrip -S -o bsd bsd.gdb
 +# install -bp /sys/arch/amd64/compile/RAMDISK/obj/bsd /bsd.hax
 +</code>
 +
 +This will give you a "bsd.hax" ramdisk that you can boot to on next reboot. But don't just reboot yet.
 +
 +=== Make and install the patched kernel again ===
 +
 +Before rebooting, you need to re-compile ''bsd.mp'' and put it ''/home/_sysupgrade'':
 +
 +<code>
 +$ doas -s
 +# cd /sys/arch/amd64/compile/GENERIC.MP
 +# make obj
 +# make config
 +# make
 +[...eventually...]
 +ctfstrip -S -o bsd bsd.gdb
 +# install -bp /sys/arch/amd64/compile/GENERIC.MP/obj/bsd /home/_sysupgrade/bsd.mp
 +</code>
  
 +Reboot... Done!