diff options
author | William A. Kennington III <wak@google.com> | 2019-12-10 04:52:08 +0300 |
---|---|---|
committer | Brad Bishop <bradleyb@fuzziesquirrel.com> | 2019-12-20 00:39:19 +0300 |
commit | c7c0fcc19baafa6ee99e6f920c39464975936987 (patch) | |
tree | 44d42d23dd74c73c65ea769de17a7b4863a9fd28 /meta-phosphor | |
parent | 3b02cf25d45e7cb0c87df1a4d1c56b00dab7f1bb (diff) | |
download | openbmc-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>
Diffstat (limited to 'meta-phosphor')
-rwxr-xr-x | meta-phosphor/recipes-phosphor/sensors/phosphor-hwmon/start_hwmon.sh | 7 |
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" |