mirror of
https://github.com/pi-hole/pi-hole.git
synced 2024-12-26 14:50:17 +00:00
Fix the binary detection for ARMv6 and simplify the router overall
Signed-off-by: DL6ER <dl6er@dl6er.de>
This commit is contained in:
parent
ca7836bf71
commit
45687d675b
1 changed files with 17 additions and 20 deletions
|
@ -1875,30 +1875,28 @@ get_binary_name() {
|
||||||
local rev
|
local rev
|
||||||
rev=$(echo "${cpu_arch}" | grep -o '[0-9]*')
|
rev=$(echo "${cpu_arch}" | grep -o '[0-9]*')
|
||||||
if [[ "${machine}" == "aarch64" ]]; then
|
if [[ "${machine}" == "aarch64" ]]; then
|
||||||
|
# If AArch64 is found (e.g., BCM2711 in Raspberry Pi 4)
|
||||||
printf "%b %b Detected AArch64 (64 Bit ARM) architecture\\n" "${OVER}" "${TICK}"
|
printf "%b %b Detected AArch64 (64 Bit ARM) architecture\\n" "${OVER}" "${TICK}"
|
||||||
# set the binary to be used
|
|
||||||
l_binary="pihole-FTL-arm64"
|
l_binary="pihole-FTL-arm64"
|
||||||
elif [[ "${cpu_arch}" == "armv6"* ]]; then
|
elif [[ "${cpu_arch}" == "v6"* ]]; then
|
||||||
|
# If ARMv6 is found (e.g., BCM2835 in Raspberry Pi 1 and Zero)
|
||||||
printf "%b %b Detected ARMv6 architecture\\n" "${OVER}" "${TICK}"
|
printf "%b %b Detected ARMv6 architecture\\n" "${OVER}" "${TICK}"
|
||||||
# set the binary to be used (e.g., BCM2835 as found in Raspberry Pi Zero and Model 1)
|
|
||||||
l_binary="pihole-FTL-armv6"
|
l_binary="pihole-FTL-armv6"
|
||||||
else
|
elif [[ "${cpu_arch}" == "v7"* || "${rev}" -ge 7 ]]; then
|
||||||
# If ARMv8 or higher is found (e.g., BCM2837 as found in Raspberry Pi Model 3B)
|
# If ARMv7 or higher is found (e.g., BCM2836 in Raspberry PI 2 Mod. B)
|
||||||
if [[ "${cpu_arch}" == "v7" || "${rev}" -gt 7 ]]; then
|
# This path is also used for ARMv8 when the OS is in 32bit mode
|
||||||
|
# (e.g., BCM2837 in Raspberry Pi Model 3B, or BCM2711 in Raspberry Pi 4)
|
||||||
printf "%b %b Detected ARMv7 (or newer) architecture (%s)\\n" "${OVER}" "${TICK}" "${cpu_arch}"
|
printf "%b %b Detected ARMv7 (or newer) architecture (%s)\\n" "${OVER}" "${TICK}" "${cpu_arch}"
|
||||||
# set the binary to be used
|
|
||||||
l_binary="pihole-FTL-armv7"
|
l_binary="pihole-FTL-armv7"
|
||||||
elif [[ "${rev}" -gt 6 ]]; then
|
elif [[ "${rev}" -gt 6 ]]; then
|
||||||
# Otherwise, if ARMv7 is found (e.g., BCM2836 as found in Raspberry Pi Model 2)
|
# Otherwise, if ARMv7 is found (e.g., BCM2836 in Raspberry Pi Model 2)
|
||||||
printf "%b %b Detected ARMv7 architecture (%s)\\n" "${OVER}" "${TICK}" "${cpu_arch}"
|
printf "%b %b Detected ARMv7 architecture (%s)\\n" "${OVER}" "${TICK}" "${cpu_arch}"
|
||||||
# set the binary to be used
|
|
||||||
l_binary="pihole-FTL-armv6"
|
l_binary="pihole-FTL-armv6"
|
||||||
else
|
else
|
||||||
# Otherwise, Pi-hole does not support this architecture
|
# Otherwise, Pi-hole does not support this architecture
|
||||||
printf "%b %b This processor architecture is not supported by Pi-hole (%s)\\n" "${OVER}" "${CROSS}" "${cpu_arch}"
|
printf "%b %b This processor architecture is not supported by Pi-hole (%s)\\n" "${OVER}" "${CROSS}" "${cpu_arch}"
|
||||||
l_binary=""
|
l_binary=""
|
||||||
fi
|
fi
|
||||||
fi
|
|
||||||
elif [[ "${machine}" == "x86_64" ]]; then
|
elif [[ "${machine}" == "x86_64" ]]; then
|
||||||
# This gives the processor of packages dpkg installs (for example, "i386")
|
# This gives the processor of packages dpkg installs (for example, "i386")
|
||||||
local dpkgarch
|
local dpkgarch
|
||||||
|
@ -1912,9 +1910,8 @@ get_binary_name() {
|
||||||
printf "%b %b Detected 32bit (i686) architecture\\n" "${OVER}" "${TICK}"
|
printf "%b %b Detected 32bit (i686) architecture\\n" "${OVER}" "${TICK}"
|
||||||
l_binary="pihole-FTL-386"
|
l_binary="pihole-FTL-386"
|
||||||
else
|
else
|
||||||
# 64bit
|
# 64bit OS
|
||||||
printf "%b %b Detected x86_64 architecture\\n" "${OVER}" "${TICK}"
|
printf "%b %b Detected x86_64 architecture\\n" "${OVER}" "${TICK}"
|
||||||
# set the binary to be used
|
|
||||||
l_binary="pihole-FTL-amd64"
|
l_binary="pihole-FTL-amd64"
|
||||||
fi
|
fi
|
||||||
elif [[ "${machine}" == "riscv64" ]]; then
|
elif [[ "${machine}" == "riscv64" ]]; then
|
||||||
|
|
Loading…
Reference in a new issue