summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Barth <msbarth@us.ibm.com>2018-12-14 15:57:46 -0600
committerBrad Bishop <bradleyb@fuzziesquirrel.com>2019-01-09 20:14:57 +0000
commite520df4806617df03146fe523fd5c308b5a6ac82 (patch)
tree86c8550413916e2f63b51f9d2c7b804af0b7da37
parent33170c397695a768aa9e00bb2928f1cf24a9bab7 (diff)
downloadtalos-openbmc-2.6.0-rc1.tar.gz
talos-openbmc-2.6.0-rc1.zip
wspoon: Fix max31785 hwmon startup2.6.0.rc12.6.0-rc1
The max31785 hwmon instance fails to start after a systemd patch was removed to handle special characters in the device paths. This uses `systemd-escape` to escape and unescape the device path when the udev rule triggers the max31785 hwmon startup script. Resolves openbmc/openbmc#3443 (From meta-ibm rev: 2790b22411920574b95111a44137be21e07a2e3a) Change-Id: I46d1d1a9de8cb740bfd57cebfd5b2474ff69246c Signed-off-by: Matthew Barth <msbarth@us.ibm.com> Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
-rwxr-xr-xmeta-ibm/meta-witherspoon/recipes-phosphor/sensors/phosphor-hwmon/70-max31785-hwmon.rules2
-rw-r--r--meta-ibm/meta-witherspoon/recipes-phosphor/sensors/phosphor-hwmon/max31785-hwmon-helper@.service2
-rwxr-xr-xmeta-ibm/meta-witherspoon/recipes-phosphor/sensors/phosphor-hwmon/start_max31785_hwmon.sh6
3 files changed, 5 insertions, 5 deletions
diff --git a/meta-ibm/meta-witherspoon/recipes-phosphor/sensors/phosphor-hwmon/70-max31785-hwmon.rules b/meta-ibm/meta-witherspoon/recipes-phosphor/sensors/phosphor-hwmon/70-max31785-hwmon.rules
index e1c3172f4..fd63e0549 100755
--- a/meta-ibm/meta-witherspoon/recipes-phosphor/sensors/phosphor-hwmon/70-max31785-hwmon.rules
+++ b/meta-ibm/meta-witherspoon/recipes-phosphor/sensors/phosphor-hwmon/70-max31785-hwmon.rules
@@ -1 +1 @@
-SUBSYSTEM=="hwmon", ACTION=="add", ENV{OF_NAME}=="max31785", RUN="/bin/systemctl start max31785-hwmon-helper@%E{OF_FULLNAME}.service"
+SUBSYSTEM=="hwmon", ACTION=="add", ENV{OF_NAME}=="max31785", PROGRAM="/bin/systemd-escape -p '%E{OF_FULLNAME}'", RUN="/bin/systemctl start max31785-hwmon-helper@%c.service"
diff --git a/meta-ibm/meta-witherspoon/recipes-phosphor/sensors/phosphor-hwmon/max31785-hwmon-helper@.service b/meta-ibm/meta-witherspoon/recipes-phosphor/sensors/phosphor-hwmon/max31785-hwmon-helper@.service
index 98b5541f2..c7ed6f113 100644
--- a/meta-ibm/meta-witherspoon/recipes-phosphor/sensors/phosphor-hwmon/max31785-hwmon-helper@.service
+++ b/meta-ibm/meta-witherspoon/recipes-phosphor/sensors/phosphor-hwmon/max31785-hwmon-helper@.service
@@ -5,5 +5,5 @@ After=phosphor-cooling-type@0.service
[Service]
Type=oneshot
-ExecStart=/usr/bin/env start_max31785_hwmon.sh %I
+ExecStart=/usr/bin/env start_max31785_hwmon.sh %i
SyslogIdentifier=max31785-hwmon-helper
diff --git a/meta-ibm/meta-witherspoon/recipes-phosphor/sensors/phosphor-hwmon/start_max31785_hwmon.sh b/meta-ibm/meta-witherspoon/recipes-phosphor/sensors/phosphor-hwmon/start_max31785_hwmon.sh
index 6d4e6ba1e..5eff17450 100755
--- a/meta-ibm/meta-witherspoon/recipes-phosphor/sensors/phosphor-hwmon/start_max31785_hwmon.sh
+++ b/meta-ibm/meta-witherspoon/recipes-phosphor/sensors/phosphor-hwmon/start_max31785_hwmon.sh
@@ -3,9 +3,9 @@
# Copy in the correct MAX31785 phosphor-hwmon config file to use based on the
# WaterCooled property, and then start the hwmon service.
-# $1: The OF_FULLNAME udev attribute for the MAX31785
+# $1: The escaped OF_FULLNAME udev attribute for the MAX31785
-base="/etc/default/obmc/hwmon/"$1
+base="/etc/default/obmc/hwmon/"$(systemd-escape -u "$1")
target=$base".conf"
service=$(mapper get-service /xyz/openbmc_project/inventory/system/chassis)
@@ -22,5 +22,5 @@ fi
cp $source $target
-instance=$(systemd-escape $1)
+instance='-'$1
systemctl start xyz.openbmc_project.Hwmon@$instance.service
OpenPOWER on IntegriCloud