Disabling acpisbs in an OpenBSD kernel
[Updated 2021-03-15 to account for KARL with /etc/shtdown]
I recently installed OpenBSD 6.8 on an old Macbook. After boot, this message kept polluting the console and syslog:
acpisbs0: acpi_smbus_read: error reading status: 0x16
acpisbs is the driver for the smart battery subsystem.
My old Macbook doesn’t even have a battery any more, so that may be part of the problem.
This page explains how to disable that driver. I think that page must have been written before OpenBSD implemented KARL (Kernel Address Randomized Link). Now a new kernel is linked and installed after each boot. So any changes to /bsd won’t stick. The next boot will be ok, but the one after that will revert your changes.
So here’s what I’ve done to patch /bsd on shutdown. Put the following in /etc/rc.shutdown:
# disable acpisbs in next-boot kernel echo ' disable acpisbs* quit ' | config -e -o /bsd.new /bsd if test $? = 0 then mv /bsd.new /bsd sha256 -h /var/db/kernel.SHA256 /bsd fi
This writes a new kernel /bsd.new with acpisbs disabled. If that is successful, the new kernel is installed and its checksum is recalculated so /usr/libexec/reorder_kernel will be happy on the next boot.