Count only partitions where the size was specified and use 1M as
authorSascha Wildner <swildner@dragonflybsd.org>
Sun, 14 Sep 2008 19:15:04 +0000 (19:15 +0000)
committerSascha Wildner <swildner@dragonflybsd.org>
Sun, 14 Sep 2008 19:15:04 +0000 (19:15 +0000)
the theoretical low limit for the '*' partition.

This simplifies the last commit and catches the case where a '*'
partition was specified but the rest of the partitions already
exceeded the slice size.

contrib/bsdinstaller-1.1.6/src/backend/installer/fn_subpart.c

index 8cee800..3df7acf 100644 (file)
@@ -331,7 +331,7 @@ default_capacity(struct storage *s, int mtpt)
 static int
 check_capacity(struct i_fn_args *a)
 {
-       struct subpartition *sp, *rsp = NULL;
+       struct subpartition *sp;
        unsigned long min_capacity[7] = {70, 0, 8, 0, 174, 0, 0};
        unsigned long total_capacity = 0;
        int mtpt;
@@ -342,15 +342,9 @@ check_capacity(struct i_fn_args *a)
        for (sp = slice_subpartition_first(storage_get_selected_slice(a->s));
             sp != NULL; sp = subpartition_next(sp)) {
                if (subpartition_get_capacity(sp) == -1)
-                       rsp = sp;
+                       total_capacity++;
                else
                        total_capacity += subpartition_get_capacity(sp);
-       }
-       if (rsp)
-               total_capacity = slice_get_capacity(storage_get_selected_slice(a->s));
-
-       for (sp = slice_subpartition_first(storage_get_selected_slice(a->s));
-            sp != NULL; sp = subpartition_next(sp)) {
                for (mtpt = 0; def_mountpt[mtpt] != NULL; mtpt++) {
                        if (strcmp(subpartition_get_mountpoint(sp), def_mountpt[mtpt]) == 0 &&
                            min_capacity[mtpt] > 0 &&