summaryrefslogtreecommitdiffstats
path: root/usr.sbin/sysinstall
diff options
context:
space:
mode:
authormarcel <marcel@FreeBSD.org>2002-11-14 01:46:20 +0000
committermarcel <marcel@FreeBSD.org>2002-11-14 01:46:20 +0000
commitdfa993f696df610240e67a7ca2e65c6f3a4742f1 (patch)
tree1c4d4d682fd876a665f7e7b094bfaaeffca099d6 /usr.sbin/sysinstall
parented16ce021a0ae9508c8a87f34b8a6b4e6ea6fd1f (diff)
downloadFreeBSD-src-dfa993f696df610240e67a7ca2e65c6f3a4742f1.zip
FreeBSD-src-dfa993f696df610240e67a7ca2e65c6f3a4742f1.tar.gz
Add conditional code specific to ia64 to allow newfs(8)-ing FAT
partitions marked as being of type efi. This change adds code to 1. actually run the newfs command at mount time (install.c), 2. display the newfs state on screen (label.c) 3. allow toggling of the newfs state (label.c) Even though newfs(8)-ing FAT partitions can be of use on i386 machines in general, it has been opted to minimize impact for now.
Diffstat (limited to 'usr.sbin/sysinstall')
-rw-r--r--usr.sbin/sysinstall/install.c12
-rw-r--r--usr.sbin/sysinstall/label.c50
2 files changed, 59 insertions, 3 deletions
diff --git a/usr.sbin/sysinstall/install.c b/usr.sbin/sysinstall/install.c
index 52cc632..b6d26c9 100644
--- a/usr.sbin/sysinstall/install.c
+++ b/usr.sbin/sysinstall/install.c
@@ -1038,12 +1038,22 @@ installFilesystems(dialogMenuItem *self)
}
}
}
- else if ((c1->type == fat || c1->type == efi) && c1->private_data && (root->newfs || upgrade)) {
+ else if (c1->type == fat && c1->private_data && (root->newfs || upgrade)) {
char name[FILENAME_MAX];
sprintf(name, "%s/%s", RunningAsInit ? "/mnt" : "", ((PartInfo *)c1->private_data)->mountpoint);
Mkdir(name);
}
+#if defined(__ia64__)
+ else if (c1->type == efi && c1->private_data) {
+ PartInfo *pi = (PartInfo *)c1->private_data;
+
+ if (pi->newfs && (!upgrade || !msgNoYes("You are upgrading - are you SURE you want to newfs /dev/%s?", c1->name)))
+ command_shell_add(pi->mountpoint, "%s %s/dev/%s", pi->newfs_cmd, RunningAsInit ? "/mnt" : "", c1->name);
+
+ command_func_add(pi->mountpoint, Mount, c1->name);
+ }
+#endif
}
}
diff --git a/usr.sbin/sysinstall/label.c b/usr.sbin/sysinstall/label.c
index 62f0024..ba2d655 100644
--- a/usr.sbin/sysinstall/label.c
+++ b/usr.sbin/sysinstall/label.c
@@ -336,6 +336,25 @@ new_part(char *mpoint, Boolean newfs)
return ret;
}
+#if defined(__ia64__)
+static PartInfo *
+new_efi_part(char *mpoint, Boolean newfs)
+{
+ PartInfo *ret;
+
+ if (!mpoint)
+ mpoint = "/efi";
+
+ ret = (PartInfo *)safe_malloc(sizeof(PartInfo));
+ sstrncpy(ret->mountpoint, mpoint, FILENAME_MAX);
+ /* XXX */
+ strcpy(ret->newfs_cmd, "newfs_msdos ");
+ ret->newfs = newfs;
+ ret->soft = 0;
+ return ret;
+}
+#endif
+
/* Get the mountpoint for a partition and save it away */
static PartInfo *
get_mountpoint(struct chunk *old)
@@ -600,8 +619,17 @@ print_label_chunks(void)
mountpoint = "<none>";
/* Now display the newfs field */
- if (label_chunk_info[i].type == PART_FAT)
- strcpy(newfs, "DOS");
+ if (label_chunk_info[i].type == PART_FAT) {
+ strcpy(newfs, "DOS");
+#if defined(__ia64__)
+ if (label_chunk_info[i].c->private_data &&
+ label_chunk_info[i].c->type == efi) {
+ strcat(newfs, " ");
+ PartInfo *pi = (PartInfo *)label_chunk_info[i].c->private_data;
+ strcat(newfs, pi->newfs ? " Y" : " N");
+ }
+#endif
+ }
else if (label_chunk_info[i].c->private_data && label_chunk_info[i].type == PART_FILESYSTEM) {
strcpy(newfs, "UFS");
strcat(newfs,
@@ -1018,6 +1046,24 @@ diskLabel(Device *dev)
if (variable_cmp(DISK_LABELLED, "written"))
variable_set2(DISK_LABELLED, "yes", 0);
}
+#if defined(__ia64__)
+ else if (label_chunk_info[here].type == PART_FAT &&
+ label_chunk_info[here].c->type == efi &&
+ label_chunk_info[here].c->private_data) {
+ PartInfo *pi = ((PartInfo *)label_chunk_info[here].c->private_data);
+ if (!pi->newfs)
+ label_chunk_info[here].c->flags |= CHUNK_NEWFS;
+ else
+ label_chunk_info[here].c->flags &= ~CHUNK_NEWFS;
+
+ label_chunk_info[here].c->private_data =
+ new_efi_part(pi->mountpoint, !pi->newfs);
+ safe_free(pi);
+ label_chunk_info[here].c->private_free = safe_free;
+ if (variable_cmp(DISK_LABELLED, "written"))
+ variable_set2(DISK_LABELLED, "yes", 0);
+ }
+#endif
else
msg = MSG_NOT_APPLICABLE;
break;
OpenPOWER on IntegriCloud