From phk@critter.freebsd.dk  Sun Oct 23 10:11:51 2011
Return-Path: <phk@critter.freebsd.dk>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id DE8F6106566B
	for <FreeBSD-gnats-submit@freebsd.org>; Sun, 23 Oct 2011 10:11:51 +0000 (UTC)
	(envelope-from phk@critter.freebsd.dk)
Received: from phk.freebsd.dk (phk.freebsd.dk [130.225.244.222])
	by mx1.freebsd.org (Postfix) with ESMTP id 99C928FC22
	for <FreeBSD-gnats-submit@freebsd.org>; Sun, 23 Oct 2011 10:11:51 +0000 (UTC)
Received: from critter.freebsd.dk (critter.freebsd.dk [192.168.61.3])
	by phk.freebsd.dk (Postfix) with ESMTP id 7632C5C37
	for <FreeBSD-gnats-submit@freebsd.org>; Sun, 23 Oct 2011 09:56:45 +0000 (UTC)
Received: from critter.freebsd.dk (localhost [127.0.0.1])
	by critter.freebsd.dk (8.14.5/8.14.5) with ESMTP id p9N9ujDg006353
	for <FreeBSD-gnats-submit@freebsd.org>; Sun, 23 Oct 2011 09:56:45 GMT
	(envelope-from phk@critter.freebsd.dk)
Received: (from phk@localhost)
	by critter.freebsd.dk (8.14.5/8.14.5/Submit) id p9N9ujk8006352;
	Sun, 23 Oct 2011 09:56:45 GMT
	(envelope-from phk)
Message-Id: <201110230956.p9N9ujk8006352@critter.freebsd.dk>
Date: Sun, 23 Oct 2011 09:56:45 GMT
From: Poul-Henning Kamp <phk@critter.freebsd.dk>
Reply-To: Poul-Henning Kamp <phk@critter.freebsd.dk>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: 9.0-RC1 bsdinstall disk layout trouble
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         161926
>Category:       bin
>Synopsis:       bsdinstall(8): disk layout trouble
>Confidential:   no
>Severity:       serious
>Priority:       low
>Responsible:    nwhitehorn
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sun Oct 23 10:20:01 UTC 2011
>Closed-Date:    Wed Jan 11 04:27:55 UTC 2012
>Last-Modified:  Wed Jan 11 04:27:55 UTC 2012
>Originator:     Poul-Henning Kamp
>Release:        FreeBSD 9.0-RC1 amd64
>Organization:
>Environment:

	Trying to install 9.0-RC1 amd64

>Description:

I tried to install a machine for use with src/tools/sysbuild, and ran
into a number of weird issues.

Here is a blow by blow account:

	ada0 zeroed before boot
	boot dvd
	Choose "Install"

	Keymap Selection -> No
		"non-default key mapping" ???
		What kind of question is that ?

	Guided disk
		Hmm, maybe I should use the manual option,
		lets see, where is the "back" button ?
		Ohh, there are *no* "back" buttons *anywhere* ?

	Partition
	ada0 Modify
		"Invalid argument. arg0 'ada0'
	MBR

	Create
	10GB

	Create
	10GB

	Create
	10GB

	Create
	default size

		Active partition is the last one created ?
		There is no place I can see it ?
		There is no place I can change it ?

	ada0s1 Modify
		"Invalid argument. arg0 'ada0s1'
	BSD
	Create (ada0s1a)
	freebsd, full size, /

	Finish

	Enter shell in new system

	gpart set -a active -i 1 ada0
		Fix the active partition

	sysctl kern.geom.debugflags=16
	gmirror label root ada0

	Fix /etc/fstab ?
		There is no /etc/fstab ?
		Create /etc/fstab: /dev/mirror/roots1a / ufs rw 1 1
	boot0cfg -B /dev/ada0

	reboot

	Comes up
		/etc/fstab now contains ada0s1a ?

	fix /etc/fstab
	add geom_mirror_load="YES" to /boot/loader.conf
	reboot

	Comes up


>How-To-Repeat:
	Per above.

	I tried once before with a disk which contained a Ubuntu installation,
	there I ended up with partition 2 having size of "-37GB" on a 40GB
	drive.

>Fix:

	At the very least, show people what's going on.
	And for goodness sake, add "Back" buttons, OK ?

	You really don't want me to write sysinstall2, right ?  :-)

>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->freebsd-sysinstall 
Responsible-Changed-By: eadler 
Responsible-Changed-When: Sun Oct 23 14:00:23 UTC 2011 
Responsible-Changed-Why:  
generate bugspam 

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

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: bin/161926: commit references a PR
Date: Sun, 23 Oct 2011 16:57:20 +0000 (UTC)

 Author: nwhitehorn
 Date: Sun Oct 23 16:57:10 2011
 New Revision: 226666
 URL: http://svn.freebsd.org/changeset/base/226666
 
 Log:
   Avoid some "Invalid argument" errors in the installer.
   
   PR:		bin/161926
   MFC after:	5 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	Sun Oct 23 16:27:03 2011	(r226665)
 +++ head/usr.sbin/bsdinstall/partedit/gpart_ops.c	Sun Oct 23 16:57:10 2011	(r226666)
 @@ -392,8 +392,14 @@ gpart_destroy(struct ggeom *lg_geom)
  	gctl_ro_param(r, "force", sizeof(force), &force);
  	gctl_ro_param(r, "verb", -1, "destroy");
  	errstr = gctl_issue(r);
 -	if (errstr != NULL && errstr[0] != '\0') 
 -		gpart_show_error("Error", NULL, errstr);
 +	if (errstr != NULL && errstr[0] != '\0') {
 +		/*
 +		 * Check if we reverted away the existence of the geom
 +		 * altogether. Show all other errors to the user.
 +		 */
 +		if (strtol(errstr, NULL, 0) != EINVAL)
 +			gpart_show_error("Error", NULL, errstr);
 +	}
  	gctl_free(r);
  
  	/* And any metadata associated with the partition scheme itself */
 @@ -450,6 +456,10 @@ gpart_edit(struct gprovider *pp)
  				return;
  			}
  
 +			/* If this is a nested partition, edit as usual */
 +			if (strcmp(pp->lg_geom->lg_class->lg_name, "PART") == 0)
 +				break;
 +
  			/* Destroy the geom and all sub-partitions */
  			gpart_destroy(cp->lg_geom);
  
 @@ -507,7 +517,7 @@ editpart:
  	choice = dlg_form("Edit Partition", "", 0, 0, 0, nitems, items, &junk);
  
  	if (choice) /* Cancel pressed */
 -		return;
 +		goto endedit;
  
  	/* Check if the label has a / in it */
  	if (strchr(items[3].text, '/') != NULL) {
 @@ -538,6 +548,13 @@ editpart:
  	    items[2].text, (strcmp(oldtype, items[0].text) != 0) ?
  	    newfs : NULL);
  
 +endedit:
 +	if (strcmp(oldtype, items[0].text) != 0 && cp != NULL)
 +		gpart_destroy(cp->lg_geom);
 +	if (strcmp(oldtype, items[0].text) != 0 && strcmp(items[0].text,
 +	    "freebsd") == 0)
 +		gpart_partition(pp->lg_name, "BSD");
 +
  	for (i = 0; i < (sizeof(items) / sizeof(items[0])); i++)
  		if (items[i].text_free)
  			free(items[i].text);
 _______________________________________________
 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"
 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: bin/161926: commit references a PR
Date: Sun,  6 Nov 2011 16:38:03 +0000 (UTC)

 Author: nwhitehorn
 Date: Sun Nov  6 16:37:50 2011
 New Revision: 227222
 URL: http://svn.freebsd.org/changeset/base/227222
 
 Log:
   MFC r226666,226739,226741:
   Avoid showing the user some spurious error messages from GEOM [1] and do
   provide error messages instead of silent failure if there are no disks
   or no network interfaces in the system [2].
   
   PR:		bin/161926 [1], bin/161926 [2]
   Approved by:	re (kib)
 
 Modified:
   stable/9/usr.sbin/bsdinstall/partedit/gpart_ops.c
   stable/9/usr.sbin/bsdinstall/partedit/partedit.c
   stable/9/usr.sbin/bsdinstall/scripts/netconfig
 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	Sun Nov  6 16:37:15 2011	(r227221)
 +++ stable/9/usr.sbin/bsdinstall/partedit/gpart_ops.c	Sun Nov  6 16:37:50 2011	(r227222)
 @@ -392,8 +392,14 @@ gpart_destroy(struct ggeom *lg_geom)
  	gctl_ro_param(r, "force", sizeof(force), &force);
  	gctl_ro_param(r, "verb", -1, "destroy");
  	errstr = gctl_issue(r);
 -	if (errstr != NULL && errstr[0] != '\0') 
 -		gpart_show_error("Error", NULL, errstr);
 +	if (errstr != NULL && errstr[0] != '\0') {
 +		/*
 +		 * Check if we reverted away the existence of the geom
 +		 * altogether. Show all other errors to the user.
 +		 */
 +		if (strtol(errstr, NULL, 0) != EINVAL)
 +			gpart_show_error("Error", NULL, errstr);
 +	}
  	gctl_free(r);
  
  	/* And any metadata associated with the partition scheme itself */
 @@ -450,6 +456,10 @@ gpart_edit(struct gprovider *pp)
  				return;
  			}
  
 +			/* If this is a nested partition, edit as usual */
 +			if (strcmp(pp->lg_geom->lg_class->lg_name, "PART") == 0)
 +				break;
 +
  			/* Destroy the geom and all sub-partitions */
  			gpart_destroy(cp->lg_geom);
  
 @@ -507,7 +517,7 @@ editpart:
  	choice = dlg_form("Edit Partition", "", 0, 0, 0, nitems, items, &junk);
  
  	if (choice) /* Cancel pressed */
 -		return;
 +		goto endedit;
  
  	/* Check if the label has a / in it */
  	if (strchr(items[3].text, '/') != NULL) {
 @@ -538,6 +548,13 @@ editpart:
  	    items[2].text, (strcmp(oldtype, items[0].text) != 0) ?
  	    newfs : NULL);
  
 +endedit:
 +	if (strcmp(oldtype, items[0].text) != 0 && cp != NULL)
 +		gpart_destroy(cp->lg_geom);
 +	if (strcmp(oldtype, items[0].text) != 0 && strcmp(items[0].text,
 +	    "freebsd") == 0)
 +		gpart_partition(pp->lg_name, "BSD");
 +
  	for (i = 0; i < (sizeof(items) / sizeof(items[0])); i++)
  		if (items[i].text_free)
  			free(items[i].text);
 
 Modified: stable/9/usr.sbin/bsdinstall/partedit/partedit.c
 ==============================================================================
 --- stable/9/usr.sbin/bsdinstall/partedit/partedit.c	Sun Nov  6 16:37:15 2011	(r227221)
 +++ stable/9/usr.sbin/bsdinstall/partedit/partedit.c	Sun Nov  6 16:37:50 2011	(r227222)
 @@ -70,7 +70,7 @@ main(int argc, const char **argv)
  {
  	struct partition_metadata *md;
  	const char *prompt;
 -	struct partedit_item *items;
 +	struct partedit_item *items = NULL;
  	struct gmesh mesh;
  	int i, op, nitems, nscroll;
  	int error;
 @@ -99,12 +99,21 @@ main(int argc, const char **argv)
  
  	/* Show the part editor either immediately, or to confirm wizard */
  	while (1) {
 -		error = geom_gettree(&mesh);
 -		items = read_geom_mesh(&mesh, &nitems);
 -		get_mount_points(items, nitems);
  		dlg_clear();
  		dlg_put_backtitle();
  
 +		error = geom_gettree(&mesh);
 +		if (error == 0)
 +			items = read_geom_mesh(&mesh, &nitems);
 +		if (error || items == NULL) {
 +			dialog_msgbox("Error", "No disks found. If you need to "
 +			    "install a kernel driver, choose Shell at the "
 +			    "installation menu.", 0, 0, TRUE);
 +			break;
 +		}
 +			
 +		get_mount_points(items, nitems);
 +
  		if (i >= nitems)
  			i = nitems - 1;
  		op = diskeditor_show("Partition Editor", prompt,
 
 Modified: stable/9/usr.sbin/bsdinstall/scripts/netconfig
 ==============================================================================
 --- stable/9/usr.sbin/bsdinstall/scripts/netconfig	Sun Nov  6 16:37:15 2011	(r227221)
 +++ stable/9/usr.sbin/bsdinstall/scripts/netconfig	Sun Nov  6 16:37:50 2011	(r227222)
 @@ -49,6 +49,13 @@ for IF in `ifconfig -l`; do
  	DIALOG_TAGS="$DIALOG_TAGS $IF \"$DESC\""
  done
  
 +if [ -z "$INTERFACES" ]; then
 +	dialog --backtitle 'FreeBSD Installer' \
 +	    --title 'Network Configuration Error' \
 +	    --msgbox 'No network interfaces present to configure.' 0 0
 +	exit 1
 +fi
 +
  exec 3>&1
  INTERFACE=`echo $DIALOG_TAGS | xargs dialog --backtitle 'FreeBSD Installer' --title 'Network Configuration' --menu 'Please select a network interface to configure:' 0 0 0 2>&1 1>&3`
  if [ $? -eq $DIALOG_CANCEL ]; then exit 1; fi
 _______________________________________________
 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"
 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: bin/161926: commit references a PR
Date: Sun,  6 Nov 2011 16:38:04 +0000 (UTC)

 Author: nwhitehorn
 Date: Sun Nov  6 16:37:50 2011
 New Revision: 227222
 URL: http://svn.freebsd.org/changeset/base/227222
 
 Log:
   MFC r226666,226739,226741:
   Avoid showing the user some spurious error messages from GEOM [1] and do
   provide error messages instead of silent failure if there are no disks
   or no network interfaces in the system [2].
   
   PR:		bin/161926 [1], bin/161926 [2]
   Approved by:	re (kib)
 
 Modified:
   stable/9/usr.sbin/bsdinstall/partedit/gpart_ops.c
   stable/9/usr.sbin/bsdinstall/partedit/partedit.c
   stable/9/usr.sbin/bsdinstall/scripts/netconfig
 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	Sun Nov  6 16:37:15 2011	(r227221)
 +++ stable/9/usr.sbin/bsdinstall/partedit/gpart_ops.c	Sun Nov  6 16:37:50 2011	(r227222)
 @@ -392,8 +392,14 @@ gpart_destroy(struct ggeom *lg_geom)
  	gctl_ro_param(r, "force", sizeof(force), &force);
  	gctl_ro_param(r, "verb", -1, "destroy");
  	errstr = gctl_issue(r);
 -	if (errstr != NULL && errstr[0] != '\0') 
 -		gpart_show_error("Error", NULL, errstr);
 +	if (errstr != NULL && errstr[0] != '\0') {
 +		/*
 +		 * Check if we reverted away the existence of the geom
 +		 * altogether. Show all other errors to the user.
 +		 */
 +		if (strtol(errstr, NULL, 0) != EINVAL)
 +			gpart_show_error("Error", NULL, errstr);
 +	}
  	gctl_free(r);
  
  	/* And any metadata associated with the partition scheme itself */
 @@ -450,6 +456,10 @@ gpart_edit(struct gprovider *pp)
  				return;
  			}
  
 +			/* If this is a nested partition, edit as usual */
 +			if (strcmp(pp->lg_geom->lg_class->lg_name, "PART") == 0)
 +				break;
 +
  			/* Destroy the geom and all sub-partitions */
  			gpart_destroy(cp->lg_geom);
  
 @@ -507,7 +517,7 @@ editpart:
  	choice = dlg_form("Edit Partition", "", 0, 0, 0, nitems, items, &junk);
  
  	if (choice) /* Cancel pressed */
 -		return;
 +		goto endedit;
  
  	/* Check if the label has a / in it */
  	if (strchr(items[3].text, '/') != NULL) {
 @@ -538,6 +548,13 @@ editpart:
  	    items[2].text, (strcmp(oldtype, items[0].text) != 0) ?
  	    newfs : NULL);
  
 +endedit:
 +	if (strcmp(oldtype, items[0].text) != 0 && cp != NULL)
 +		gpart_destroy(cp->lg_geom);
 +	if (strcmp(oldtype, items[0].text) != 0 && strcmp(items[0].text,
 +	    "freebsd") == 0)
 +		gpart_partition(pp->lg_name, "BSD");
 +
  	for (i = 0; i < (sizeof(items) / sizeof(items[0])); i++)
  		if (items[i].text_free)
  			free(items[i].text);
 
 Modified: stable/9/usr.sbin/bsdinstall/partedit/partedit.c
 ==============================================================================
 --- stable/9/usr.sbin/bsdinstall/partedit/partedit.c	Sun Nov  6 16:37:15 2011	(r227221)
 +++ stable/9/usr.sbin/bsdinstall/partedit/partedit.c	Sun Nov  6 16:37:50 2011	(r227222)
 @@ -70,7 +70,7 @@ main(int argc, const char **argv)
  {
  	struct partition_metadata *md;
  	const char *prompt;
 -	struct partedit_item *items;
 +	struct partedit_item *items = NULL;
  	struct gmesh mesh;
  	int i, op, nitems, nscroll;
  	int error;
 @@ -99,12 +99,21 @@ main(int argc, const char **argv)
  
  	/* Show the part editor either immediately, or to confirm wizard */
  	while (1) {
 -		error = geom_gettree(&mesh);
 -		items = read_geom_mesh(&mesh, &nitems);
 -		get_mount_points(items, nitems);
  		dlg_clear();
  		dlg_put_backtitle();
  
 +		error = geom_gettree(&mesh);
 +		if (error == 0)
 +			items = read_geom_mesh(&mesh, &nitems);
 +		if (error || items == NULL) {
 +			dialog_msgbox("Error", "No disks found. If you need to "
 +			    "install a kernel driver, choose Shell at the "
 +			    "installation menu.", 0, 0, TRUE);
 +			break;
 +		}
 +			
 +		get_mount_points(items, nitems);
 +
  		if (i >= nitems)
  			i = nitems - 1;
  		op = diskeditor_show("Partition Editor", prompt,
 
 Modified: stable/9/usr.sbin/bsdinstall/scripts/netconfig
 ==============================================================================
 --- stable/9/usr.sbin/bsdinstall/scripts/netconfig	Sun Nov  6 16:37:15 2011	(r227221)
 +++ stable/9/usr.sbin/bsdinstall/scripts/netconfig	Sun Nov  6 16:37:50 2011	(r227222)
 @@ -49,6 +49,13 @@ for IF in `ifconfig -l`; do
  	DIALOG_TAGS="$DIALOG_TAGS $IF \"$DESC\""
  done
  
 +if [ -z "$INTERFACES" ]; then
 +	dialog --backtitle 'FreeBSD Installer' \
 +	    --title 'Network Configuration Error' \
 +	    --msgbox 'No network interfaces present to configure.' 0 0
 +	exit 1
 +fi
 +
  exec 3>&1
  INTERFACE=`echo $DIALOG_TAGS | xargs dialog --backtitle 'FreeBSD Installer' --title 'Network Configuration' --menu 'Please select a network interface to configure:' 0 0 0 2>&1 1>&3`
  if [ $? -eq $DIALOG_CANCEL ]; then exit 1; fi
 _______________________________________________
 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: linimon 
State-Changed-When: Wed Jan 11 04:27:32 UTC 2012 
State-Changed-Why:  
Already committed and MFCed to 9. 


Responsible-Changed-From-To: freebsd-sysinstall->nwhitehorn 
Responsible-Changed-By: linimon 
Responsible-Changed-When: Wed Jan 11 04:27:32 UTC 2012 
Responsible-Changed-Why:  

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