From thz@Lennartz-electronic.de  Tue Jul 16 06:58:46 2002
Return-Path: <thz@Lennartz-electronic.de>
Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 8F0CD37B400
	for <FreeBSD-gnats-submit@freebsd.org>; Tue, 16 Jul 2002 06:58:46 -0700 (PDT)
Received: from smtp.www-service.de (smtp.www-service.de [212.77.161.16])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 7D86443E42
	for <FreeBSD-gnats-submit@freebsd.org>; Tue, 16 Jul 2002 06:58:45 -0700 (PDT)
	(envelope-from thz@Lennartz-electronic.de)
Received: from swd2.tue.le (pD95033C1.dip.t-dialin.net [217.80.51.193])
	by smtp.www-service.de (8.11.6/8.11.6) with ESMTP id g6GFHhX19480
	for <FreeBSD-gnats-submit@freebsd.org>; Tue, 16 Jul 2002 17:17:44 +0200
Received: from mezcal.tue.le (mezcal.tue.le [192.168.201.20])
	by swd2.tue.le (8.12.3/8.12.3) with ESMTP id g6GDvBXj049671
	for <FreeBSD-gnats-submit@freebsd.org>; Tue, 16 Jul 2002 15:57:11 +0200 (CEST)
	(envelope-from thz@mezcal.tue.le)
Received: from mezcal.tue.le (localhost [127.0.0.1])
	by mezcal.tue.le (8.12.3/8.12.3) with ESMTP id g6GDvBUM072781
	for <FreeBSD-gnats-submit@freebsd.org>; Tue, 16 Jul 2002 15:57:11 +0200 (CEST)
	(envelope-from thz@mezcal.tue.le)
Received: (from thz@localhost)
	by mezcal.tue.le (8.12.3/8.12.3/Submit) id g6GDvBIs072780;
	Tue, 16 Jul 2002 15:57:11 +0200 (CEST)
	(envelope-from thz)
Message-Id: <200207161357.g6GDvBIs072780@mezcal.tue.le>
Date: Tue, 16 Jul 2002 15:57:11 +0200 (CEST)
From: Thomas Zenker <thz@Lennartz-electronic.de>
Reply-To: Thomas Zenker <thz@Lennartz-electronic.de>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: patch: sysinstall assigns partition a to swap
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         40655
>Category:       bin
>Synopsis:       patch: sysinstall assigns partition a to swap
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    jhb
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Jul 16 07:00:04 PDT 2002
>Closed-Date:    Thu Dec 11 12:27:06 PST 2003
>Last-Modified:  Thu Dec 11 12:27:06 PST 2003
>Originator:     Thomas Zenker
>Release:        FreeBSD 4.6-RELEASE i386
>Organization:
>Environment:
System: FreeBSD mezcal.tue.le 4.6-RELEASE FreeBSD 4.6-RELEASE #8: Mon Jun 10 11:22:51 CEST 2002 thz@mezcal.tue.le:/usr/obj/usr/src/sys/MEZCAL i386


	applies to all versions of sysinstall
>Description:
	scripted partitioning of a disk can lead to a swap partition
	assigned to partition a (normally root). The problem is caused
	by not reseting a flag, so CHUNK_IS_ROOT contaminates the next
	chunk/slice.
>How-To-Repeat:
	swap is first partition in a slice after assigning the root partition
	in the previous slice.
>Fix:
	Following patch applies to current and stable.

Index: label.c
===================================================================
RCS file: /usr/cvs/FreeBSD/src/usr.sbin/sysinstall/label.c,v
retrieving revision 1.118
diff -u -r1.118 label.c
--- label.c	7 Jun 2002 15:32:05 -0000	1.118
+++ label.c	16 Jul 2002 13:25:34 -0000
@@ -1361,7 +1361,7 @@
     char *cp;
     PartType type;
     PartInfo *p;
-    u_long flags = 0;
+    u_long flags;
     int i, status;
     Device **devs;
     Disk *d;
@@ -1406,6 +1406,7 @@
 		    else {
 			Chunk *tmp;
 
+			flags = 0;
 			if (!strcmp(typ, "swap")) {
 			    type = PART_SWAP;
 			    strcpy(mpoint, "SWAP");
@@ -1414,8 +1415,6 @@
 			    type = PART_FILESYSTEM;
 			    if (!strcmp(mpoint, "/"))
 				flags |= CHUNK_IS_ROOT;
-			    else
-				flags &= ~CHUNK_IS_ROOT;
 			}
 			if (!sz)
 			    sz = space_free(c1);
>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->re 
Responsible-Changed-By: dwmalone 
Responsible-Changed-When: Wed Jul 17 09:35:14 PDT 2002 
Responsible-Changed-Why:  
Release engineers are looking after sysinstall. 

(This is another sensible looking patch for scripted installs). 

http://www.freebsd.org/cgi/query-pr.cgi?pr=40655 
Responsible-Changed-From-To: re->qa 
Responsible-Changed-By: dwmalone 
Responsible-Changed-When: Fri Jul 19 04:10:08 PDT 2002 
Responsible-Changed-Why:  
re@ feel that qa@ is a better list to assign sysinstall PRs to. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=40655 
State-Changed-From-To: open->analyzed 
State-Changed-By: jhb 
State-Changed-When: Tue Nov 12 13:21:30 PST 2002 
State-Changed-Why:  
Committed to current, needs to be MFC'd for 4.8. 


Responsible-Changed-From-To: qa->jhb 
Responsible-Changed-By: jhb 
Responsible-Changed-When: Tue Nov 12 13:21:30 PST 2002 
Responsible-Changed-Why:  
Committed to current, needs to be MFC'd for 4.8. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=40655 
State-Changed-From-To: analyzed->closed 
State-Changed-By: jhb 
State-Changed-When: Thu Dec 11 12:26:50 PST 2003 
State-Changed-Why:  
Fix finally committed to 4.x. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=40655 
>Unformatted:
