PDA

View Full Version : How do I make my power button do nothing with ACPI disabled?


GullibleJones
November 19th, 2008, 18:53
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.)

gelraen
November 19th, 2008, 22:55
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.

aragon
November 20th, 2008, 01:59
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?

brucec@
November 20th, 2008, 06:42
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 :)

cliedo
November 21st, 2008, 08:21
you may want to try this website: http://linuxgazette.net/106/pramode.html
I give credit to the author its not mine
then go from there hint ps

GullibleJones
November 21st, 2008, 21:24
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.)

Nicholas
December 5th, 2008, 19:10
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.

brucec@
December 5th, 2008, 19:51
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.

GullibleJones
April 9th, 2009, 22:25
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)?

GullibleJones
April 9th, 2009, 22:45
Argh, I forgot that I already asked this question. Never mind. >:(