diff options
Diffstat (limited to 'usr.sbin/sysinstall/install.c')
-rw-r--r-- | usr.sbin/sysinstall/install.c | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/usr.sbin/sysinstall/install.c b/usr.sbin/sysinstall/install.c index cf893d9..2a6a95b 100644 --- a/usr.sbin/sysinstall/install.c +++ b/usr.sbin/sysinstall/install.c @@ -1032,11 +1032,13 @@ installFilesystems(dialogMenuItem *self) Device **devs; PartInfo *root; char dname[80]; + Boolean upgrade = FALSE; /* If we've already done this, bail out */ if (!variable_cmp(DISK_LABELLED, "written")) return DITEM_SUCCESS; + upgrade = !variable_cmp(SYSTEM_STATE, "upgrade"); if (!checkLabels(TRUE)) return DITEM_FAILURE; @@ -1076,7 +1078,9 @@ installFilesystems(dialogMenuItem *self) if (strcmp(root->mountpoint, "/")) msgConfirm("Warning: %s is marked as a root partition but is mounted on %s", RootChunk->name, root->mountpoint); - if (root->do_newfs) { + if (root->do_newfs && (!upgrade || + !msgNoYes("You are upgrading - are you SURE you want to newfs " + "the root partition?"))) { int i; dialog_clear_norefresh(); @@ -1089,7 +1093,9 @@ installFilesystems(dialogMenuItem *self) } } else { - msgConfirm("Warning: Using existing root partition."); + if (!upgrade) { + msgConfirm("Warning: Using existing root partition."); + } dialog_clear_norefresh(); msgNotify("Checking integrity of existing %s filesystem.", dname); i = vsystem("fsck_ffs -y %s", dname); @@ -1173,7 +1179,9 @@ installFilesystems(dialogMenuItem *self) sprintf(dname, "%s/dev/%s", RunningAsInit ? "/mnt" : "", c2->name); - if (tmp->do_newfs) + if (tmp->do_newfs && (!upgrade || + !msgNoYes("You are upgrading - are you SURE you" + " want to newfs /dev/%s?", c2->name))) performNewfs(tmp, dname, QUEUE_YES); else command_shell_add(tmp->mountpoint, @@ -1206,7 +1214,7 @@ installFilesystems(dialogMenuItem *self) } } else if (c1->type == fat && c1->private_data && - (root->do_newfs)) { + (root->do_newfs || upgrade)) { char name[FILENAME_MAX]; sprintf(name, "%s/%s", RunningAsInit ? "/mnt" : "", ((PartInfo *)c1->private_data)->mountpoint); @@ -1219,7 +1227,9 @@ installFilesystems(dialogMenuItem *self) sprintf(dname, "%s/dev/%s", RunningAsInit ? "/mnt" : "", c1->name); - if (pi->do_newfs) + if (pi->do_newfs && (!upgrade || + !msgNoYes("You are upgrading - are you SURE you want to " + "newfs /dev/%s?", c1->name))) performNewfs(pi, dname, QUEUE_YES); command_func_add(pi->mountpoint, Mount_msdosfs, c1->name); |