Subject: misc/7406: mount_critical_filesystems() spews incorrectly.
To: None <gnats-bugs@gnats.netbsd.org>
From: None <nwilliams@primeon.com>
List: netbsd-bugs
Date: 04/16/1999 14:52:37
>Number:         7406
>Category:       misc
>Synopsis:       mount_critical_filesystems() spews incorrectly.
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    misc-bug-people (Misc Bug People)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Apr 16 14:50:02 1999
>Last-Modified:
>Originator:     Nathan Williams
>Organization:
	Primeon, Inc. 
>Release:        NetBSD 1.4_ALPHA
>Environment:
System: NetBSD nwilliams 1.4_ALPHA NetBSD 1.4_ALPHA (PRIMEON) #0: Fri Apr 16 15:37:33 EDT 1999 nathanw@nwilliams:/u1/nbsd/src/sys/arch/i386/compile/PRIMEON i386


>Description:
	The mount_critical_filsystems() routine in /etc/rc.subr calls 
islocalfs() on "/usr", "/var", and the filesystems listed in 
$critical_filesystems. On a system where either /usr or /var is not a separate 
partition, islocalfs() ends up complaining 
WARNING: islocalfs() in rc.subr doesn't recognise fstype /usr
during boot. This is useless and potentially disconcerting spewage.
>How-To-Repeat:
	Install a machine and make usr and var symlinks to an actual
mounted partition like /u1. Reboot.
>Fix:
	Put /usr and /var in the default definition of $critical_filesystems
rather than coding them in the routine so that installers can remove them
for systems where neither is actually a filesystem.


*** rc.conf.orig	Fri Apr 16 17:43:24 1999
--- rc.conf	Fri Apr 16 17:44:07 1999
***************
*** 27,34 ****
  # related to Internet domain names.
  domainname=""				# if blank, use /etc/defaultdomain
  
! # Filesystems (besides /usr and /var) to mount early in boot-up
! critical_filesystems=""
  
  # Set this to YES if you have purposefully setup no swap partitions and
  # don't want to be warned about it
--- 27,34 ----
  # related to Internet domain names.
  domainname=""				# if blank, use /etc/defaultdomain
  
! # Filesystems to mount early in boot-up
! critical_filesystems="/usr /var"
  
  # Set this to YES if you have purposefully setup no swap partitions and
  # don't want to be warned about it
*** rc.subr.orig	Fri Apr 16 17:44:30 1999
--- rc.subr	Fri Apr 16 17:44:43 1999
***************
*** 34,40 ****
  #
  fstab=/etc/fstab
  mount_critical_filesystems() {
! 	for fs in /usr /var $critical_filesystems; do
  		if [ $1 = local ] && ! islocalfs $fs; then
  			continue
  		fi
--- 34,40 ----
  #
  fstab=/etc/fstab
  mount_critical_filesystems() {
! 	for fs in $critical_filesystems; do
  		if [ $1 = local ] && ! islocalfs $fs; then
  			continue
  		fi
>Audit-Trail:
>Unformatted: