From 2601162243028115768878f3bb0f5ec8fdde8393 Mon Sep 17 00:00:00 2001 From: spmfox Date: Sat, 16 Apr 2022 16:25:33 -0400 Subject: [PATCH] Changed ldd binary check from /bin/ls to /usr/bin/bash Signed-off-by: spmfox --- automated install/basic-install.sh | 2 +- test/test_any_automated_install.py | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/automated install/basic-install.sh b/automated install/basic-install.sh index e1683993..ced6ff2a 100755 --- a/automated install/basic-install.sh +++ b/automated install/basic-install.sh @@ -2216,7 +2216,7 @@ get_binary_name() { local rev rev=$(uname -m | sed "s/[^0-9]//g;") local lib - lib=$(ldd /bin/ls | grep -E '^\s*/lib' | awk '{ print $1 }') + lib=$(ldd /bin/bash | grep -E '^\s*/lib' | awk '{ print $1 }') if [[ "${lib}" == "/lib/ld-linux-aarch64.so.1" ]]; then printf "%b %b Detected AArch64 (64 Bit ARM) processor\\n" "${OVER}" "${TICK}" # set the binary to be used diff --git a/test/test_any_automated_install.py b/test/test_any_automated_install.py index b7b4ccd8..1e65842b 100644 --- a/test/test_any_automated_install.py +++ b/test/test_any_automated_install.py @@ -679,7 +679,7 @@ def test_FTL_detect_aarch64_no_errors(host): mock_command( 'ldd', { - '/bin/ls': ( + '/bin/bash': ( '/lib/ld-linux-aarch64.so.1', '0' ) @@ -709,7 +709,7 @@ def test_FTL_detect_armv4t_no_errors(host): # mock uname to return armv4t platform mock_command('uname', {'-m': ('armv4t', '0')}, host) # mock ldd to respond with ld-linux shared library - mock_command('ldd', {'/bin/ls': ('/lib/ld-linux.so.3', '0')}, host) + mock_command('ldd', {'/bin/bash': ('/lib/ld-linux.so.3', '0')}, host) detectPlatform = host.run(''' source /opt/pihole/basic-install.sh create_pihole_user @@ -733,7 +733,7 @@ def test_FTL_detect_armv5te_no_errors(host): # mock uname to return armv5te platform mock_command('uname', {'-m': ('armv5te', '0')}, host) # mock ldd to respond with ld-linux shared library - mock_command('ldd', {'/bin/ls': ('/lib/ld-linux.so.3', '0')}, host) + mock_command('ldd', {'/bin/bash': ('/lib/ld-linux.so.3', '0')}, host) detectPlatform = host.run(''' source /opt/pihole/basic-install.sh create_pihole_user @@ -757,7 +757,7 @@ def test_FTL_detect_armv6l_no_errors(host): # mock uname to return armv6l platform mock_command('uname', {'-m': ('armv6l', '0')}, host) # mock ldd to respond with ld-linux-armhf shared library - mock_command('ldd', {'/bin/ls': ('/lib/ld-linux-armhf.so.3', '0')}, host) + mock_command('ldd', {'/bin/bash': ('/lib/ld-linux-armhf.so.3', '0')}, host) detectPlatform = host.run(''' source /opt/pihole/basic-install.sh create_pihole_user @@ -782,7 +782,7 @@ def test_FTL_detect_armv7l_no_errors(host): # mock uname to return armv7l platform mock_command('uname', {'-m': ('armv7l', '0')}, host) # mock ldd to respond with ld-linux-armhf shared library - mock_command('ldd', {'/bin/ls': ('/lib/ld-linux-armhf.so.3', '0')}, host) + mock_command('ldd', {'/bin/bash': ('/lib/ld-linux-armhf.so.3', '0')}, host) detectPlatform = host.run(''' source /opt/pihole/basic-install.sh create_pihole_user @@ -807,7 +807,7 @@ def test_FTL_detect_armv8a_no_errors(host): # mock uname to return armv8a platform mock_command('uname', {'-m': ('armv8a', '0')}, host) # mock ldd to respond with ld-linux-armhf shared library - mock_command('ldd', {'/bin/ls': ('/lib/ld-linux-armhf.so.3', '0')}, host) + mock_command('ldd', {'/bin/bash': ('/lib/ld-linux-armhf.so.3', '0')}, host) detectPlatform = host.run(''' source /opt/pihole/basic-install.sh create_pihole_user