From 02ad9ec04e0a112706f8e66c9725e68cc13d45f8 Mon Sep 17 00:00:00 2001 From: naddy <> Date: Fri, 24 Jun 2011 19:47:48 +0000 Subject: [PATCH] machdep.kbdreset enables a shutdown by Ctrl-Alt-Del on amd64 and i386. Stop abusing it on other archs for controling a shutdown by pressing the soft power button: * Add a MI sysctl hw.allowpowerdown; if set to 1 (the default) it allows a power button shutdown. * Make acpi(4)/acpibtn(4) honor hw.allowpowerdown. * Switch the various power button intercepts on landisk, sgi, sparc64 and zaurus over to hw.allowpowerdown. * Garbage collect the machdep.kbdreset sysctl on all archs other than amd64 and i386. ok miod@ --- src/etc/etc.landisk/sysctl.conf | 1 - src/etc/etc.loongson/sysctl.conf | 1 - src/etc/etc.palm/sysctl.conf | 1 - src/etc/etc.sgi/sysctl.conf | 1 - src/etc/etc.sparc64/sysctl.conf | 1 - src/etc/etc.zaurus/sysctl.conf | 1 - src/etc/sysctl.conf | 3 ++- 7 files changed, 2 insertions(+), 7 deletions(-) diff --git a/src/etc/etc.landisk/sysctl.conf b/src/etc/etc.landisk/sysctl.conf index 8128872c..a73015c1 100644 --- a/src/etc/etc.landisk/sysctl.conf +++ b/src/etc/etc.landisk/sysctl.conf @@ -1,2 +1 @@ -#machdep.kbdreset=1 # permit console to do a nice halt #machdep.led_blink=1 # blink the power led diff --git a/src/etc/etc.loongson/sysctl.conf b/src/etc/etc.loongson/sysctl.conf index 393f66d8..e69de29b 100644 --- a/src/etc/etc.loongson/sysctl.conf +++ b/src/etc/etc.loongson/sysctl.conf @@ -1 +0,0 @@ -#machdep.kbdreset=1 # 1=Enable power button shutdown diff --git a/src/etc/etc.palm/sysctl.conf b/src/etc/etc.palm/sysctl.conf index 04d5e3b0..b743bf5a 100644 --- a/src/etc/etc.palm/sysctl.conf +++ b/src/etc/etc.palm/sysctl.conf @@ -1,4 +1,3 @@ -#machdep.kbdreset=1 # permit zkbd(4) power key to do a nice halt #machdep.maxspeed=520 # set change maximum processor speed #machdep.lidsuspend=1 # closing the lid will suspend machine #hw.setperf=0 # 0=slowest speed, 100=fastest speed diff --git a/src/etc/etc.sgi/sysctl.conf b/src/etc/etc.sgi/sysctl.conf index 393f66d8..e69de29b 100644 --- a/src/etc/etc.sgi/sysctl.conf +++ b/src/etc/etc.sgi/sysctl.conf @@ -1 +0,0 @@ -#machdep.kbdreset=1 # 1=Enable power button shutdown diff --git a/src/etc/etc.sparc64/sysctl.conf b/src/etc/etc.sparc64/sysctl.conf index 101cc47c..38cba543 100644 --- a/src/etc/etc.sparc64/sysctl.conf +++ b/src/etc/etc.sparc64/sysctl.conf @@ -1,3 +1,2 @@ #machdep.led_blink=1 # 1=On sparc64, make led(s) blink #machdep.allowaperture=1 # See xf86(4) -#machdep.kbdreset=1 # permit console to do a nice halt diff --git a/src/etc/etc.zaurus/sysctl.conf b/src/etc/etc.zaurus/sysctl.conf index 04d5e3b0..b743bf5a 100644 --- a/src/etc/etc.zaurus/sysctl.conf +++ b/src/etc/etc.zaurus/sysctl.conf @@ -1,4 +1,3 @@ -#machdep.kbdreset=1 # permit zkbd(4) power key to do a nice halt #machdep.maxspeed=520 # set change maximum processor speed #machdep.lidsuspend=1 # closing the lid will suspend machine #hw.setperf=0 # 0=slowest speed, 100=fastest speed diff --git a/src/etc/sysctl.conf b/src/etc/sysctl.conf index ed92f14a..4650854b 100644 --- a/src/etc/sysctl.conf +++ b/src/etc/sysctl.conf @@ -1,4 +1,4 @@ -# $OpenBSD: sysctl.conf,v 1.51 2011/04/04 11:14:33 deraadt Exp $ +# $OpenBSD: sysctl.conf,v 1.52 2011/06/24 19:47:48 naddy Exp $ # # This file contains a list of sysctl options the user wants set at # boot time. See sysctl(3) and sysctl(8) for more information on @@ -36,3 +36,4 @@ #kern.watchdog.period=32 # >0=Enable hardware watchdog(4) timer if available #kern.watchdog.auto=0 # 0=Disable automatic watchdog(4) retriggering #kern.pool_debug=0 # 0=Disable pool corruption checks (faster) +#hw.allowpowerdown=0 # 0=Disable power button shutdown