From murray@disco.cdrom.com Thu Jul  8 11:38:31 1999
Return-Path: <murray@disco.cdrom.com>
Received: from disco.cdrom.com (disco.cdrom.com [204.216.28.173])
	by hub.freebsd.org (Postfix) with ESMTP id 9DEF714F7C
	for <FreeBSD-gnats-submit@freebsd.org>; Thu,  8 Jul 1999 11:38:30 -0700 (PDT)
	(envelope-from murray@disco.cdrom.com)
Received: (from murray@localhost)
	by disco.cdrom.com (8.9.3/8.9.2) id LAA18199;
	Thu, 8 Jul 1999 11:32:49 -0700 (PDT)
	(envelope-from murray)
Message-Id: <199907081832.LAA18199@disco.cdrom.com>
Date: Thu, 8 Jul 1999 11:32:49 -0700 (PDT)
From: Murray Stokely <murray@disco.cdrom.com>
Reply-To: murray@disco.cdrom.com
To: FreeBSD-gnats-submit@freebsd.org
Subject: Sysinstall can not use live filesystem from CDROM
X-Send-Pr-Version: 3.2

>Number:         12564
>Category:       bin
>Synopsis:       Sysinstall can not use live filesystem from CDROM
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    jkh
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Thu Jul  8 11:40:01 PDT 1999
>Closed-Date:    Mon Jan 3 20:28:10 PST 2000
>Last-Modified:  Mon Jan  3 20:28:48 PST 2000
>Originator:     Murray Stokely
>Release:        FreeBSD 3.2-STABLE i386
>Organization:
Walnut Creek CDROM
>Environment:

  FreeBSD 3.2 / i386

>Description:

  Sysinstall will not allow you too use the Live filesystem CDROM
(disc #2) because it is located on the same CDROM where the Alpha
installation resides and the generic sysinstall CDROM handling
routines barfs when you try to read an Alpha CDROM (as defined in
cdrom.inf) on a i386 machine.  So you can not use the live filesystem
on i386 machines with the official FreeBSD 3.2 CDROM set.

>How-To-Repeat:

  Boot off of the first disc, when in sysinstall, select 'Fixit' then
insert the live filesystem CD as it requests.  You will get an error
saying it is for the wrong architecture.

>Fix:
	
  This patch fixes the problem by adding a 'IGNOREARCH' flag into the
flags variable of the mediaDevice.  It then checks this flag only when
you are attempting to read the live filesystem.  So the architecture
check is still in place except for when you are trying to use the live
filesystem cd.

/usr/src/release# patch < arch.patch

diff -c -r sysinstall.old/cdrom.c sysinstall/cdrom.c
*** sysinstall.old/cdrom.c	Thu May 20 08:57:41 1999
--- sysinstall/cdrom.c	Thu Jul  8 10:59:35 1999
***************
*** 142,148 ****
  		else
  		    bogusCDOK = TRUE;
  	    }
! 	    if ((cp = property_find(cd_attr, "CD_MACHINE_ARCH")) != NULL) {
  #ifdef __alpha__
  		if (strcmp(cp, "alpha")) {
  #else
--- 142,149 ----
  		else
  		    bogusCDOK = TRUE;
  	    }
! 	    if (((cp = property_find(cd_attr, "CD_MACHINE_ARCH")) != NULL) &&
! 		(!dev->flags & IGNOREARCH)) {
  #ifdef __alpha__
  		if (strcmp(cp, "alpha")) {
  #else
diff -c -r sysinstall.old/install.c sysinstall/install.c
*** sysinstall.old/install.c	Wed Jul  7 04:26:44 1999
--- sysinstall/install.c	Thu Jul  8 11:11:38 1999
***************
*** 257,263 ****
      variable_set2(SYSTEM_STATE, "fixit", 0);
      (void)unlink("/mnt2");
      (void)rmdir("/mnt2");
! 
      while (1) {
  	msgConfirm("Please insert a FreeBSD live filesystem CDROM and press return");
  	if (DITEM_STATUS(mediaSetCDROM(NULL)) != DITEM_SUCCESS || !mediaDevice || !mediaDevice->init(mediaDevice)) {
--- 257,264 ----
      variable_set2(SYSTEM_STATE, "fixit", 0);
      (void)unlink("/mnt2");
      (void)rmdir("/mnt2");
!     mediaDevice->flags |= IGNOREARCH; /* Set a flag to ignore the  */
! 				      /* architecture of the CDROM */
      while (1) {
  	msgConfirm("Please insert a FreeBSD live filesystem CDROM and press return");
  	if (DITEM_STATUS(mediaSetCDROM(NULL)) != DITEM_SUCCESS || !mediaDevice || !mediaDevice->init(mediaDevice)) {
diff -c -r sysinstall.old/sysinstall.h sysinstall/sysinstall.h
*** sysinstall.old/sysinstall.h	Wed Jul  7 04:26:45 1999
--- sysinstall/sysinstall.h	Thu Jul  8 10:59:09 1999
***************
*** 238,243 ****
--- 238,246 ----
  #define CD_ALREADY_MOUNTED	1
  #define CD_WE_MOUNTED_IT	2
  
+ /* DEVICE Flags */
+ #define IGNOREARCH              1
+ 
  /* A "device" from sysinstall's point of view */
  typedef struct _device {
      char name[DEV_NAME_MAX];


>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->analyzed 
State-Changed-By: billf 
State-Changed-When: Thu Jul 8 11:59:23 PDT 1999 
State-Changed-Why:  
This problem definatly exists and bit me in the ass on an installation even 
today. 


Responsible-Changed-From-To: freebsd-bugs->jkh 
Responsible-Changed-By: billf 
Responsible-Changed-When: Thu Jul 8 11:59:23 PDT 1999 
Responsible-Changed-Why:  
jkh is mr. sysinstall 
State-Changed-From-To: analyzed->closed 
State-Changed-By: jkh 
State-Changed-When: Mon Jan 3 20:28:10 PST 2000 
State-Changed-Why:  
This was a one-off bug for just 3.2 and needs no work-around 
since we're no longer mixing media on releases (but thanks!). 
>Unformatted:
