svn commit: r218094 - user/nwhitehorn/bsdinstall/partedit
Nathan Whitehorn
nwhitehorn at FreeBSD.org
Sun Jan 30 15:05:11 UTC 2011
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;
More information about the svn-src-user
mailing list