svn commit: r217764 - user/nwhitehorn/bsdinstall/partedit

Nathan Whitehorn nwhitehorn at FreeBSD.org
Sun Jan 23 23:06:15 UTC 2011


Author: nwhitehorn
Date: Sun Jan 23 23:06:15 2011
New Revision: 217764
URL: http://svn.freebsd.org/changeset/base/217764

Log:
  Exclude swap-backed md devices from lists of available install targets.
  The install CD creates some of these for /var and /tmp, and they are
  fundamentally infeasible install targets. vnode-backed md devices remain,
  since they can be used as disk images for virtual machines.
  
  Requested by:	rwatson

Modified:
  user/nwhitehorn/bsdinstall/partedit/part_wizard.c
  user/nwhitehorn/bsdinstall/partedit/partedit.c

Modified: user/nwhitehorn/bsdinstall/partedit/part_wizard.c
==============================================================================
--- user/nwhitehorn/bsdinstall/partedit/part_wizard.c	Sun Jan 23 22:39:31 2011	(r217763)
+++ user/nwhitehorn/bsdinstall/partedit/part_wizard.c	Sun Jan 23 23:06:15 2011	(r217764)
@@ -57,9 +57,11 @@ static char *
 boot_disk(struct gmesh *mesh)
 {
 	struct gclass *classp;
+	struct gconfig *gc;
 	struct ggeom *gp;
 	struct gprovider *pp;
 	DIALOG_LISTITEM *disks = NULL;
+	const char *type;
 	char diskdesc[512];
 	char *chosen;
 	int i, err, selected, n = 0;
@@ -74,6 +76,16 @@ boot_disk(struct gmesh *mesh)
 				continue;
 
 			LIST_FOREACH(pp, &gp->lg_provider, lg_provider) {
+				type = NULL;
+				LIST_FOREACH(gc, &pp->lg_config, lg_config) 
+					if (strcmp(gc->lg_name, "type") == 0) 
+						type = gc->lg_val;
+
+				/* Skip swap-backed md devices */
+				if (strcmp(classp->lg_name, "MD") == 0 &&
+				    type != NULL && strcmp(type, "swap") == 0)
+					continue;
+
 				disks = realloc(disks, (++n)*sizeof(disks[0]));
 				disks[n-1].name = pp->lg_name;
 				humanize_number(diskdesc, 7, pp->lg_mediasize,

Modified: user/nwhitehorn/bsdinstall/partedit/partedit.c
==============================================================================
--- user/nwhitehorn/bsdinstall/partedit/partedit.c	Sun Jan 23 22:39:31 2011	(r217763)
+++ user/nwhitehorn/bsdinstall/partedit/partedit.c	Sun Jan 23 23:06:15 2011	(r217764)
@@ -294,7 +294,7 @@ read_geom_mesh(struct gmesh *mesh, int *
 	items = NULL;
 
 	/*
-	 * Built the device table. First add all disks (and CDs).
+	 * Build the device table. First add all disks (and CDs).
 	 */
 	
 	LIST_FOREACH(classp, &mesh->lg_class, lg_class) {
@@ -346,6 +346,12 @@ add_geom_children(struct ggeom *gp, int 
 			if (strcmp(gc->lg_name, "type") == 0)
 				(*items)[*nitems].type = gc->lg_val;
 		}
+
+		/* Skip swap-backed MD devices */
+		if (strcmp(gp->lg_class->lg_name, "MD") == 0 &&
+		    strcmp((*items)[*nitems].type, "swap") == 0)
+			continue;
+
 		(*nitems)++;
 
 		LIST_FOREACH(cp, &pp->lg_consumers, lg_consumers)


More information about the svn-src-user mailing list