]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/commitdiff
make.sh: Automatically enable build ramdisk on systems with 4GB RAM or more
authorMichael Tremer <michael.tremer@ipfire.org>
Fri, 10 May 2019 02:38:49 +0000 (03:38 +0100)
committerMichael Tremer <michael.tremer@ipfire.org>
Fri, 10 May 2019 04:31:04 +0000 (05:31 +0100)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
make.sh

diff --git a/make.sh b/make.sh
index 8c998ef87c8f10b7d1faf7afea136e903fb0d790..0499dbafb72147f9fa05f2e9107be72fe9a3d2fe 100755 (executable)
--- a/make.sh
+++ b/make.sh
@@ -39,8 +39,6 @@ GIT_LASTCOMMIT=$(git log | head -n1 | cut -d" " -f2 |head -c8)        # Last commit
 
 TOOLCHAINVER=20181030
 
-ENABLE_RAMDISK="on"
-
 ###############################################################################
 #
 # Beautifying variables & presentation & input output interface
@@ -900,6 +898,9 @@ update_contributors() {
        return 0
 }
 
+# Default settings
+ENABLE_RAMDISK="auto"
+
 # Load configuration file
 if [ -f .config ]; then
        . .config
@@ -921,6 +922,14 @@ else
        configure_build "default"
 fi
 
+# Automatically enable/disable ramdisk usage
+if [ "${ENABLE_RAMDISK}" = "auto" ]; then
+       # Enable only when the host system has 4GB of RAM or more
+       if [ ${SYSTEM_MEMORY} -ge 3900 ]; then
+               ENABLE_RAMDISK="on"
+       fi
+fi
+
 buildtoolchain() {
        local error=false
        case "${BUILD_ARCH}:${HOST_ARCH}" in