Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 22 Aug 2003 11:50:14 -0700 (PDT)
From:      Robert Watson <rwatson@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 36693 for review
Message-ID:  <200308221850.h7MIoEuA031505@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=36693

Change 36693 by rwatson@rwatson_tislabs on 2003/08/22 11:50:11

	Hypothetical support for specifying the -l flag in sysinstall
	when creating new file systems by hitting "L" in the labeling
	tool.

Affected files ...

.. //depot/projects/trustedbsd/mac/usr.sbin/sysinstall/install.c#21 edit
.. //depot/projects/trustedbsd/mac/usr.sbin/sysinstall/label.c#19 edit
.. //depot/projects/trustedbsd/mac/usr.sbin/sysinstall/sysinstall.h#18 edit

Differences ...

==== //depot/projects/trustedbsd/mac/usr.sbin/sysinstall/install.c#21 (text+ko) ====

@@ -885,10 +885,11 @@
 	if (pi->do_newfs) {
 		switch(pi->newfs_type) {
 		case NEWFS_UFS:
-			snprintf(buffer, LINE_MAX, "%s %s %s %s %s",
+			snprintf(buffer, LINE_MAX, "%s %s %s %s %s %s",
 			    NEWFS_UFS_CMD,
 			    pi->newfs_data.newfs_ufs.softupdates ?  "-U" : "",
 			    pi->newfs_data.newfs_ufs.ufs1 ? "-O1" : "-O2",
+			    pi->newfs_data.newfs_ufs.multilabel ? "-l" : "",
 			    pi->newfs_data.newfs_ufs.user_options,
 			    dname);
 			break;

==== //depot/projects/trustedbsd/mac/usr.sbin/sysinstall/label.c#19 (text+ko) ====

@@ -463,9 +463,10 @@
 
     switch (p->newfs_type) {
     case NEWFS_UFS:
-	snprintf(buffer, NEWFS_CMD_ARGS_MAX, "%s %s %s %s",
+	snprintf(buffer, NEWFS_CMD_ARGS_MAX, "%s %s %s %s %s",
 	    NEWFS_UFS_CMD, p->newfs_data.newfs_ufs.softupdates ?  "-U" : "",
 	    p->newfs_data.newfs_ufs.ufs1 ? "-O1" : "-O2",
+	    p->newfs_data.newfs_ufs.multilabel ? "-l" : "",
 	    p->newfs_data.newfs_ufs.user_options);
 	break;
     case NEWFS_MSDOS:
@@ -519,7 +520,8 @@
 static void
 print_label_chunks(void)
 {
-    int  i, j, spaces, srow, prow, pcol;
+    int  j, spaces, srow, prow, pcol;
+    int  needspaces = 0, i;
     int  sz;
     char clrmsg[80];
     int ChunkPartStartRow;
@@ -689,15 +691,22 @@
 
 		switch (pi->newfs_type) {
 		case NEWFS_UFS:
+
 			strcpy(newfs, NEWFS_UFS_STRING);
 			if (pi->newfs_data.newfs_ufs.ufs1)
 				strcat(newfs, "1");
 			else
 				strcat(newfs, "2");
 			if (pi->newfs_data.newfs_ufs.softupdates)
-				strcat(newfs, "+S");
+				strcat(newfs, "S");
+			else
+				needspaces++;
+			if (pi->newfs_data.newfs_ufs.multilabel)
+				strcat(newfs, "L");
 			else
-				strcat(newfs, "  ");
+				needspaces++;
+			for (j = 0; j < needspaces; i++)
+				strcat(newfs, " ");
 
 			break;
 		case NEWFS_MSDOS:
@@ -1078,6 +1087,19 @@
 	    record_label_chunks(devs, dev);
 	    break;
 
+	case 'L':	/* toggle multilabel */
+	    if (label_chunk_info[here].type == PART_FILESYSTEM) {
+		PartInfo *pi =
+		    ((PartInfo *)label_chunk_info[here].c->private_data);
+
+		if ((pi != NULL) &&
+		    (pi->newfs_type == NEWFS_UFS)) {
+			pi->newfs_data.newfs_ufs.multilabel =
+			    !pi->newfs_data.newfs_ufs.multilabel;
+		} else msg = MSG_NOT_APPLICABLE;
+	    } else msg = MSG_NOT_APPLICABLE;
+	    break;
+
 	case 'M':	/* mount */
 	    switch(label_chunk_info[here].type) {
 	    case PART_SLICE:

==== //depot/projects/trustedbsd/mac/usr.sbin/sysinstall/sysinstall.h#18 (text+ko) ====



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200308221850.h7MIoEuA031505>