Subject: [PATCH] new option BEEP_ONHALT_FOREVER
To: None <tech-kern@NetBSD.org>
From: =?ISO-8859-2?Q?M=E1ty=E1s_J=E1nos?= <jani@xoftware.de>
List: tech-kern
Date: 05/20/2006 15:59:01
This is a multi-part message in MIME format.

--Multipart=_Sat__20_May_2006_15_59_01_+0200_8ePU/6QKC8KKEx1+
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit

Hi,

the following patch adds the new option BEEP_ONHALT_FOREVER to i386 and
xen 3.0.0_STABLE kernels. With the existing BEEP_ONHALT_COUNT you can
specify only a fixed number of beeps on halt.

I use this for an older, headless non-ATX internet gateway machine which
also serves NFS for a diskless workstation at home. It can't power
down itself so need to do by hand (after halted from remote) and pull
the ADSL modem out by hand. The machine is in an another room, and
without beeping continously on halt I can easy forget to power it down.

Feel free to commit it if you think it's usable. This is my first
NetBSD code contribution, your comments are welcomed.

--Multipart=_Sat__20_May_2006_15_59_01_+0200_8ePU/6QKC8KKEx1+
Content-Type: application/octet-stream;
 name="netbsd_beep_onhalt_forever.diff"
Content-Disposition: attachment;
 filename="netbsd_beep_onhalt_forever.diff"
Content-Transfer-Encoding: base64

SW5kZXg6IGFyY2gvaTM4Ni9jb25mL0dFTkVSSUMKPT09PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQpSQ1MgZmlsZTogL2N2c3Jv
b3Qvc3JjL3N5cy9hcmNoL2kzODYvY29uZi9HRU5FUklDLHYKcmV0cmlldmluZyByZXZpc2lvbiAx
LjY2MS4yLjgKZGlmZiAtdSAtdSAtcjEuNjYxLjIuOCBHRU5FUklDCi0tLSBhcmNoL2kzODYvY29u
Zi9HRU5FUklDCTI4IE9jdCAyMDA1IDIwOjEyOjQyIC0wMDAwCTEuNjYxLjIuOAorKysgYXJjaC9p
Mzg2L2NvbmYvR0VORVJJQwkyMCBNYXkgMjAwNiAxMjo1Mzo1MCAtMDAwMApAQCAtOTYsNiAr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