diff --git a/scripts/cleanup-env.sh b/scripts/cleanup-env.sh index 1367724..9e5ef8b 100755 --- a/scripts/cleanup-env.sh +++ b/scripts/cleanup-env.sh @@ -1,5 +1,8 @@ #!/bin/bash -e -sudo umount build +# Only attempt to unmount if the directory is already mounted +if mountpoint -q `pwd`/build; then + sudo umount build +fi exit 0 diff --git a/scripts/setup-env.sh b/scripts/setup-env.sh index e5fc3b1..dbed061 100755 --- a/scripts/setup-env.sh +++ b/scripts/setup-env.sh @@ -2,6 +2,11 @@ mkdir -p build -sudo mount -t tmpfs -o size=64G,mode=755,uid=${UID} tmpfs build +total_mem=`grep MemTotal /proc/meminfo | awk '{print $2}'` + +# Only have the slaves with large amounts of RAM mount the tmpfs +if [ "$total_mem" -ge "67108864" ]; then + sudo mount -t tmpfs -o size=64G,mode=755,uid=${UID} tmpfs build +fi exit 0