installer: Check the user-entered swap size against our actual limits, too.
authorSascha Wildner <saw@online.de>
Fri, 11 Nov 2011 19:36:13 +0000 (20:36 +0100)
committerSascha Wildner <saw@online.de>
Fri, 11 Nov 2011 19:36:13 +0000 (20:36 +0100)
usr.sbin/installer/dfuibe_installer/fn_subpart_hammer.c
usr.sbin/installer/dfuibe_installer/fn_subpart_ufs.c

index e2e4ac3..df1a34c 100644 (file)
@@ -441,8 +441,9 @@ check_subpartition_selections(struct dfui_response *r, struct i_fn_args *a)
                 * Maybe remove this limit entirely?
                 */
                if ((strcasecmp(mountpoint, "swap") == 0) &&
-                   (capacity > 512*1024)) {
-                       inform(a->c, _("Swap capacity is limited to 512G."));
+                   (capacity > SWAP_MAX)) {
+                       inform(a->c, _("Swap capacity is limited to %dG."),
+                           SWAP_MAX / 1024);
                        valid = 0;
                }
 
index 33dea16..717dbac 100644 (file)
@@ -452,8 +452,9 @@ check_subpartition_selections(struct dfui_response *r, struct i_fn_args *a)
                 * Maybe remove this limit entirely?
                 */
                if ((strcasecmp(mountpoint, "swap") == 0) &&
-                   (capacity > 512*1024)) {
-                       inform(a->c, _("Swap capacity is limited to 512G."));
+                   (capacity > SWAP_MAX)) {
+                       inform(a->c, _("Swap capacity is limited to %dG."),
+                           SWAP_MAX / 1024);
                        valid = 0;
                }