From nobody  Tue Oct 20 04:41:36 1998
Received: (from nobody@localhost)
          by hub.freebsd.org (8.8.8/8.8.8) id EAA06954;
          Tue, 20 Oct 1998 04:41:36 -0700 (PDT)
          (envelope-from nobody)
Message-Id: <199810201141.EAA06954@hub.freebsd.org>
Date: Tue, 20 Oct 1998 04:41:36 -0700 (PDT)
From: shirai@nintnedo.co.jp
To: freebsd-gnats-submit@freebsd.org
Subject: [PATCH] /stand/sysinstall don't unmount CD-ROM
X-Send-Pr-Version: www-1.0

>Number:         8382
>Category:       i386
>Synopsis:       [PATCH] /stand/sysinstall don't unmount CD-ROM
>Confidential:   no
>Severity:       critical
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Oct 20 04:50:01 PDT 1998
>Closed-Date:    Wed Jan 20 04:00:05 PST 1999
>Last-Modified:  Wed Jan 20 04:26:11 PST 1999
>Originator:     Takashi SHIRAI
>Release:        2.2.6-RELEASE
>Organization:
>Environment:
FreeBSD chandra2 2.2.6-RELEASE FreeBSD 2.2.6-RELEASE #0: Fri Sep  4 11:48:37 JST 1998      shirai@chandra2:/usr/src/sys/compile/chandra2  i386
>Description:
In case that no item is selected in packages installation with /stand/sysinstall,
sysinstall don't unmount CD-ROM device at the end. (The other devices have no problem.)

Following is the patch.
diff -ur ../sysinstall/cdrom.c ./cdrom.c
--- ../sysinstall/cdrom.c       Wed Jan 29 10:11:22 1997
+++ ./cdrom.c   Thu Oct  1 12:26:45 1998
@@ -83,7 +83,6 @@
            msgConfirm("Error mounting %s on %s: %s (%u)", dev->devname, mountpo
int, strerror(errno), errno);
            return FALSE;
        }
-       cdromMounted = TRUE;
     }

     if (!file_readable(string_concat(mountpoint, "/cdrom.inf"))) {
@@ -122,6 +121,7 @@
        }
     }
     msgDebug("Mounted FreeBSD CDROM from device %s\n", dev->devname);
+    cdromMounted = TRUE;
     return TRUE;
 }

But, this patch is not enough.
Even if the directory /dist is already mounted by CD-ROM from the first, sysinstall will unmount /dist to exit.
I think that it's necessary to prepare the flag telling if mounted already or not.
This problem is not concernd only the CD-ROM device, but all devices.

>How-To-Repeat:
With /stand/sysinstall, select Configure -> Packages -> CDROM, and exit at once.
You will find /dist in the output of `df`.

>Fix:
The patch is effective, and you must fix not to unmount already mounted /dist.

>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: jkh 
State-Changed-When: Wed Jan 20 04:00:05 PST 1999 
State-Changed-Why:  
This has been fixed, thank you. 
>Unformatted:
