summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWilliam A. Kennington III <wak@google.com>2019-12-10 04:52:08 +0300
committerBrad Bishop <bradleyb@fuzziesquirrel.com>2019-12-20 00:39:19 +0300
commitc7c0fcc19baafa6ee99e6f920c39464975936987 (patch)
tree44d42d23dd74c73c65ea769de17a7b4863a9fd28
parent3b02cf25d45e7cb0c87df1a4d1c56b00dab7f1bb (diff)
downloadopenbmc-c7c0fcc19baafa6ee99e6f920c39464975936987.tar.xz
phosphor-hwmon: Fix unit escaping
We aren't correctly escaping all of the specical characters based on the systemd spec for unit name escaping. systemd provides a utility to do this reliably, so use that instead of a custom implementation. (From meta-phosphor rev: e1acbce6ac818e411cee8483c89ea6f7b0829162) Change-Id: I239f396f92e6a6b94edcfe48084c41dcc292e1b7 Signed-off-by: William A. Kennington III <wak@google.com> Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
-rwxr-xr-xmeta-phosphor/recipes-phosphor/sensors/phosphor-hwmon/start_hwmon.sh7
1 files changed, 4 insertions, 3 deletions
diff --git a/meta-phosphor/recipes-phosphor/sensors/phosphor-hwmon/start_hwmon.sh b/meta-phosphor/recipes-phosphor/sensors/phosphor-hwmon/start_hwmon.sh
index 2f35865b3..2e346d0fb 100755
--- a/meta-phosphor/recipes-phosphor/sensors/phosphor-hwmon/start_hwmon.sh
+++ b/meta-phosphor/recipes-phosphor/sensors/phosphor-hwmon/start_hwmon.sh
@@ -17,7 +17,8 @@ then
fi
fi
+# Needed to re-do escaping used to avoid bitbake separator conflicts
path="${path//:/--}"
-path="${path//-/\\x2d}"
-
-systemctl --no-block $action 'xyz.openbmc_project.Hwmon@'$path'.service'
+# Needed to escape prior to being used as a unit argument
+path="$(systemd-escape "$path")"
+systemctl --no-block "$action" "xyz.openbmc_project.Hwmon@$path.service"