From nobody@FreeBSD.org  Fri Sep 23 03:59:05 2011
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 77DFD106566B
	for <freebsd-gnats-submit@FreeBSD.org>; Fri, 23 Sep 2011 03:59:05 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from red.freebsd.org (red.freebsd.org [IPv6:2001:4f8:fff6::22])
	by mx1.freebsd.org (Postfix) with ESMTP id 67C1E8FC12
	for <freebsd-gnats-submit@FreeBSD.org>; Fri, 23 Sep 2011 03:59:05 +0000 (UTC)
Received: from red.freebsd.org (localhost [127.0.0.1])
	by red.freebsd.org (8.14.4/8.14.4) with ESMTP id p8N3x5vP097976
	for <freebsd-gnats-submit@FreeBSD.org>; Fri, 23 Sep 2011 03:59:05 GMT
	(envelope-from nobody@red.freebsd.org)
Received: (from nobody@localhost)
	by red.freebsd.org (8.14.4/8.14.4/Submit) id p8N3x5Jl097973;
	Fri, 23 Sep 2011 03:59:05 GMT
	(envelope-from nobody)
Message-Id: <201109230359.p8N3x5Jl097973@red.freebsd.org>
Date: Fri, 23 Sep 2011 03:59:05 GMT
From: Warren Block <wblock@wonkity.com>
To: freebsd-gnats-submit@FreeBSD.org
Subject: bsdinstall: partition editor does not check for freebsd-boot partition
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         160931
>Category:       bin
>Synopsis:       bsdinstall(8): partition editor does not check for freebsd-boot partition
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-sysinstall
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri Sep 23 04:00:18 UTC 2011
>Closed-Date:    Sat Oct 08 15:01:32 UTC 2011
>Last-Modified:  Tue Oct 11 13:20:02 UTC 2011
>Originator:     Warren Block
>Release:        9.0-BETA2
>Organization:
>Environment:
FreeBSD testing 9.0-BETA2 FreeBSD 9.0-BETA2 #0: Tue Sep 20 10:11:30 UTC 2011 gjb@kaos.glenbarber.us:/usr/obj/usr/src/sys/GENERIC  amd64
>Description:
The bsdinstall partition editor does not check for an existing freebsd-boot partition.


>How-To-Repeat:
In bsdinstall at the Partitioning screen, select Manual.
Choose GPT.
Create a freebsd-boot partition, size 1M, no mountpoint, label gpboot.
Create a freebsd-ufs partition, size 10G, mountpoint /, label gprootfs.

On selecting Okay, the partition editor shows:

  This partition scheme requires
  a boot partition for the disk
  to be bootable. Would you like
  to make one now?

Of course, there's already a freebsd-boot partition.
>Fix:
Add a check for an existing freebsd-boot partition to gpart_ops.c, about line 918.

>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->freebsd-sysinstall 
Responsible-Changed-By: eadler 
Responsible-Changed-When: Thu Oct 6 04:54:46 UTC 2011 
Responsible-Changed-Why:  

fix synopsys and assign 


http://www.freebsd.org/cgi/query-pr.cgi?pr=160931 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: bin/160931: commit references a PR
Date: Sat,  8 Oct 2011 14:59:21 +0000 (UTC)

 Author: nwhitehorn
 Date: Sat Oct  8 14:59:12 2011
 New Revision: 226160
 URL: http://svn.freebsd.org/changeset/base/226160
 
 Log:
   Usability enhancements: do not allow setting a mountpoint on bsdlabel
   container partitions, which didn't do anything anyway, and check for
   an existing freebsd-boot partition before bothering the user to make one.
   
   PR:		bin/160931
   MFC after:	3 days
 
 Modified:
   head/usr.sbin/bsdinstall/partedit/gpart_ops.c
 
 Modified: head/usr.sbin/bsdinstall/partedit/gpart_ops.c
 ==============================================================================
 --- head/usr.sbin/bsdinstall/partedit/gpart_ops.c	Sat Oct  8 13:01:38 2011	(r226159)
 +++ head/usr.sbin/bsdinstall/partedit/gpart_ops.c	Sat Oct  8 14:59:12 2011	(r226160)
 @@ -892,6 +892,19 @@ addpartform:
  			goto addpartform;
  	}
  
 +	/*
 +	 * Error if this scheme needs nested partitions, this is one, and
 +	 * a mountpoint was set.
 +	 */
 +	if (strcmp(items[0].text, "freebsd") == 0 &&
 +	    strlen(items[2].text) > 0) {
 +		dialog_msgbox("Error", "Partitions of type \"freebsd\" are "
 +		    "nested BSD-type partition schemes and cannot have "
 +		    "mountpoints. After creating one, select it and press "
 +		    "Create again to add the actual file systems.", 0, 0, TRUE);
 +		goto addpartform;
 +	}
 +
  	/* If this is the root partition, check that this scheme is bootable */
  	if (strcmp(items[2].text, "/") == 0 && !is_scheme_bootable(scheme)) {
  		char message[512];
 @@ -909,7 +922,23 @@ addpartform:
  	 * If this is the root partition, and we need a boot partition, ask
  	 * the user to add one.
  	 */
 -	if (strcmp(items[2].text, "/") == 0 && bootpart_size(scheme) > 0) {
 +
 +	/* Check for existing freebsd-boot partition */
 +	LIST_FOREACH(pp, &geom->lg_provider, lg_provider) {
 +		struct partition_metadata *md;
 +		md = get_part_metadata(pp->lg_name, 0);
 +		if (md == NULL || !md->bootcode)
 +			continue;
 +		LIST_FOREACH(gc, &pp->lg_config, lg_config)
 +			if (strcmp(gc->lg_name, "type") == 0)
 +				break;
 +		if (gc != NULL && strcmp(gc->lg_val, "freebsd-boot") == 0)
 +			break;
 +	}
 +
 +	/* If there isn't one, and we need one, ask */
 +	if (strcmp(items[2].text, "/") == 0 && bootpart_size(scheme) > 0 &&
 +	    pp == NULL) {
  		if (interactive)
  			choice = dialog_yesno("Boot Partition",
  			    "This partition scheme requires a boot partition "
 _______________________________________________
 svn-src-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/svn-src-all
 To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
 
State-Changed-From-To: open->closed 
State-Changed-By: nwhitehorn 
State-Changed-When: Sat Oct 8 15:01:07 UTC 2011 
State-Changed-Why:  
Fixed in r226160. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=160931 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: bin/160931: commit references a PR
Date: Tue, 11 Oct 2011 13:19:20 +0000 (UTC)

 Author: nwhitehorn
 Date: Tue Oct 11 13:19:06 2011
 New Revision: 226249
 URL: http://svn.freebsd.org/changeset/base/226249
 
 Log:
   MFC r226160:
   Usability enhancements: do not allow setting a mountpoint on bsdlabel
   container partitions, which didn't do anything anyway, and check for
   an existing freebsd-boot partition before bothering the user to make one.
   
   PR:		bin/160931
   Approved by:	re (kib)
 
 Modified:
   stable/9/usr.sbin/bsdinstall/partedit/gpart_ops.c
 Directory Properties:
   stable/9/usr.sbin/bsdinstall/   (props changed)
 
 Modified: stable/9/usr.sbin/bsdinstall/partedit/gpart_ops.c
 ==============================================================================
 --- stable/9/usr.sbin/bsdinstall/partedit/gpart_ops.c	Tue Oct 11 13:18:44 2011	(r226248)
 +++ stable/9/usr.sbin/bsdinstall/partedit/gpart_ops.c	Tue Oct 11 13:19:06 2011	(r226249)
 @@ -892,6 +892,19 @@ addpartform:
  			goto addpartform;
  	}
  
 +	/*
 +	 * Error if this scheme needs nested partitions, this is one, and
 +	 * a mountpoint was set.
 +	 */
 +	if (strcmp(items[0].text, "freebsd") == 0 &&
 +	    strlen(items[2].text) > 0) {
 +		dialog_msgbox("Error", "Partitions of type \"freebsd\" are "
 +		    "nested BSD-type partition schemes and cannot have "
 +		    "mountpoints. After creating one, select it and press "
 +		    "Create again to add the actual file systems.", 0, 0, TRUE);
 +		goto addpartform;
 +	}
 +
  	/* If this is the root partition, check that this scheme is bootable */
  	if (strcmp(items[2].text, "/") == 0 && !is_scheme_bootable(scheme)) {
  		char message[512];
 @@ -909,7 +922,23 @@ addpartform:
  	 * If this is the root partition, and we need a boot partition, ask
  	 * the user to add one.
  	 */
 -	if (strcmp(items[2].text, "/") == 0 && bootpart_size(scheme) > 0) {
 +
 +	/* Check for existing freebsd-boot partition */
 +	LIST_FOREACH(pp, &geom->lg_provider, lg_provider) {
 +		struct partition_metadata *md;
 +		md = get_part_metadata(pp->lg_name, 0);
 +		if (md == NULL || !md->bootcode)
 +			continue;
 +		LIST_FOREACH(gc, &pp->lg_config, lg_config)
 +			if (strcmp(gc->lg_name, "type") == 0)
 +				break;
 +		if (gc != NULL && strcmp(gc->lg_val, "freebsd-boot") == 0)
 +			break;
 +	}
 +
 +	/* If there isn't one, and we need one, ask */
 +	if (strcmp(items[2].text, "/") == 0 && bootpart_size(scheme) > 0 &&
 +	    pp == NULL) {
  		if (interactive)
  			choice = dialog_yesno("Boot Partition",
  			    "This partition scheme requires a boot partition "
 _______________________________________________
 svn-src-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/svn-src-all
 To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
 
>Unformatted:
