NetBSD Problem Report #48607

From www@NetBSD.org  Fri Feb 21 08:14:23 2014
Return-Path: <www@NetBSD.org>
Received: from mail.netbsd.org (mail.netbsd.org [149.20.53.66])
	(using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
	(Client CN "mail.netbsd.org", Issuer "Postmaster NetBSD.org" (verified OK))
	by mollari.NetBSD.org (Postfix) with ESMTPS id 15C14A64B9
	for <gnats-bugs@gnats.NetBSD.org>; Fri, 21 Feb 2014 08:14:23 +0000 (UTC)
Message-Id: <20140221081421.B7426A64BA@mollari.NetBSD.org>
Date: Fri, 21 Feb 2014 08:14:21 +0000 (UTC)
From: joerg.grundmann@centertools.de
Reply-To: joerg.grundmann@centertools.de
To: gnats-bugs@NetBSD.org
Subject: Boot with flag AB_SILENT and genfb set is not silent
X-Send-Pr-Version: www-1.0

>Number:         48607
>Category:       kern
>Synopsis:       Boot with flag AB_SILENT and genfb set is not silent
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Feb 21 08:15:00 +0000 2014
>Last-Modified:  Sat Feb 22 18:45:00 +0000 2014
>Originator:     Jörg Grundmann
>Release:        6.1.3
>Organization:
CenterTools GmbH
>Environment:
NetBSD joerg-netbsd.localdomain 6.1.3 NetBSD 6.1.3 (GENERIC) i386
>Description:
Boot process is not silent with vesa mode and flag AB_SILENT set.

When doing silent boot, most of the printed text which is normally shown on console is going to the log even if AB_SILENT is set.

By switching to the vesa mode, the screen will be blank and it's normally a good idea to print all messages again. This is done in vcons_replay_msgbuf() in sys/dev/wscons/wsdisplay_vcons_util.c. But this does not check for boothowto flags like AB_SILENT or AB_QUIET which makes the boot process not silent anymore.
>How-To-Repeat:
- Drop to boot prompt in boot menu (press 5)
- Enter "vesa 1024x768x32"
- Enter "boot -z"

When booting you can see the very first messages until genfb is loaded.
>Fix:
The patch below fixes the problem for me on i386. But Maybe it's better to fix this in vcons_replay_msgbuf() which is in NetBSD/syssrc/sys/dev/wscons/wsdisplay_vcons_util.c because I saw that this function is used by other framebuffer drivers, too.

I guess we have the same problem with the boothowto flag AB_QUIET.


--- a/NetBSD/syssrc/sys/dev/wsfb/genfb.c
+++ b/NetBSD/syssrc/sys/dev/wsfb/genfb.c
@@ -49,8 +49,9 @@ __KERNEL_RCSID(0, "$NetBSD: genfb.c,v 1.47.2.1 2013/02/13 20:52:06 riz Exp $");

 #include <dev/wsfb/genfbvar.h>

-#ifdef GENFB_DISABLE_TEXT
 #include <sys/reboot.h>
+
+#ifdef GENFB_DISABLE_TEXT
 #define DISABLESPLASH (boothowto & (RB_SINGLE | RB_USERCONF | RB_ASKNAME | \
                AB_VERBOSE | AB_DEBUG) )
 #endif
@@ -312,12 +313,14 @@ genfb_attach(struct genfb_softc *sc, struct genfb_ops *ops)
                if (error) {
                        SCREEN_ENABLE_DRAWING(&sc->sc_console_screen);
                        genfb_init_palette(sc);
-                       vcons_replay_msgbuf(&sc->sc_console_screen);
+                       if ( (boothowto & AB_SILENT) == 0)
+                               vcons_replay_msgbuf(&sc->sc_console_screen);
                }
        }
 #else
        genfb_init_palette(sc);
-       vcons_replay_msgbuf(&sc->sc_console_screen);
+       if ( (boothowto & AB_SILENT) == 0)
+               vcons_replay_msgbuf(&sc->sc_console_screen);
 #endif

        if (genfb_softc == NULL)

>Audit-Trail:
From: David Holland <dholland-bugs@netbsd.org>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: kern/48607: Boot with flag AB_SILENT and genfb set is not silent
Date: Sat, 22 Feb 2014 18:40:00 +0000

 On Fri, Feb 21, 2014 at 08:15:01AM +0000, joerg.grundmann@centertools.de wrote:
  > The patch below fixes the problem for me on i386. But Maybe it's
  > better to fix this in vcons_replay_msgbuf()

 Yes, I think that would be better. Also, for some boot modes there may
 be some messages that should still be replayed -- not sure how this
 ought to be handled.

 -- 
 David A. Holland
 dholland@netbsd.org

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2007 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.