use lscpu to get cpu name on arm architecture

This commit is contained in:
Estela ad Astra 2022-06-26 00:58:21 +08:00 committed by GitHub
parent ee8d01ed2a
commit b9e713f9e2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -2206,6 +2206,10 @@ get_cpu() {
[[ -z "$cpu" ]] && cpu="$(awk -F':' '/family/ {printf $2; exit}' "$cpu_file")"
;;
"arm"* | "aarch64")
cpu="$(lscpu | grep "Vendor ID" | sed "s/.*: *//g") $(lscpu | grep "Model name" | sed "s/.*: *//g")"
;;
*)
cpu="$(awk -F '\\s*: | @' \
'/model name|Hardware|Processor|^cpu model|chip type|^cpu type/ {