diff options
| author | Nathan Whitehorn <nwhitehorn@FreeBSD.org> | 2012-01-18 15:59:23 +0000 |
|---|---|---|
| committer | Nathan Whitehorn <nwhitehorn@FreeBSD.org> | 2012-01-18 15:59:23 +0000 |
| commit | 6fe359f2922aa49f01310f6b0dc5c3788e55331f (patch) | |
| tree | a7ecc9ad8a8830974ec0fc13c93959a3e5b628d3 /usr.sbin/bsdinstall | |
| parent | 63ae21df93140681638334e1dc63893dd7d06eed (diff) | |
Notes
Diffstat (limited to 'usr.sbin/bsdinstall')
| -rw-r--r-- | usr.sbin/bsdinstall/partedit/partedit.c | 26 |
1 files changed, 22 insertions, 4 deletions
diff --git a/usr.sbin/bsdinstall/partedit/partedit.c b/usr.sbin/bsdinstall/partedit/partedit.c index cddf7901fc5d1..2436f085b2774 100644 --- a/usr.sbin/bsdinstall/partedit/partedit.c +++ b/usr.sbin/bsdinstall/partedit/partedit.c @@ -240,23 +240,41 @@ delete_part_metadata(const char *name) static int validate_setup(void) { - struct partition_metadata *md; - int root_found = FALSE; + struct partition_metadata *md, *root = NULL; + int cancel; TAILQ_FOREACH(md, &part_metadata, metadata) { if (md->fstab != NULL && strcmp(md->fstab->fs_file, "/") == 0) - root_found = TRUE; + root = md; /* XXX: Check for duplicate mountpoints */ } - if (!root_found) { + if (root == NULL) { dialog_msgbox("Error", "No root partition was found. " "The root FreeBSD partition must have a mountpoint of '/'.", 0, 0, TRUE); return (FALSE); } + /* + * Check for root partitions that we aren't formatting, which is + * usually a mistake + */ + if (root->newfs == NULL) { + dialog_vars.defaultno = TRUE; + cancel = dialog_yesno("Warning", "The chosen root partition " + "has a preexisting filesystem. If it contains an existing " + "FreeBSD system, please update it with freebsd-update " + "instead of installing a new system on it. The partition " + "can also be erased by pressing \"No\" and then deleting " + "and recreating it. Are you sure you want to proceed?", + 0, 0); + dialog_vars.defaultno = FALSE; + if (cancel) + return (FALSE); + } + return (TRUE); } |
