Install service unit files, busconfig and udev rules from the package.
This change required as a part of privilege separation work:
https://github.com/openbmc/openbmc/issues/3383
The dependant change in openbmc repo:
https://gerrit.openbmc-project.xyz/c/openbmc/openbmc/+/40359
Signed-off-by: Anton D. Kachalov <gmouse@google.com>
Change-Id: I89aec71b446e0b7be40a10e1cd94ea16d891a277
diff --git a/start_hwmon.sh b/start_hwmon.sh
new file mode 100755
index 0000000..2e346d0
--- /dev/null
+++ b/start_hwmon.sh
@@ -0,0 +1,24 @@
+#!/bin/bash
+
+action=$1
+devpath=$2
+of_fullname=$3
+
+#Use of_fullname if it's there, otherwise use devpath.
+
+path=$of_fullname
+if [ -z "$path" ]
+then
+ path=$devpath
+
+ if [[ "$path" =~ (.*)/hwmon/hwmon[0-9]+$ ]];
+ then
+ path=${BASH_REMATCH[1]}
+ fi
+fi
+
+# Needed to re-do escaping used to avoid bitbake separator conflicts
+path="${path//:/--}"
+# 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"