From owner-svn-src-stable@FreeBSD.ORG Tue Oct 11 13:19:06 2011 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 94910106567D; Tue, 11 Oct 2011 13:19:06 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 69D428FC0C; Tue, 11 Oct 2011 13:19:06 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p9BDJ6CE016654; Tue, 11 Oct 2011 13:19:06 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p9BDJ6gl016652; Tue, 11 Oct 2011 13:19:06 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201110111319.p9BDJ6gl016652@svn.freebsd.org> From: Nathan Whitehorn Date: Tue, 11 Oct 2011 13:19:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r226249 - stable/9/usr.sbin/bsdinstall/partedit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Oct 2011 13:19:06 -0000 Author: nwhitehorn Date: Tue Oct 11 13:19:06 2011 New Revision: 226249 URL: http://svn.freebsd.org/changeset/base/226249 Log: MFC r226160: Usability enhancements: do not allow setting a mountpoint on bsdlabel container partitions, which didn't do anything anyway, and check for an existing freebsd-boot partition before bothering the user to make one. PR: bin/160931 Approved by: re (kib) Modified: stable/9/usr.sbin/bsdinstall/partedit/gpart_ops.c Directory Properties: stable/9/usr.sbin/bsdinstall/ (props changed) Modified: stable/9/usr.sbin/bsdinstall/partedit/gpart_ops.c ============================================================================== --- stable/9/usr.sbin/bsdinstall/partedit/gpart_ops.c Tue Oct 11 13:18:44 2011 (r226248) +++ stable/9/usr.sbin/bsdinstall/partedit/gpart_ops.c Tue Oct 11 13:19:06 2011 (r226249) @@ -892,6 +892,19 @@ addpartform: goto addpartform; } + /* + * Error if this scheme needs nested partitions, this is one, and + * a mountpoint was set. + */ + if (strcmp(items[0].text, "freebsd") == 0 && + strlen(items[2].text) > 0) { + dialog_msgbox("Error", "Partitions of type \"freebsd\" are " + "nested BSD-type partition schemes and cannot have " + "mountpoints. After creating one, select it and press " + "Create again to add the actual file systems.", 0, 0, TRUE); + goto addpartform; + } + /* If this is the root partition, check that this scheme is bootable */ if (strcmp(items[2].text, "/") == 0 && !is_scheme_bootable(scheme)) { char message[512]; @@ -909,7 +922,23 @@ addpartform: * If this is the root partition, and we need a boot partition, ask * the user to add one. */ - if (strcmp(items[2].text, "/") == 0 && bootpart_size(scheme) > 0) { + + /* Check for existing freebsd-boot partition */ + LIST_FOREACH(pp, &geom->lg_provider, lg_provider) { + struct partition_metadata *md; + md = get_part_metadata(pp->lg_name, 0); + if (md == NULL || !md->bootcode) + continue; + LIST_FOREACH(gc, &pp->lg_config, lg_config) + if (strcmp(gc->lg_name, "type") == 0) + break; + if (gc != NULL && strcmp(gc->lg_val, "freebsd-boot") == 0) + break; + } + + /* If there isn't one, and we need one, ask */ + if (strcmp(items[2].text, "/") == 0 && bootpart_size(scheme) > 0 && + pp == NULL) { if (interactive) choice = dialog_yesno("Boot Partition", "This partition scheme requires a boot partition "