From 339f95b00c62543fe6aa9e72e90d5f84db422fb5 Mon Sep 17 00:00:00 2001 From: Dan Schaper Date: Mon, 20 Feb 2017 08:13:46 -0800 Subject: [PATCH] Change from `uname -m` to straight `arch` Signed-off-by: Dan Schaper --- automated install/basic-install.sh | 4 ++-- test/test_automated_install.py | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/automated install/basic-install.sh b/automated install/basic-install.sh index 5cc086c5..dc302f48 100755 --- a/automated install/basic-install.sh +++ b/automated install/basic-install.sh @@ -1161,11 +1161,11 @@ FTLdownload() { echo ":::" echo "::: Downloading latest version of FTL..." - local machine=$(uname -m) + local machine=$(arch) if [[ $machine == arm* || $machine == *aarch* ]]; then # ARM - local rev=$(uname -m | sed "s/[^0-9]//g;") + local rev=$(arch | sed "s/[^0-9]//g;") local lib=$(ldd /bin/ls | grep -E '^\s*/lib' | awk '{ print $1 }') if [[ "$lib" == "/lib/ld-linux-aarch64.so.1" ]]; then echo "::: Detected ARM-aarch64 architecture" diff --git a/test/test_automated_install.py b/test/test_automated_install.py index 97c8e503..a4488239 100644 --- a/test/test_automated_install.py +++ b/test/test_automated_install.py @@ -300,7 +300,7 @@ def test_update_package_cache_failure_no_errors(Pihole): def test_FTL_detect_aarch64_no_errors(Pihole): ''' confirms only aarch64 package is downloaded for FTL engine ''' # mock uname to return aarch64 platform - mock_command('uname', {'-m':('aarch64', '0')}, Pihole) + mock_command('arch', {'*':('aarch64', '0')}, Pihole) # mock ldd to respond with aarch64 shared library mock_command('ldd', {'/bin/ls':('/lib/ld-linux-aarch64.so.1', '0')}, Pihole) detectPlatform = Pihole.run(''' @@ -313,7 +313,7 @@ def test_FTL_detect_aarch64_no_errors(Pihole): def test_FTL_detect_armv6l_no_errors(Pihole): ''' confirms only armv6l package is downloaded for FTL engine ''' # mock uname to return armv6l platform - mock_command('uname', {'-m':('armv6l', '0')}, Pihole) + mock_command('arch', {'*':('armv6l', '0')}, Pihole) # mock ldd to respond with aarch64 shared library mock_command('ldd', {'/bin/ls':('/lib/ld-linux-armhf.so.3', '0')}, Pihole) detectPlatform = Pihole.run(''' @@ -326,7 +326,7 @@ def test_FTL_detect_armv6l_no_errors(Pihole): def test_FTL_detect_armv7l_no_errors(Pihole): ''' confirms only armv7l package is downloaded for FTL engine ''' # mock uname to return armv7l platform - mock_command('uname', {'-m':('armv7l', '0')}, Pihole) + mock_command('arch', {'*':('armv7l', '0')}, Pihole) # mock ldd to respond with aarch64 shared library mock_command('ldd', {'/bin/ls':('/lib/ld-linux-armhf.so.3', '0')}, Pihole) detectPlatform = Pihole.run(''' @@ -348,7 +348,7 @@ def test_FTL_detect_x86_64_no_errors(Pihole): def test_FTL_detect_unknown_no_errors(Pihole): ''' confirms only generic package is downloaded for FTL engine ''' # mock uname to return generic platform - mock_command('uname', {'-m':('mips', '0')}, Pihole) + mock_command('arch', {'*':('mips', '0')}, Pihole) detectPlatform = Pihole.run(''' source /opt/pihole/basic-install.sh FTLdownload