cpu: Use HOSTTYPE

This commit is contained in:
Dylan Araps 2018-05-31 14:30:48 +10:00
parent 077e5fadb7
commit f41607c36c
1 changed files with 7 additions and 13 deletions

View File

@ -996,15 +996,8 @@ get_distro() {
[[ -z "$distro" ]] && distro="$os (Unknown)"
# Get OS architecture.
case "$os" in
"Solaris" | "AIX" | "Haiku" | "IRIX" | "FreeMiNT") machine_arch="$(uname -p)" ;;
*) machine_arch="$(uname -m)" ;;
esac
[[ "$os_arch" == "on" ]] && \
distro+=" ${machine_arch}"
distro+=" $HOSTTYPE"
[[ "${ascii_distro:-auto}" == "auto" ]] && \
ascii_distro="$(trim "$distro")"
@ -1038,7 +1031,7 @@ get_model() {
;;
"iPhone OS")
case "$machine_arch" in
case "$kernel_machine" in
"iPad1,1") model="iPad" ;;
"iPad2,"[1-4]) model="iPad 2" ;;
"iPad3,"[1-3]) model="iPad 3" ;;
@ -1739,7 +1732,7 @@ get_cpu() {
# Get CPU name.
cpu_file="/proc/cpuinfo"
case "$machine_arch" in
case "$kernel_machine" in
"frv" | "hppa" | "m68k" | "openrisc" | "or"* | "powerpc" | "ppc"* | "sparc"*)
cpu="$(awk -F':' '/^cpu\t|^CPU/ {printf $2; exit}' "$cpu_file")"
;;
@ -1808,7 +1801,7 @@ get_cpu() {
;;
"iPhone OS")
case "$machine_arch" in
case "$kernel_machine" in
"iPhone1,"[1-2] | "iPod1,1") cpu="Samsung S5L8900 (1) @ 412MHz" ;;
"iPhone2,1") cpu="Samsung S5PC100 (1) @ 600MHz" ;;
"iPhone3,"[1-3] | "iPod4,1") cpu="Apple A4 (1) @ 800MHz" ;;
@ -2119,7 +2112,7 @@ get_gpu() {
;;
"iPhone OS")
case "$machine_arch" in
case "$kernel_machine" in
"iPhone1,"[1-2]) gpu="PowerVR MBX Lite 3D" ;;
"iPhone5,"[1-4]) gpu="PowerVR SGX543MP3" ;;
"iPhone8,"[1-4]) gpu="PowerVR GT7600" ;;
@ -4188,10 +4181,11 @@ dynamic_prompt() {
cache_uname() {
# Cache the output of uname so we don't
# have to spawn it multiple times.
IFS=" " read -ra uname <<< "$(uname -sr)"
IFS=" " read -ra uname <<< "$(uname -srm)"
kernel_name="${uname[0]}"
kernel_version="${uname[1]}"
kernel_machine="${uname[2]}"
}
convert_time() {