Merge pull request #2004 from pi-hole/tweak/32bitOS_on_64bitCPU

Install 32bit FTL on 32bit OS (even if 64bit architecture is detected)
This commit is contained in:
Mark Drobnak 2018-06-08 20:56:36 -04:00 committed by GitHub
commit c8bcd4af2d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -2094,9 +2094,8 @@ FTLinstall() {
} }
get_binary_name() { get_binary_name() {
# Local, named variables # This gives the machine architecture which may be different from the OS architecture...
local machine local machine
# Store architecture in a variable
machine=$(uname -m) machine=$(uname -m)
local str="Detecting architecture" local str="Detecting architecture"
@ -2139,10 +2138,21 @@ get_binary_name() {
# set the binary to be used # set the binary to be used
binary="pihole-FTL-powerpc-linux-gnu" binary="pihole-FTL-powerpc-linux-gnu"
elif [[ "${machine}" == "x86_64" ]]; then elif [[ "${machine}" == "x86_64" ]]; then
# 64bit # This gives the architecture of packages dpkg installs (for example, "i386")
echo -e "${OVER} ${TICK} Detected x86_64 architecture" local dpkgarch
# set the binary to be used dpkgarch=$(dpkg --print-architecture 2> /dev/null)
binary="pihole-FTL-linux-x86_64"
# Special case: This is a 32 bit OS, installed on a 64 bit machine
# -> change machine architecture to download the 32 bit executable
if [[ "${dpkgarch}" == "i386" ]]; then
echo -e "${OVER} ${TICK} Detected 32bit (i686) architecture"
binary="pihole-FTL-linux-x86_32"
else
# 64bit
echo -e "${OVER} ${TICK} Detected x86_64 architecture"
# set the binary to be used
binary="pihole-FTL-linux-x86_64"
fi
else else
# Something else - we try to use 32bit executable and warn the user # Something else - we try to use 32bit executable and warn the user
if [[ ! "${machine}" == "i686" ]]; then if [[ ! "${machine}" == "i686" ]]; then