CPU: Added initial support for AIX
This commit is contained in:
parent
0cfe6f3608
commit
4626349b4d
20
neofetch
20
neofetch
|
@ -278,6 +278,10 @@ get_model() {
|
||||||
"Solaris")
|
"Solaris")
|
||||||
model="$(prtconf -b | awk -F':' '/banner-name/ {printf $2}')"
|
model="$(prtconf -b | awk -F':' '/banner-name/ {printf $2}')"
|
||||||
;;
|
;;
|
||||||
|
|
||||||
|
"AIX")
|
||||||
|
model="$(prtconf | awk -F':' '/System Model/ {printf $2}')"
|
||||||
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
# Remove dummy OEM info.
|
# Remove dummy OEM info.
|
||||||
|
@ -911,6 +915,22 @@ get_cpu() {
|
||||||
# Get CPU cores.
|
# Get CPU cores.
|
||||||
cores="$(sysinfo -cpu | grep -c -F 'CPU #')"
|
cores="$(sysinfo -cpu | grep -c -F 'CPU #')"
|
||||||
;;
|
;;
|
||||||
|
|
||||||
|
"AIX")
|
||||||
|
# Get CPU name.
|
||||||
|
cpu="$(prtconf | awk -F':' '/Processor Type/ {printf $2}')"
|
||||||
|
|
||||||
|
# Get CPU speed.
|
||||||
|
speed="$(prtconf | awk -F':' '/Processor Clock Speed/ {printf $2}')"
|
||||||
|
speed="${speed/MHz}"
|
||||||
|
speed="$((speed / 100))"
|
||||||
|
|
||||||
|
# Get CPU cores.
|
||||||
|
case "$cpu_cores" in
|
||||||
|
"logical" | "on") cores="$(lparstat -i | awk -F':' '/Online Virtual CPUs/ {printf $2}')" ;;
|
||||||
|
"physical") cores="$(lparstat -i | awk -F':' '/Active Physical CPUs/ {printf $2}')"
|
||||||
|
esac
|
||||||
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
# Fix for speeds under 1ghz.
|
# Fix for speeds under 1ghz.
|
||||||
|
|
Reference in New Issue