From 625ce2bb7c3476b78d1d966ce304e9a40fbdc744 Mon Sep 17 00:00:00 2001 From: Jens Steube Date: Mon, 27 Dec 2021 15:03:33 +0100 Subject: [PATCH] Fix test.sh fix for M1 --- tools/test.sh | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/tools/test.sh b/tools/test.sh index 0f772238f..e25b655de 100755 --- a/tools/test.sh +++ b/tools/test.sh @@ -3168,16 +3168,18 @@ IS_APPLE_SILICON=0 # handle Apple M1 bugs with optimized kernels -if [ ${OPTIMIZED} -eq 1 ]; then - BIN_sysctl=$(which sysctl) - if [ $? -eq 0 ]; then - CPU_TYPE=$(sysctl hw.cputype | awk '{print $2}') - - # with Apple's M1, disable optimized kernel - if [ ${CPU_TYPE} -eq 16777228 ]; then - OPTIMIZED=0 - KERNEL_TYPE="Pure" - IS_APPLE_SILICON=1 +if [ $(uname) == "Darwin" ]; then + if [ ${OPTIMIZED} -eq 1 ]; then + BIN_sysctl=$(which sysctl) + if [ $? -eq 0 ]; then + CPU_TYPE=$(sysctl hw.cputype | awk '{print $2}') + + # with Apple's M1, disable optimized kernel + if [ ${CPU_TYPE} -eq 16777228 ]; then + OPTIMIZED=0 + KERNEL_TYPE="Pure" + IS_APPLE_SILICON=1 + fi fi fi fi