From 6c4c0db3de5a86c1a5f0671c7f11d45faacc5691 Mon Sep 17 00:00:00 2001 From: Jeffrey Walton Date: Sat, 13 Feb 2016 20:31:28 -0500 Subject: [PATCH] Fix Linux swap detection for non-X86 environments --- cryptest.sh | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/cryptest.sh b/cryptest.sh index 57b8e6cb..31a1b19c 100755 --- a/cryptest.sh +++ b/cryptest.sh @@ -203,9 +203,13 @@ 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 - SWAP_SIZE=$(cat /proc/meminfo | grep "SwapTotal" | awk '{print $2}') - if [ "$SWAP_SIZE" -eq "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