add CPU detection for cygwin

This commit is contained in:
abbie 2024-11-12 19:03:12 +00:00
parent 86801caef9
commit 0e11900adb
Signed by: threeoh6000
GPG key ID: 801FE4AD456E922C

View file

@ -1,21 +1,21 @@
if [ "$hasawk" -eq 1 ] && [ $system_type = "openbsd" ] && [ -z "$processor" ]; then if [ "$hasawk" -eq 1 ] && [ "$system_type" = "openbsd" ] && [ -z "$processor" ]; then
processor="$(sysctl hw.model | awk -F "=" '{print $2}')" processor="$(sysctl hw.model | awk -F "=" '{print $2}')"
fi fi
if [ "$hasawk" -eq 1 ] && [ $system_type = "freebsd" ] && [ -z "$processor" ]; then if [ "$hasawk" -eq 1 ] && [ "$system_type" = "freebsd" ] && [ -z "$processor" ]; then
processor="$(sysctl hw.model | awk -F ": " '{print $2}')" processor="$(sysctl hw.model | awk -F ": " '{print $2}')"
fi fi
if [ "$hasawk" -eq 1 ] && [ $system_type = "netbsd" ] && [ -z "$processor" ]; then if [ "$hasawk" -eq 1 ] && [ "$system_type" = "netbsd" ] && [ -z "$processor" ]; then
processor="$(sysctl machdep.cpu_brand | awk -F " = " '{print $2}')" processor="$(sysctl machdep.cpu_brand | awk -F " = " '{print $2}')"
fi fi
if [ "$hasawk" -eq 1 ] && [ $system_type = "haiku" ] && [ -z "$processor" ]; then if [ "$hasawk" -eq 1 ] && [ "$system_type" = "haiku" ] && [ -z "$processor" ]; then
processor="$(sysinfo | grep "CPU #0" | awk -F "\"" '{ print $2 }')" processor="$(sysinfo | grep "CPU #0" | awk -F "\"" '{ print $2 }')"
fi fi
if [ "$hasawk" -eq 1 ] && [ $system_type = "linux" ] && [ -z "$processor" ]; then if [ "$hasawk" -eq 1 ] && [ "$system_type" = "linux" ] || [ "$system_type" = "windows" -a "$subtype" = "cygwin" ] && [ -z "$processor" ]; then
if [ -n "$(cat /proc/cpuinfo | grep "model name" | head -n 1 | awk -F ": " '{print $2}')" ]; then if [ -n "$(cat /proc/cpuinfo | grep "model name" | head -n 1 | awk -F ": " '{print $2}')" ]; then
processor="$(cat /proc/cpuinfo | grep "model name" | head -n 1 | awk -F ": " '{print $2}')" processor="$(cat /proc/cpuinfo | grep "model name" | head -n 1 | awk -F ": " '{print $2}')"
elif [ -n "$(cat /proc/cpuinfo | grep -v "cpuid" | grep -v "Hz" | grep -v "cpu number" | grep -v "cpu regs" | grep "cpu" | head -n 1 | awk -F ": " '{print $2}')" ]; then elif [ -n "$(cat /proc/cpuinfo | grep -v "cpuid" | grep -v "Hz" | grep -v "cpu number" | grep -v "cpu regs" | grep "cpu" | head -n 1 | awk -F ": " '{print $2}')" ]; then
processor="$(cat /proc/cpuinfo | grep -v "cpuid" | grep -v "Hz" | grep -v "cpu number" | grep -v "cpu regs" | grep "cpu" | head -n 1 | awk -F ": " '{print $2}')" processor="$(cat /proc/cpuinfo | grep -v "cpuid" | grep -v "Hz" | grep -v "cpu number" | grep -v "cpu regs" | grep "cpu" | head -n 1 | awk -F ": " '{print $2}')"
elif [ -n "$(cat /proc/cpuinfo | grep "Hardware" | head -n 1 | awk -F ": " '{print $2}')" ] && [ $subtype = "chumby" -o $subtype = "rpi" ]; then elif [ -n "$(cat /proc/cpuinfo | grep "Hardware" | head -n 1 | awk -F ": " '{print $2}')" ] && [ "$subtype" = "chumby" -o "$subtype" = "rpi" ]; then
processor="$(cat /proc/cpuinfo | grep "Hardware" | head -n 1 | awk -F ": " '{print $2}')" processor="$(cat /proc/cpuinfo | grep "Hardware" | head -n 1 | awk -F ": " '{print $2}')"
elif [ -n "$(cat /proc/cpuinfo | grep "family" | head -n 1 | awk -F ": " '{print $2}')" ]; then elif [ -n "$(cat /proc/cpuinfo | grep "family" | head -n 1 | awk -F ": " '{print $2}')" ]; then
processor="$(cat /proc/cpuinfo | grep "family" | head -n 1 | awk -F ": " '{print $2}')" processor="$(cat /proc/cpuinfo | grep "family" | head -n 1 | awk -F ": " '{print $2}')"