Index: src/sys/kern/subr_prf.c =================================================================== RCS file: /home/ncvs/src/sys/kern/subr_prf.c,v retrieving revision 1.61.2.5 diff -u -r1.61.2.5 subr_prf.c --- src/sys/kern/subr_prf.c 31 Aug 2002 18:22:08 -0000 1.61.2.5 +++ src/sys/kern/subr_prf.c 6 Jun 2003 07:27:10 -0000 @@ -49,6 +49,7 @@ #include #include #include +#include #include #include @@ -58,6 +59,8 @@ */ #include +#include "opt_consquiet.h" + #define TOCONS 0x01 #define TOTTY 0x02 #define TOLOG 0x04 @@ -97,6 +100,19 @@ SYSCTL_INT(_kern, OID_AUTO, log_console_output, CTLFLAG_RW, &log_console_output, 0, ""); +#ifdef CONS_QUIET +#ifdef CONS_QUIET_DEFAULT +static int consquiet = 1; /* Suppress any console messages */ +#else /* CONS_QUIET_DEFAULT */ +static int consquiet = 0; +#endif /* CONS_QUIET_DEFAULT */ +#ifdef CONS_QUIET_PROGRESS +static int consqprog = 0; +#endif /* CONS_QUIET_PROGRESS */ + +SYSCTL_INT(_kern, OID_AUTO, consquiet, CTLFLAG_RW, &consquiet, 0, ""); +#endif /* CONS_QUIET */ + /* * Warn that a system table is full. */ @@ -342,7 +358,11 @@ struct tty *tp = ap->tty; if (panicstr) constty = NULL; +#ifdef CONS_QUIET + if ((flags & TOCONS) && tp == NULL && constty && !consquiet) { +#else /* CONS_QUIET */ if ((flags & TOCONS) && tp == NULL && constty) { +#endif /* CONS_QUIET */ tp = constty; flags |= TOTTY; } @@ -351,8 +371,20 @@ constty = NULL; if ((flags & TOLOG)) msglogchar(c, ap->pri); - if ((flags & TOCONS) && constty == NULL && c != '\0') + if ((flags & TOCONS) && constty == NULL && c != '\0') { +#ifdef CONS_QUIET + if (!consquiet) + (*v_putc)(c); +#ifdef CONS_QUIET_PROGRESS + else if (++consqprog == 100) { + (*v_putc)('.'); + consqprog = 0; + } +#endif /* CONS_QUIET_PROGRESS */ +#else /* CONS_QUIET */ (*v_putc)(c); +#endif /* CONS_QUIET */ + } } /* Index: src/sys/conf/options =================================================================== RCS file: /home/ncvs/src/sys/conf/options,v retrieving revision 1.191.2.63 diff -u -r1.191.2.63 options --- src/sys/conf/options 7 Apr 2004 20:29:00 -0000 1.191.2.63 +++ src/sys/conf/options 14 Apr 2004 09:35:34 -0000 @@ -514,6 +514,11 @@ SOCKBUF_DEBUG opt_global.h +# Silence kernel console messages +CONS_QUIET opt_consquiet.h +CONS_QUIET_DEFAULT opt_consquiet.h +CONS_QUIET_PROGRESS opt_consquiet.h + # options for ubsec driver UBSEC_DEBUG opt_ubsec.h UBSEC_RNDTEST opt_ubsec.h