From owner-freebsd-hackers@FreeBSD.ORG Fri Feb 22 10:22:37 2008 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D81A916A402 for ; Fri, 22 Feb 2008 10:22:37 +0000 (UTC) (envelope-from rink@tragedy.rink.nu) Received: from mx1.rink.nu (alastor.rink.nu [213.34.49.5]) by mx1.freebsd.org (Postfix) with ESMTP id 8B17B13C46A for ; Fri, 22 Feb 2008 10:22:37 +0000 (UTC) (envelope-from rink@tragedy.rink.nu) Received: from localhost (alastor.rink.nu [213.34.49.5]) by mx1.rink.nu (Postfix) with ESMTP id 2D2D6BFEC79; Fri, 22 Feb 2008 10:22:34 +0000 (UTC) X-Virus-Scanned: amavisd-new at rink.nu Received: from mx1.rink.nu ([213.34.49.5]) by localhost (alastor.rink.nu [213.34.49.5]) (amavisd-new, port 10024) with ESMTP id aWqV11joBDHN; Fri, 22 Feb 2008 10:22:25 +0000 (UTC) Received: from tragedy.rink.nu (tragedy.rink.nu [213.34.49.3]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.rink.nu (Postfix) with ESMTP id 6B4C9BFEB7A; Fri, 22 Feb 2008 10:22:25 +0000 (UTC) Received: from tragedy.rink.nu (tragedy.rink.nu [213.34.49.3]) by tragedy.rink.nu (8.13.8/8.13.8) with ESMTP id m1MAMPDU094996; Fri, 22 Feb 2008 11:22:25 +0100 (CET) (envelope-from rink@tragedy.rink.nu) Received: (from rink@localhost) by tragedy.rink.nu (8.13.8/8.13.8/Submit) id m1MAMO52094995; Fri, 22 Feb 2008 11:22:24 +0100 (CET) (envelope-from rink) Date: Fri, 22 Feb 2008 11:22:24 +0100 From: Rink Springer To: Jeremy Chadwick Message-ID: <20080222102224.GA87406@rink.nu> References: <20080222092506.GA25704@eos.sc1.parodius.com> <200802220952.m1M9qskE001105@lurza.secnetix.de> <20080222100924.GA26637@eos.sc1.parodius.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080222100924.GA26637@eos.sc1.parodius.com> User-Agent: Mutt/1.5.17 (2007-11-01) Cc: freebsd-hackers@freebsd.org Subject: Re: cool feature of dmesg.boot file X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Feb 2008 10:22:37 -0000 On Fri, Feb 22, 2008 at 02:09:24AM -0800, Jeremy Chadwick wrote: > Maybe I should look into writing a patch that does in fact clear the > buffer immediately before reboot, and tie it to a sysctl. I suggest just making a loader tunable to do this. I think the following should do it (untested): --- subr_prf.c 2007-03-08 07:44:34.000000000 +0100 +++ subr_prf.new.c 2008-02-22 11:21:53.000000000 +0100 @@ -913,14 +913,20 @@ msgbufinit(void *ptr, int size) { char *cp; + char *rv; static struct msgbuf *oldp = NULL; size -= sizeof(*msgbufp); cp = (char *)ptr; msgbufp = (struct msgbuf *)(cp + size); - msgbuf_reinit(msgbufp, cp, size); - if (msgbufmapped && oldp != msgbufp) - msgbuf_copy(oldp, msgbufp); + rv = getenv("kern.ignore_old_msgbuf"); + if (rv != NULL && strncmp(rv, "1", 1) != 0) { + msgbuf_clear(mbp); + } else { + msgbuf_reinit(msgbufp, cp, size); + if (msgbufmapped && oldp != msgbufp) + msgbuf_copy(oldp, msgbufp); + } msgbufmapped = 1; oldp = msgbufp; } Regards, -- Rink P.W. Springer - http://rink.nu "Anyway boys, this is America. Just because you get more votes doesn't mean you win." - Fox Mulder