Brad Bishop | 15ae250 | 2019-06-18 21:44:24 -0400 | [diff] [blame^] | 1 | From 05a4d54e2adc4caed507baca529089ec01f48340 Mon Sep 17 00:00:00 2001 |
Patrick Williams | ddad1a1 | 2017-02-23 20:36:32 -0600 | [diff] [blame] | 2 | From: Li Zhou <li.zhou@windriver.com> |
| 3 | Date: Tue, 6 Sep 2016 14:04:29 +0800 |
Brad Bishop | 15ae250 | 2019-06-18 21:44:24 -0400 | [diff] [blame^] | 4 | Subject: [PATCH 1/2] lmsensors: sensors-detect: print a special message when |
| 5 | there isn't enough cpu info |
Patrick Williams | ddad1a1 | 2017-02-23 20:36:32 -0600 | [diff] [blame] | 6 | |
| 7 | When running sensors-detect, if there isn't enough information in |
| 8 | /proc/cpuinfo for this arch (e.g. ppc64), "Use of uninitialized value |
| 9 | in concatenation (.) or string at /usr/sbin/sensors-detect line 2867" |
| 10 | and incomplete "# Processor: (//)" will be printed. |
| 11 | Here print out a prompt for such a case. |
| 12 | |
| 13 | Upstream-Status: Pending |
| 14 | |
| 15 | Signed-off-by: Li Zhou <li.zhou@windriver.com> |
| 16 | --- |
| 17 | prog/detect/sensors-detect | 7 ++++++- |
| 18 | 1 file changed, 6 insertions(+), 1 deletion(-) |
| 19 | |
| 20 | diff --git a/prog/detect/sensors-detect b/prog/detect/sensors-detect |
Brad Bishop | 15ae250 | 2019-06-18 21:44:24 -0400 | [diff] [blame^] | 21 | index 0b3b0ff2..68594cd7 100755 |
Patrick Williams | ddad1a1 | 2017-02-23 20:36:32 -0600 | [diff] [blame] | 22 | --- a/prog/detect/sensors-detect |
| 23 | +++ b/prog/detect/sensors-detect |
Brad Bishop | 15ae250 | 2019-06-18 21:44:24 -0400 | [diff] [blame^] | 24 | @@ -3119,7 +3119,12 @@ sub initialize_cpu_list |
Patrick Williams | ddad1a1 | 2017-02-23 20:36:32 -0600 | [diff] [blame] | 25 | 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 Bishop | 15ae250 | 2019-06-18 21:44:24 -0400 | [diff] [blame^] | 39 | 2.21.0 |
Patrick Williams | ddad1a1 | 2017-02-23 20:36:32 -0600 | [diff] [blame] | 40 | |