From c7c0fcc19baafa6ee99e6f920c39464975936987 Mon Sep 17 00:00:00 2001 From: "William A. Kennington III" Date: Mon, 9 Dec 2019 17:52:08 -0800 Subject: 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 Signed-off-by: Brad Bishop --- .../recipes-phosphor/sensors/phosphor-hwmon/start_hwmon.sh | 7 ++++--- 1 file 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" -- cgit v1.2.3