krishnanadh / rpms / rasdaemon

Forked from rpms/rasdaemon a year ago
Clone

Blame SOURCES/rasdaemon-ras-mc-ctl-Fix-script-to-parse-dimm-sizes.patch

df8b6a
From: Muralidhara M K <muralimk@amd.com>
df8b6a
df8b6a
This patch removes trailing spaces at the end of a line from
df8b6a
file location and fixes --layout option to parse dimm nodes
df8b6a
to get the size from ras-mc-ctl.
df8b6a
df8b6a
Issue is reported https://github.com/mchehab/rasdaemon/issues/43
df8b6a
Where '> ras-mc-ctl --layout' reports all 0s
df8b6a
df8b6a
With this change the layout prints the correct dimm sizes
df8b6a
> sudo ras-mc-ctl --layout
df8b6a
          +-----------------------------------------------+
df8b6a
          |                      mc0                      |
df8b6a
          |  csrow0   |  csrow1   |  csrow2   |  csrow3   |
df8b6a
----------+-----------------------------------------------+
df8b6a
...
df8b6a
channel7: |  16384 MB  |     0 MB  |     0 MB  |     0 MB |
df8b6a
channel6: |  16384 MB  |     0 MB  |     0 MB  |     0 MB |
df8b6a
...
df8b6a
----------+-----------------------------------------------+
df8b6a
df8b6a
Signed-off-by: Muralidhara M K <muralimk@amd.com>
df8b6a
Signed-off-by: Naveen Krishna Chatradhi <nchatrad@amd.com>
df8b6a
---
df8b6a
 util/ras-mc-ctl.in | 2 ++
df8b6a
 1 file changed, 2 insertions(+)
df8b6a
df8b6a
diff --git a/util/ras-mc-ctl.in b/util/ras-mc-ctl.in
df8b6a
index 1e3aeb7..b22dd60 100755
df8b6a
--- a/util/ras-mc-ctl.in
df8b6a
+++ b/util/ras-mc-ctl.in
df8b6a
@@ -246,6 +246,7 @@ sub parse_dimm_nodes
df8b6a
     if (($file =~ /max_location$/)) {
df8b6a
         open IN, $file;
df8b6a
         my $location = <IN>;
df8b6a
+        $location =~ s/\s+$//;
df8b6a
         close IN;
df8b6a
         my @temp = split(/ /, $location);
df8b6a
 
df8b6a
@@ -288,6 +289,7 @@ sub parse_dimm_nodes
df8b6a
 
df8b6a
         open IN, $file;
df8b6a
         my $location = <IN>;
df8b6a
+        $location =~ s/\s+$//;
df8b6a
         close IN;
df8b6a
 
df8b6a
         my @pos;