Fix Linux swap detection for non-X86 environments

pull/142/head
Jeffrey Walton 2016-02-13 20:31:28 -05:00
parent 054edb6c38
commit 6c4c0db3de
1 changed files with 7 additions and 3 deletions

View File

@ -203,11 +203,15 @@ fi
# Some ARM devboards cannot use 'make -j N', even with multiple cores and RAM
# An 8-core Cubietruck Plus with 2GB RAM experiences OOM kills with '-j 2'.
HAVE_SWAP=1
if [ "$IS_ARM" -ne "0" ]; then
if [ "$IS_LINUX" -ne "0" ]; then
if [ -e "/proc/meminfo" ]; then
SWAP_SIZE=$(cat /proc/meminfo | grep "SwapTotal" | awk '{print $2}')
if [ "$SWAP_SIZE" -eq "0" ]; then
HAVE_SWAP=0
fi
else
HAVE_SWAP=0
fi
fi
echo | tee -a "$TEST_RESULTS"