How do I make my power button do nothing with ACPI disabled?

Due to my laptop's buggy BIOS, I have to disable ACPI or my network card won't work.

However, this introduces a problem with my power button. With ACPI enabled, the power button induces a clean shutdown. With ACPI disabled, however, instead of just not doing anything, pressing it causes the laptop to immediately power down, i.e. an unclean shutdown.

Needless to say, this is very bad, as a single wrong touch can immediately crash my machine, and potentially cause filesystem damage. Is there any way to tell FreeBSD to completely ignore the power button?

(FWIW: no, I don't need the unclean-shutdown functionality; after five seconds of holding the power button down, my laptop's BIOS kicks in and automatically shuts it down.)
 
When ACPI is disabled hardware works in legacy mode. So you only may try to use apm(4) instead of ACPI, but be sure to read "BUGS" section in manual.

Also, if some BIOS updates available at manufacturer's site, updating may help.
 
The way you word it is as if FreeBSD is performing the unclean shutdown in response to a power button event. But I didn't know FreeBSD was capable of shutting down uncleanly (unless the kernel crashes, of course). Are you sure it's not just your BIOS shutting down the hardware?
 
aragon said:
The way you word it is as if FreeBSD is performing the unclean shutdown in response to a power button event. But I didn't know FreeBSD was capable of shutting down uncleanly (unless the kernel crashes, of course). Are you sure it's not just your BIOS shutting down the hardware?

In this case the power button is being reconfigured to switch the power supply off without sending a signal to the OS. However, see shutdown(8) and the -n option for how to tell FreeBSD to do a real unclean shutdown :)
 
brucec said:
In this case the power button is being reconfigured to switch the power supply off without sending a signal to the OS. However, see shutdown(8) and the -n option for how to tell FreeBSD to do a real unclean shutdown :)

I know how to do a clean shutdown... How do I tell FreeBSD to do that when I press the power button?

(Keep in mind that ACPI is disabled.)
 
did you tried
sysctl hw.acpi.power_button_state=NONE ?
know, acpi is disabled, but my laptop works with acpi enabled only so i can't check my guess.
 
GullibleJones said:
I know how to do a clean shutdown... How do I tell FreeBSD to do that when I press the power button?

(Keep in mind that ACPI is disabled.)

The only option is to see if you can enable APM instead or upgrade the BIOS so you can re-enable ACPI. If the BIOS doesn't configure the power button to route the button event to FreeBSD there's nothing it can do to prevent the power being lost.
 
How to override default power button behavior when ACPI is off?

I'm currently eyeing FreeBSD as an alternative to the numerous and largely crappy Linux distros out there. However, I have a problem with it... Since enabling ACPI on FreeBSD disables networking on my laptop, I have to use FreeBSD without ACPI. (This isn't a big deal; the laptop is already pretty much a desktop replacement.) However, when ACPI is off, pressing the power button instantly and uncleanly shuts down my machine; so, accidentally touching the button could result in data loss, something I'm not interested in. Is there a way to stick something between the BIOS and the power button so that this doesn't happen, without enabling ACPI (and thus disabling my networking) or APM (which I don't have)?
 
Back
Top