PERFORCE change 36693 for review

Robert Watson rwatson at FreeBSD.org
Fri Aug 22 18:50:14 GMT 2003


http://perforce.freebsd.org/chv.cgi?CH=36693

Change 36693 by rwatson at 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) ====

To Unsubscribe: send mail to majordomo at trustedbsd.org
with "unsubscribe trustedbsd-cvs" in the body of the message



More information about the trustedbsd-cvs mailing list