Commit e520df48 authored by Matthew Barth's avatar Matthew Barth Committed by Brad Bishop
Browse files

wspoon: Fix max31785 hwmon startup


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: default avatarMatthew Barth <msbarth@us.ibm.com>
Signed-off-by: default avatarBrad Bishop <bradleyb@fuzziesquirrel.com>
parent 33170c39
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"
......@@ -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
......@@ -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
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment