Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 24 Jan 2011 18:24:28 +0000 (UTC)
From:      Nathan Whitehorn <nwhitehorn@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-user@freebsd.org
Subject:   svn commit: r217799 - user/nwhitehorn/bsdinstall/partedit
Message-ID:  <201101241824.p0OIOS1I002012@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: nwhitehorn
Date: Mon Jan 24 18:24:28 2011
New Revision: 217799
URL: http://svn.freebsd.org/changeset/base/217799

Log:
  Warn the user if they choose to keep the existing partitioning, but
  the selected disk is unbootable on this platform.

Modified:
  user/nwhitehorn/bsdinstall/partedit/part_wizard.c

Modified: user/nwhitehorn/bsdinstall/partedit/part_wizard.c
==============================================================================
--- user/nwhitehorn/bsdinstall/partedit/part_wizard.c	Mon Jan 24 18:11:37 2011	(r217798)
+++ user/nwhitehorn/bsdinstall/partedit/part_wizard.c	Mon Jan 24 18:24:28 2011	(r217799)
@@ -201,6 +201,24 @@ query:
 	dialog_vars.no_label = NULL;
 	dialog_vars.defaultno = FALSE;
 
+	if (choice == 1 && scheme != NULL && !is_scheme_bootable(scheme)) {
+		char warning[512];
+		int subchoice;
+
+		sprintf(warning, "The existing partition scheme on this "
+		    "disk (%s) is not bootable on this platform. To install "
+		    "FreeBSD, it must be repartitioned. This will destroy all "
+		    "data on the disk. Are you sure you want to proceed?",
+		    scheme);
+		subchoice = dialog_yesno("Non-bootable Disk", warning, 0, 0);
+		if (subchoice != 0)
+			goto query;
+
+		gpart_destroy(gpart, 1);
+		gpart_partition(disk, default_scheme());
+		scheme = default_scheme();
+	}
+
 	if (scheme == NULL || strcmp(scheme, "(none)") == 0 || choice == 0) {
 		if (gpart != NULL) { /* Erase partitioned disk */
 			choice = dialog_yesno("Confirmation", "This will erase "



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201101241824.p0OIOS1I002012>