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/06/29 00:14] – Added instructions for updating the patched system 92.40.32.213misc:acpi_patch [2025/06/29 00:26] (current) 92.40.32.213
Line 105: Line 105:
 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.
  
-==== Updating the patched system ====+ 
 +---- 
 + 
 + 
 +===== 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, a much quicker way to do it. Basically the less painfully slow update method is a hybrid of manual and automatic installation with custom-compiling the kernel. Credits go to [[https://marc.info/?l=openbsd-tech&m=175031825008339&w=2|Stuart Henderson]] for pointing out this possibility. If you want to avoid having to wait 2+ hours again TWICE everytime you have to update your system, there is, fortunately, a much quicker way to do it. Basically the less painfully slow update method is a hybrid of manual and automatic installation with custom-compiling the kernel. Credits go to [[https://marc.info/?l=openbsd-tech&m=175031825008339&w=2|Stuart Henderson]] for pointing out this possibility.
  
 The below will be a walkthrough that follows ''-current'', a few commands will be different for ''-stable'', these will be indicated. The below will be a walkthrough that follows ''-current'', a few commands will be different for ''-stable'', these will be indicated.
  
-=== 0. Preparation === +==== 0. Preparation ==== 
-== 0.a. READ UP. Seriously. ==+=== 0.a. READ UP. Seriously. ===
 Read through the [[https://www.openbsd.org/faq/upgrade77.html#NoInstKern|OpenBSD Manual Installation howto in the FAQ]] first as well as the man pages linked above, if you have not done so. They will make your life much much easier. Read through the [[https://www.openbsd.org/faq/upgrade77.html#NoInstKern|OpenBSD Manual Installation howto in the FAQ]] first as well as the man pages linked above, if you have not done so. They will make your life much much easier.
  
-== 0.b. Preparation ==+=== 0.b. Preparation ===
 Follow the "Preparation" steps on the Manual Upgrade page: especially on becoming root "properly" and installing the boot blocks. Make sure you install the boot blocks to the appropriate drive, do not just go with "sd0" as it was in the tutorial, if, say your root is on e.g. sd3. Follow the "Preparation" steps on the Manual Upgrade page: especially on becoming root "properly" and installing the boot blocks. Make sure you install the boot blocks to the appropriate drive, do not just go with "sd0" as it was in the tutorial, if, say your root is on e.g. sd3.
  
-=== 1. Get the upgrade files ===+==== 1. Get the upgrade files ====
 Fetch the updates and move them to a new location. When you run ''sysupgrade'' the installer files are stored in ''/home/_sysupgrade'', and two extra files are created, ''/bsd.update'' and ''/auto_upgrade.conf''. You want to copy the installer files from ''/home/_sysupgrade'' somewhere else, and delete the auto-update files. Fetch the updates and move them to a new location. When you run ''sysupgrade'' the installer files are stored in ''/home/_sysupgrade'', and two extra files are created, ''/bsd.update'' and ''/auto_upgrade.conf''. You want to copy the installer files from ''/home/_sysupgrade'' somewhere else, and delete the auto-update files.
 <code> <code>
Line 127: Line 131:
 **NB**: On ''-stable'' you want to run ''sysupgrade -n''. **NB**: On ''-stable'' you want to run ''sysupgrade -n''.
  
-=== 2. Update the source tree ===+==== 2. Update the source tree ====
 Follow the **Anonymous CVS** guides for updating the source tree to the latest version.  Follow the **Anonymous CVS** guides for updating the source tree to the latest version. 
 ☛ **ASIDE** - What to do if acpi.c changes drastically and the patch doesn't work anymore? ((The file we have been patching, ''/usr/src/sys/dev/acpi/acpi.c'', might change in the future. It is good to check the CVS logs, or keep an eye on the [[https://github.com/openbsd/src/commits/master/sys/dev/acpi/acpi.c|acpi.c on GitHub's CVS mirror]].  If you would see that the lines we have been working with have changed in the source or new features have been introduced, then you need to revert your local modifications to the CVS version. To do this, you need to run, ☛ **ASIDE** - What to do if acpi.c changes drastically and the patch doesn't work anymore? ((The file we have been patching, ''/usr/src/sys/dev/acpi/acpi.c'', might change in the future. It is good to check the CVS logs, or keep an eye on the [[https://github.com/openbsd/src/commits/master/sys/dev/acpi/acpi.c|acpi.c on GitHub's CVS mirror]].  If you would see that the lines we have been working with have changed in the source or new features have been introduced, then you need to revert your local modifications to the CVS version. To do this, you need to run,
Line 143: Line 147:
 **NB**: On ''-stable'' you want to use '' -rOPENBSD_7_7'' as the last parameter instead of "-A" **NB**: On ''-stable'' you want to use '' -rOPENBSD_7_7'' as the last parameter instead of "-A"
  
-=== 3. Re-compile the GENERIC.MP Kernel ===+==== 3. Re-compile the GENERIC.MP Kernel ====
 See above, but run ''# make clean'' before compiling and **do not** run ''# make install'' at the end: See above, but run ''# make clean'' before compiling and **do not** run ''# make install'' at the end:
 <code> <code>
Line 155: Line 159:
  
 Now we have: Now we have:
-The latest update files stored away safely +  * The latest update files stored away safely  
-The latest kernel, compiled with our own patch+  The latest kernel, compiled with our own patch
  
 So it is time to move on to the installation. So it is time to move on to the installation.
  
-=== 4. Manual installation ===+==== 4. Manual installation ====
 This follows closely the official [[https://www.openbsd.org/faq/upgrade77.html#NoInstKern|manual installation guide]], but diverges for the installation of the kernel. This follows closely the official [[https://www.openbsd.org/faq/upgrade77.html#NoInstKern|manual installation guide]], but diverges for the installation of the kernel.
  
-== 4.a. Make sure you have done all the preparation in the official guide ==+=== 4.a. Make sure you have done all the preparation in the official guide ===
 Did you? Did you?
  
-== 4.b Install the newly compiled kernel ==+=== 4.b Install the newly compiled kernel ==
 +We did not run ''make install'' after compiling because we are going to do this little dance as suggested:
 <code> <code>
 # cd /usr/update # cd /usr/update
Line 172: Line 177:
 # cp /usr/obj/sys/arch/amd64/compile/GENERIC.MP/bsd.gdb /nbsd && mv /nbsd /bsd # cp /usr/obj/sys/arch/amd64/compile/GENERIC.MP/bsd.gdb /nbsd && mv /nbsd /bsd
 # cp bsd.rd / # cp bsd.rd /
-# cp bsd /bsd.sp # You might not even have this file, relatively safe to skip this last one+# 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
 </code> </code>
  
-== 4.c follow the rest of the Manual Install Process ==+=== 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,  update the boot loader, run ''sysmerge'' and ''fw_update''. Follow closely the linked manual installation guide, and continue the process: Enable KARL; Install new userland. Reboot. Run MAKEDEV,  update the boot loader, run ''sysmerge'' and ''fw_update''.
  
 DONE! DONE!