All of lore.kernel.org
 help / color / mirror / Atom feed
From: Li Zhou <li.zhou@windriver.com>
To: <openembedded-devel@lists.openembedded.org>
Subject: [meta-oe][PATCH] lmsensors: sensors-detect: print a special message when there isn't enough cpu info
Date: Wed, 7 Sep 2016 09:46:29 +0800	[thread overview]
Message-ID: <20160907014629.24264-1-li.zhou@windriver.com> (raw)

When running sensors-detect, if there isn't enough information in
/proc/cpuinfo for this arch (e.g. ppc64), "Use of uninitialized value
in concatenation (.) or string at /usr/sbin/sensors-detect line 2867"
and incomplete "# Processor: (//)" will be printed.
Here print out a prompt for such a case.

Signed-off-by: Li Zhou <li.zhou@windriver.com>
---
 ...ensors-detect-print-a-special-message-whe.patch | 40 ++++++++++++++++++++++
 .../recipes-support/lm_sensors/lmsensors_3.4.0.bb  |  1 +
 2 files changed, 41 insertions(+)
 create mode 100644 meta-oe/recipes-support/lm_sensors/lmsensors/0001-lmsensors-sensors-detect-print-a-special-message-whe.patch

diff --git a/meta-oe/recipes-support/lm_sensors/lmsensors/0001-lmsensors-sensors-detect-print-a-special-message-whe.patch b/meta-oe/recipes-support/lm_sensors/lmsensors/0001-lmsensors-sensors-detect-print-a-special-message-whe.patch
new file mode 100644
index 0000000..abf6e75
--- /dev/null
+++ b/meta-oe/recipes-support/lm_sensors/lmsensors/0001-lmsensors-sensors-detect-print-a-special-message-whe.patch
@@ -0,0 +1,40 @@
+From c4428260e7685ebaf5c26c6ecaae5a56849853e8 Mon Sep 17 00:00:00 2001
+From: Li Zhou <li.zhou@windriver.com>
+Date: Tue, 6 Sep 2016 14:04:29 +0800
+Subject: [PATCH] lmsensors: sensors-detect: print a special message when there
+ isn't enough cpu info
+
+When running sensors-detect, if there isn't enough information in
+/proc/cpuinfo for this arch (e.g. ppc64), "Use of uninitialized value
+in concatenation (.) or string at /usr/sbin/sensors-detect line 2867"
+and incomplete "# Processor: (//)" will be printed.
+Here print out a prompt for such a case.
+
+Upstream-Status: Pending
+
+Signed-off-by: Li Zhou <li.zhou@windriver.com>
+---
+ prog/detect/sensors-detect | 7 ++++++-
+ 1 file changed, 6 insertions(+), 1 deletion(-)
+
+diff --git a/prog/detect/sensors-detect b/prog/detect/sensors-detect
+index 3c2b44f..5f62405 100755
+--- a/prog/detect/sensors-detect
++++ b/prog/detect/sensors-detect
+@@ -2864,7 +2864,12 @@ sub initialize_cpu_list
+ sub print_cpu_info
+ {
+ 	my $cpu = $cpu[0];
+-	print "# Processor: $cpu->{'model name'} ($cpu->{'cpu family'}/$cpu->{model}/$cpu->{stepping})\n";
++	if ( $cpu->{'model name'} && $cpu->{'cpu family'} && $cpu->{model} && $cpu->{stepping} ) {
++		print "# Processor: $cpu->{'model name'} ($cpu->{'cpu family'}/$cpu->{model}/$cpu->{stepping})\n";
++	}
++	else {
++		print "# Processor: There isn't enough cpu info for this arch!!!\n";
++	}
+ }
+ 
+ # @i2c_adapters is a list of references to hashes, one hash per I2C/SMBus
+-- 
+1.9.1
+
diff --git a/meta-oe/recipes-support/lm_sensors/lmsensors_3.4.0.bb b/meta-oe/recipes-support/lm_sensors/lmsensors_3.4.0.bb
index 857a57b..8215d90 100644
--- a/meta-oe/recipes-support/lm_sensors/lmsensors_3.4.0.bb
+++ b/meta-oe/recipes-support/lm_sensors/lmsensors_3.4.0.bb
@@ -10,6 +10,7 @@ DEPENDS = "sysfsutils virtual/libiconv bison-native flex-native rrdtool"
 SRC_URI = "http://dl.lm-sensors.org/lm-sensors/releases/lm_sensors-${PV}.tar.bz2 \
            file://fancontrol.init \
            file://sensord.init \
+           file://0001-lmsensors-sensors-detect-print-a-special-message-whe.patch \
 "
 SRC_URI[md5sum] = "c03675ae9d43d60322110c679416901a"
 SRC_URI[sha256sum] = "e0579016081a262dd23eafe1d22b41ebde78921e73a1dcef71e05e424340061f"
-- 
2.9.0



                 reply	other threads:[~2016-09-07  1:47 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160907014629.24264-1-li.zhou@windriver.com \
    --to=li.zhou@windriver.com \
    --cc=openembedded-devel@lists.openembedded.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.