1
0
mirror of https://github.com/pi-hole/pi-hole.git synced 2025-09-20 16:21:12 +08:00

Print detected CPU arch

Signed-off-by: DL6ER <dl6er@dl6er.de>
This commit is contained in:
DL6ER
2023-06-09 18:50:31 +02:00
parent 1c4e58efe3
commit 913be6c349
2 changed files with 44 additions and 11 deletions

View File

@ -1844,30 +1844,30 @@ get_binary_name() {
else
# If ARMv8 or higher is found (e.g., BCM2837 as found in Raspberry Pi Model 3B)
if [[ "${cpu_arch}" == "v7" || "${rev}" -gt 7 ]]; then
printf "%b %b Detected ARMv8 (or newer) architecture\\n" "${OVER}" "${TICK}"
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"
elif [[ "${rev}" -gt 6 ]]; then
# Otherwise, if ARMv7 is found (e.g., BCM2836 as found in Raspberry Pi Model 2)
printf "%b %b Detected ARMv7 architecture\\n" "${OVER}" "${TICK}"
printf "%b %b Detected ARMv7 architecture (%s)\\n" "${OVER}" "${TICK}" "${cpu_arch}"
# set the binary to be used
l_binary="pihole-FTL-armv6"
elif [[ "${cpu_arch}" == "v5TE" || "${rev}" -gt 5 ]]; then
# Check if the system is using GLIBC 2.29 or higher
if [[ -n "${l_glibc_version}" && "$(printf '%s\n' "2.29" "${l_glibc_version}" | sort -V | head -n1)" == "2.29" ]]; then
# If so, use the ARMv6 binary (e.g., BCM2835 as found in Raspberry Pi Zero and Model 1)
printf "%b %b Detected ARMv6 architecture (running GLIBC 2.29 or higher)\\n" "${OVER}" "${TICK}"
printf "%b %b Detected ARMv6 architecture (running GLIBC 2.29 or higher, %s)\\n" "${OVER}" "${TICK}" "${cpu_arch}"
# set the binary to be used
l_binary="pihole-FTL-armv5"
else
# Otherwise, use the ARMv5 binary (e.g., BCM2835 as found in Raspberry Pi Zero and Model 1)
printf "%b %b Detected ARMv6 architecture (running GLIBC older than 2.29)\\n" "${OVER}" "${TICK}"
printf "%b %b Detected ARMv6 architecture (running GLIBC older than 2.29, %s)\\n" "${OVER}" "${TICK}" "${cpu_arch}"
# set the binary to be used
l_binary="pihole-FTL-armv4"
fi
else
# Otherwise, use the ARMv4 binary (e.g., BCM2835 as found in Raspberry Pi Zero and Model 1)
printf "%b %b Detected ARMv4 or ARMv5 architecture\\n" "${OVER}" "${TICK}"
printf "%b %b Detected ARMv4 or ARMv5 architecture (%s)\\n" "${OVER}" "${TICK}" "${cpu_arch}"
# set the binary to be used
l_binary="pihole-FTL-armv4"
fi