From seggers@semyam.dinoco.de  Mon May 25 13:04:55 1998
Received: from tim.xenologics.com (tim.xenologics.com [194.77.5.24])
          by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id NAA25008
          for <FreeBSD-gnats-submit@FreeBSD.org>; Mon, 25 May 1998 13:04:49 -0700 (PDT)
          (envelope-from seggers@semyam.dinoco.de)
Received: (from uucp@localhost)
	by tim.xenologics.com (8.8.5/8.8.8) with UUCP id WAA14686
	for FreeBSD-gnats-submit@freebsd.org; Mon, 25 May 1998 22:00:17 +0200 (MET DST)
Received: (from seggers@localhost)
	by semyam.dinoco.de (8.8.8/8.8.8) id VAA02393;
	Mon, 25 May 1998 21:58:33 +0200 (CEST)
	(envelope-from seggers)
Message-Id: <199805251958.VAA02393@semyam.dinoco.de>
Date: Mon, 25 May 1998 21:58:33 +0200 (CEST)
From: Stefan Eggers <seggers@semyam.dinoco.de>
Reply-To: seggers@semyam.dinoco.de
To: FreeBSD-gnats-submit@FreeBSD.org
Cc: seggers@semyam.dinoco.de
Subject: sysinstall w/o cd9660 fs loaded can't mount CD
X-Send-Pr-Version: 3.2

>Number:         6752
>Category:       misc
>Synopsis:       sysinstall w/o cd9660 fs loaded can't mount CD
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    jkh
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon May 25 13:00:00 PDT 1998
>Closed-Date:    Mon Feb 1 11:13:11 PST 1999
>Last-Modified:  Mon Feb  1 11:14:00 PST 1999
>Originator:     Stefan Eggers
>Release:        FreeBSD 2.2.6-STABLE i386
>Organization:
none
>Environment:

	I use a kernel w/o cd9660 fs built in and it doesn't get
loaded on system startup - the first mount of a CD-ROM will have to
load it.  The kernel is pretty much GENERIC with unnecessary stuff
removed.

>Description:

	When the cd9660 LKM is not loaded and it is not compiled into
the kernel sysinstall can't mount the CD-ROM.

>How-To-Repeat:

	Make a kernel w/o cd9660 fs and make sure the cd9660 fs module
is not loaded.  Now start sysinstall and try to install some package
from CD-ROM.

>Fix:
	
	This fix I made for 2.2-stable from about a week ago - about
May 17.  I copied the code mount_cd9660 uses and added it to the
relevant place in sysinstall.  As I was at it I also changed mount() a
little bit to be more the way mount_cd9660 is instead of the - accor-
ding to the comment below the example in vfsload(3) - old way of doing
it.

*** cdrom.c.ORIG	Wed Jan 29 02:11:22 1997
--- cdrom.c	Mon May 25 21:26:42 1998
***************
*** 61,66 ****
--- 61,67 ----
      char *cp;
      Boolean readInfo = TRUE;
      char *mountpoint = "/dist";
+     struct vfsconf *vfc;
  
      if (cdromMounted)
  	return TRUE;
***************
*** 74,80 ****
  
      Mkdir(mountpoint);
  
!     if (mount(MOUNT_CD9660, mountpoint, MNT_RDONLY, (caddr_t) &args) == -1) {
  	if (errno == EINVAL) {
  	    msgConfirm("The CD in your drive looks more like an Audio CD than a FreeBSD release.");
  	    return FALSE;
--- 75,95 ----
  
      Mkdir(mountpoint);
  
!     vfc = getvfsbyname("cd9660");
!     if ((vfc == NULL) && vfsisloadable("cd9660")) {
! 	if (vfsload("cd9660") != 0) {
! 	    msgConfirm("Can't load CD filesystem.");
! 	    return FALSE;
! 	}
! 	endvfsent(); /* flush cache */
! 	vfc = getvfsbyname("cd9660");
!     }
!     if (vfc == NULL)
!     {
! 	msgConfirm("CD filesystem neither in kernel nor loadable as LKM.");
! 	return FALSE;
!     }
!     if (mount(vfc->vfc_index, mountpoint, MNT_RDONLY, (caddr_t) &args) == -1) {
  	if (errno == EINVAL) {
  	    msgConfirm("The CD in your drive looks more like an Audio CD than a FreeBSD release.");
  	    return FALSE;
>Release-Note:
>Audit-Trail:

From: "Jordan K. Hubbard" <jkh@time.cdrom.com>
To: seggers@semyam.dinoco.de
Cc: FreeBSD-gnats-submit@FreeBSD.ORG
Subject: Re: misc/6752: sysinstall w/o cd9660 fs loaded can't mount CD 
Date: Mon, 25 May 1998 16:36:48 -0700

 Hmmm.  This should be in the mount call itself, one would think.
Responsible-Changed-From-To: freebsd-bugs->jkh 
Responsible-Changed-By: phk 
Responsible-Changed-When: Wed May 27 02:16:06 PDT 1998 
Responsible-Changed-Why:  
The patch if it works has merits.  We can't add gunk like this to the 
mount function because it is a syscall, but we could add a library 
wrapper that does this bit. 

Anyway, over to Jordan as Mr. sysinstall 
State-Changed-From-To: open->closed 
State-Changed-By: jkh 
State-Changed-When: Mon Feb 1 11:13:11 PST 1999 
State-Changed-Why:  
2 floppy boot makes this moot. 
>Unformatted:
