Subject: Re: Orphaned devices in config(8)
To: Bryan P <u1@terran.org>
From: Jason R Thorpe <thorpej@wasabisystems.com>
List: tech-kern
Date: 10/10/2002 19:01:47
--EuxKj2iCbKjpUGkD
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

On Wed, Oct 09, 2002 at 03:02:05PM -0700, Bryan P wrote:

 > For those people who want to ensure they are building slim kernels and
 > don't intend to use orphans later, at least knowing about orphans would be
 > nice.  What about making a report of orphans simply informational ouput
 > rather than a "Warning:"?

Yah, I'm inclined to simply go with this option.  Here's the patch
that does it.

yeah-baby:thorpej 73$ config SWINGER 
SWINGER:400: `scsibus* at scsi?' is orphaned (nothing matching `scsi?' declared)
Don't forget to run "make depend"
yeah-baby:thorpej 74$ 

-- 
        -- Jason R. Thorpe <thorpej@wasabisystems.com>

--EuxKj2iCbKjpUGkD
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=config-patch

Index: main.c
===================================================================
RCS file: /cvsroot/syssrc/usr.sbin/config/main.c,v
retrieving revision 1.73
diff -c -r1.73 main.c
*** main.c	2002/10/11 01:54:50	1.73
--- main.c	2002/10/11 02:01:26
***************
*** 988,999 ****
  	TAILQ_FOREACH(i, &alldevi, i_next) {
  		if ((p = i->i_pspec) == NULL || hasparent(i))
  			continue;
! 		xerror(conffile, i->i_lineno,
! 		    "%s at %s is orphaned", i->i_name, i->i_at);
! 		(void)fprintf(stderr, " (%s %s declared)\n",
  		    p->p_atunit == WILD ? "nothing matching" : "no",
  		    i->i_at);
- 		errs++;
  	}
  	if (TAILQ_EMPTY(&allcf)) {
  		(void)fprintf(stderr, "%s has no configurations!\n",
--- 988,998 ----
  	TAILQ_FOREACH(i, &alldevi, i_next) {
  		if ((p = i->i_pspec) == NULL || hasparent(i))
  			continue;
! 		(void)fprintf(stderr,
! 		    "%s:%d: `%s at %s' is orphaned (%s `%s' declared)\n",
! 		    conffile, i->i_lineno, i->i_name, i->i_at,
  		    p->p_atunit == WILD ? "nothing matching" : "no",
  		    i->i_at);
  	}
  	if (TAILQ_EMPTY(&allcf)) {
  		(void)fprintf(stderr, "%s has no configurations!\n",

--EuxKj2iCbKjpUGkD--