summaryrefslogtreecommitdiffstats
path: root/usr.sbin/sade/label.c
diff options
context:
space:
mode:
authorrwatson <rwatson@FreeBSD.org>2003-04-20 14:08:05 +0000
committerrwatson <rwatson@FreeBSD.org>2003-04-20 14:08:05 +0000
commit81d6b311020dc650aa2b900f7a08156ffecedba9 (patch)
tree612bd02cab498ba1d982b85c22c699fcaebe3844 /usr.sbin/sade/label.c
parentc805cb45353d8c42f6c2a8ec8844465513a86a4d (diff)
downloadFreeBSD-src-81d6b311020dc650aa2b900f7a08156ffecedba9.zip
FreeBSD-src-81d6b311020dc650aa2b900f7a08156ffecedba9.tar.gz
Throw the switch--change to UFS2 as our default file system format for
FreeBSD 5.1-RELEASE and later: - newfs(8) will now create UFS2 file systems unless UFS1 is specifically requested (-O1). To do this, I just twiddled the Oflag default. - sysinstall(8) will now select UFS2 as the default layout for new file systems unless specifically requested (use '1' and '2' to change the file system layout in the disk labeler). To do this, I inverted the ufs2 flag into a ufs1 flag, since ufs2 is now the default and ufs1 is the edge case. There's a slight semantic change in the key behavior: '2' no longer toggles, it changes the selection to UFS2. This is very similar to a patch David O'Brien sent me at one point, and that I couldn't find. Approved by: re (telecon) Reviewed by: mckusick, phk, bmah
Diffstat (limited to 'usr.sbin/sade/label.c')
-rw-r--r--usr.sbin/sade/label.c28
1 files changed, 21 insertions, 7 deletions
diff --git a/usr.sbin/sade/label.c b/usr.sbin/sade/label.c
index 24d438f..e2ff08c 100644
--- a/usr.sbin/sade/label.c
+++ b/usr.sbin/sade/label.c
@@ -337,7 +337,7 @@ new_part(char *mpoint, Boolean newfs)
pi->newfs_data.newfs_ufs.acls = FALSE;
pi->newfs_data.newfs_ufs.multilabel = FALSE;
pi->newfs_data.newfs_ufs.softupdates = strcmp(mpoint, "/");
- pi->newfs_data.newfs_ufs.ufs2 = FALSE;
+ pi->newfs_data.newfs_ufs.ufs1 = FALSE;
return pi;
}
@@ -461,7 +461,7 @@ getNewfsCmd(PartInfo *p)
case NEWFS_UFS:
snprintf(buffer, NEWFS_CMD_ARGS_MAX, "%s %s %s %s",
NEWFS_UFS_CMD, p->newfs_data.newfs_ufs.softupdates ? "-U" : "",
- p->newfs_data.newfs_ufs.ufs2 ? "-O2" : "-O1",
+ p->newfs_data.newfs_ufs.ufs1 ? "-O1" : "-O2",
p->newfs_data.newfs_ufs.user_options);
break;
case NEWFS_MSDOS:
@@ -686,10 +686,10 @@ print_label_chunks(void)
switch (pi->newfs_type) {
case NEWFS_UFS:
strcpy(newfs, NEWFS_UFS_STRING);
- if (pi->newfs_data.newfs_ufs.ufs2)
- strcat(newfs, "2");
- else
+ if (pi->newfs_data.newfs_ufs.ufs1)
strcat(newfs, "1");
+ else
+ strcat(newfs, "2");
if (pi->newfs_data.newfs_ufs.softupdates)
strcat(newfs, "+S");
else
@@ -872,6 +872,21 @@ diskLabel(Device *dev)
clear_wins();
break;
+ case '1':
+ 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.ufs1 = true;
+ } else
+ msg = MSG_NOT_APPLICABLE;
+ } else
+ msg = MSG_NOT_APPLICABLE;
+ break;
+ break;
+
case '2':
if (label_chunk_info[here].type == PART_FILESYSTEM) {
PartInfo *pi =
@@ -879,8 +894,7 @@ diskLabel(Device *dev)
if ((pi != NULL) &&
(pi->newfs_type == NEWFS_UFS)) {
- pi->newfs_data.newfs_ufs.ufs2 =
- !pi->newfs_data.newfs_ufs.ufs2;
+ pi->newfs_data.newfs_ufs.ufs1 = false;
} else
msg = MSG_NOT_APPLICABLE;
} else
OpenPOWER on IntegriCloud