1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-23 11:18:54 +00:00

If invoked as sade, don't complain about having a filesystem on / already

-- it's something you expect (and indeed hope for).

MFC after:	1 week
This commit is contained in:
Nathan Whitehorn 2012-12-30 14:33:16 +00:00
parent 1bba6bdf13
commit 4f5fcf8d00
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=244858

View File

@ -41,6 +41,7 @@
#include "partedit.h" #include "partedit.h"
struct pmetadata_head part_metadata; struct pmetadata_head part_metadata;
static int sade_mode = 0;
static int apply_changes(struct gmesh *mesh); static int apply_changes(struct gmesh *mesh);
static struct partedit_item *read_geom_mesh(struct gmesh *mesh, int *nitems); static struct partedit_item *read_geom_mesh(struct gmesh *mesh, int *nitems);
@ -75,12 +76,15 @@ main(int argc, const char **argv)
int i, op, nitems, nscroll; int i, op, nitems, nscroll;
int error; int error;
if (strcmp(basename(argv[0]), "sade") == 0)
sade_mode = 1;
TAILQ_INIT(&part_metadata); TAILQ_INIT(&part_metadata);
init_fstab_metadata(); init_fstab_metadata();
init_dialog(stdin, stdout); init_dialog(stdin, stdout);
if (strcmp(basename(argv[0]), "sade") != 0) if (!sade_mode)
dialog_vars.backtitle = __DECONST(char *, "FreeBSD Installer"); dialog_vars.backtitle = __DECONST(char *, "FreeBSD Installer");
dialog_vars.item_help = TRUE; dialog_vars.item_help = TRUE;
nscroll = i = 0; nscroll = i = 0;
@ -261,7 +265,7 @@ validate_setup(void)
* Check for root partitions that we aren't formatting, which is * Check for root partitions that we aren't formatting, which is
* usually a mistake * usually a mistake
*/ */
if (root->newfs == NULL) { if (root->newfs == NULL && !sade_mode) {
dialog_vars.defaultno = TRUE; dialog_vars.defaultno = TRUE;
cancel = dialog_yesno("Warning", "The chosen root partition " cancel = dialog_yesno("Warning", "The chosen root partition "
"has a preexisting filesystem. If it contains an existing " "has a preexisting filesystem. If it contains an existing "