From owner-svn-src-user@FreeBSD.ORG Sun Jan 30 15:05:11 2011 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2017C1065670; Sun, 30 Jan 2011 15:05:11 +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 107698FC1D; Sun, 30 Jan 2011 15:05:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0UF5ANt075571; Sun, 30 Jan 2011 15:05:10 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0UF5AwJ075569; Sun, 30 Jan 2011 15:05:10 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201101301505.p0UF5AwJ075569@svn.freebsd.org> From: Nathan Whitehorn Date: Sun, 30 Jan 2011 15:05:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r218094 - user/nwhitehorn/bsdinstall/partedit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 30 Jan 2011 15:05:11 -0000 Author: nwhitehorn Date: Sun Jan 30 15:05:10 2011 New Revision: 218094 URL: http://svn.freebsd.org/changeset/base/218094 Log: Make size adjustment for boot partitions somewhat cleaner. Modified: user/nwhitehorn/bsdinstall/partedit/gpart_ops.c Modified: user/nwhitehorn/bsdinstall/partedit/gpart_ops.c ============================================================================== --- user/nwhitehorn/bsdinstall/partedit/gpart_ops.c Sun Jan 30 14:22:45 2011 (r218093) +++ user/nwhitehorn/bsdinstall/partedit/gpart_ops.c Sun Jan 30 15:05:10 2011 (r218094) @@ -695,18 +695,13 @@ gpart_create(struct gprovider *pp, char if (geom == NULL) return; - size = gpart_max_free(geom, &firstfree); + maxsize = size = gpart_max_free(geom, &firstfree); if (size <= 0) { dialog_msgbox("Error", "No free space left on device.", 0, 0, TRUE); return; } - /* Leave a free megabyte in case we need to write a boot partition */ - if (size*sector >= (intmax_t)bootpart_size(scheme)) - size -= bootpart_size(scheme)/sector; - maxsize = size; - humanize_number(sizestr, 7, size*sector, "B", HN_AUTOSCALE, HN_NOSPACE | HN_DECIMAL); items[1].text = sizestr; @@ -818,6 +813,7 @@ addpartform: /* Now adjust the part we are really adding forward */ firstfree += bootpart_size(scheme) / sector; + size -= (bootpart_size(scheme) + stripe)/sector; if (stripe > 0 && (firstfree*sector % stripe) != 0) firstfree += (stripe - ((firstfree*sector) % stripe)) / sector;