From 4b22007883e5c938820ebdffbecf9231615aaa4c Mon Sep 17 00:00:00 2001 From: Sascha Wildner Date: Sun, 8 Feb 2009 16:27:46 +0100 Subject: [PATCH] nrelease: Restrict swap size to 8GB for now. --- .../src/backend/installer/fn_subpart.c | 9 +++++++++ .../src/backend/installer/fn_subpart_hammer.c | 7 +++++++ 2 files changed, 16 insertions(+) diff --git a/contrib/bsdinstaller-1.1.6/src/backend/installer/fn_subpart.c b/contrib/bsdinstaller-1.1.6/src/backend/installer/fn_subpart.c index 979087eec4..bb602e1f9a 100644 --- a/contrib/bsdinstaller-1.1.6/src/backend/installer/fn_subpart.c +++ b/contrib/bsdinstaller-1.1.6/src/backend/installer/fn_subpart.c @@ -272,6 +272,10 @@ default_capacity(struct storage *s, int mtpt) swap = 2 * storage_get_memsize(s); if (storage_get_memsize(s) > (capacity / 2) || capacity < 4096) swap = storage_get_memsize(s); + if (storage_get_memsize(s) > capacity) + swap = capacity / 2; + if (swap > 8192) + swap = 8192; if (capacity < DISK_MIN) { /* @@ -455,6 +459,11 @@ check_subpartition_selections(struct dfui_response *r, struct i_fn_args *a) valid = 0; } + if ((strcasecmp(mountpoint, "swap") == 0) && (capacity > 8192)) { + inform(a->c, _("Swap capacity is limited to 8G.")); + valid = 0; + } + /* * If we made it through that obstacle course, all is well. */ diff --git a/contrib/bsdinstaller-1.1.6/src/backend/installer/fn_subpart_hammer.c b/contrib/bsdinstaller-1.1.6/src/backend/installer/fn_subpart_hammer.c index 77330c7db4..0e0ddf0015 100644 --- a/contrib/bsdinstaller-1.1.6/src/backend/installer/fn_subpart_hammer.c +++ b/contrib/bsdinstaller-1.1.6/src/backend/installer/fn_subpart_hammer.c @@ -233,6 +233,8 @@ default_capacity(struct storage *s, int mtpt) swap = storage_get_memsize(s); if (storage_get_memsize(s) > capacity) swap = capacity / 2; + if (swap > 8192) + swap = 8192; if (capacity < DISK_MIN) { /* @@ -398,6 +400,11 @@ check_subpartition_selections(struct dfui_response *r, struct i_fn_args *a) valid = 0; } + if ((strcasecmp(mountpoint, "swap") == 0) && (capacity > 8192)) { + inform(a->c, _("Swap capacity is limited to 8G.")); + valid = 0; + } + /* * If we made it through that obstacle course, all is well. */ -- 2.41.0