blob: 337fb11dd214229e06363c86b177076973c2975e [file] [log] [blame]
Brad Bishop15ae2502019-06-18 21:44:24 -04001From 05a4d54e2adc4caed507baca529089ec01f48340 Mon Sep 17 00:00:00 2001
Patrick Williamsddad1a12017-02-23 20:36:32 -06002From: Li Zhou <li.zhou@windriver.com>
3Date: Tue, 6 Sep 2016 14:04:29 +0800
Brad Bishop15ae2502019-06-18 21:44:24 -04004Subject: [PATCH 1/2] lmsensors: sensors-detect: print a special message when
5 there isn't enough cpu info
Patrick Williamsddad1a12017-02-23 20:36:32 -06006
7When running sensors-detect, if there isn't enough information in
8/proc/cpuinfo for this arch (e.g. ppc64), "Use of uninitialized value
9in concatenation (.) or string at /usr/sbin/sensors-detect line 2867"
10and incomplete "# Processor: (//)" will be printed.
11Here print out a prompt for such a case.
12
13Upstream-Status: Pending
14
15Signed-off-by: Li Zhou <li.zhou@windriver.com>
16---
17 prog/detect/sensors-detect | 7 ++++++-
18 1 file changed, 6 insertions(+), 1 deletion(-)
19
20diff --git a/prog/detect/sensors-detect b/prog/detect/sensors-detect
Brad Bishop15ae2502019-06-18 21:44:24 -040021index 0b3b0ff2..68594cd7 100755
Patrick Williamsddad1a12017-02-23 20:36:32 -060022--- a/prog/detect/sensors-detect
23+++ b/prog/detect/sensors-detect
Brad Bishop15ae2502019-06-18 21:44:24 -040024@@ -3119,7 +3119,12 @@ sub initialize_cpu_list
Patrick Williamsddad1a12017-02-23 20:36:32 -060025 sub print_cpu_info
26 {
27 my $cpu = $cpu[0];
28- print "# Processor: $cpu->{'model name'} ($cpu->{'cpu family'}/$cpu->{model}/$cpu->{stepping})\n";
29+ if ( $cpu->{'model name'} && $cpu->{'cpu family'} && $cpu->{model} && $cpu->{stepping} ) {
30+ print "# Processor: $cpu->{'model name'} ($cpu->{'cpu family'}/$cpu->{model}/$cpu->{stepping})\n";
31+ }
32+ else {
33+ print "# Processor: There isn't enough cpu info for this arch!!!\n";
34+ }
35 }
36
37 # @i2c_adapters is a list of references to hashes, one hash per I2C/SMBus
38--
Brad Bishop15ae2502019-06-18 21:44:24 -0400392.21.0
Patrick Williamsddad1a12017-02-23 20:36:32 -060040