From 51f547c5bb93329d75a6b032d4c8d293d1d2e606 Mon Sep 17 00:00:00 2001 From: Harald Hope Date: Tue, 6 Jun 2017 20:23:25 -0700 Subject: [PATCH] bug fix for aarch64 arm cpu bug, this should complete issue #107 --- inxi | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/inxi b/inxi index 137c3da..97f5699 100755 --- a/inxi +++ b/inxi @@ -4482,17 +4482,22 @@ get_cpu_data() bProcInt = "true" } else { - # note: alternate: - # Processor : AArch64 Processor rev 4 (aarch64) - if ( $NF ~ "^(ARM|AArch)" ) { - bArm = "true" - } # this protects against double processor lines, one int, one string if ( bProcInt == "false" ){ count += 1 nr = count - 1 - cpu[nr, "model"] = $NF } + # note: alternate: + # Processor : AArch64 Processor rev 4 (aarch64) + # but no model name type + if ( $NF ~ "(ARM|AArch)" ) { + bArm = "true" + } + gsub(/'"$BAN_LIST_NORMAL"'/, "", $NF ) + gsub(/'"$BAN_LIST_CPU"'/, "", $NF ) + gsub(/^ +| +$/, "", $NF) + gsub(/ [ \t]+/, " ", $NF) + cpu[nr, "model"] = $NF } } /^model name|^cpu\t+:/ { @@ -4502,7 +4507,7 @@ get_cpu_data() gsub(/^ +| +$/, "", $NF) gsub(/ [ \t]+/, " ", $NF) cpu[nr, "model"] = $NF - if ( $NF ~ "^ARM" ) { + if ( $NF ~ "^(ARM|AArch)" ) { bArm = "true" } } @@ -4534,6 +4539,7 @@ get_cpu_data() } /^bogomips/ { cpu[nr, "bogomips"] = $NF + # print nr " " cpu[nr, "bogomips"] > "/dev/tty" } /vendor_id/ { gsub(/genuine|authentic/,"",$NF) @@ -4552,6 +4558,7 @@ get_cpu_data() } else if ( cpu[i, "bogomips"] != "" && cpu[i, "speed"] == "" ) { cpu[i, "speed"] = cpu[i, "bogomips"] + } print cpu[i, "model"] "," cpu[i, "speed"] "," cpu[i, "cache"] "," cpu[i, "flags"] "," cpu[i, "bogomips"] "," cpu[nr, "vendor"] "," bArm } @@ -4846,7 +4853,6 @@ get_cpu_ht_multicore_smp_data() # Processor : AArch64 Processor rev 4 (aarch64) if ( $NF ~ "^(ARM|AArch)" ) { bArm = "true" - } # this protects against double processor lines, one int, one string if ( bProcInt == "false" ){