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/msl/meson.build b/msl/meson.build
index f63f722..72633f7 100644
--- a/msl/meson.build
+++ b/msl/meson.build
@@ -4,6 +4,12 @@
input: 'max31785-msl',
install: true,
install_dir: get_option('bindir'),
+ install_mode: 'rwxr-xr-x',
output: 'max31785-msl',
)
+
+install_data(
+ 'phosphor-max31785-msl@.service',
+ install_dir: systemd_system_unit_dir
+)
endif
diff --git a/msl/phosphor-max31785-msl@.service b/msl/phosphor-max31785-msl@.service
new file mode 100644
index 0000000..67788ae
--- /dev/null
+++ b/msl/phosphor-max31785-msl@.service
@@ -0,0 +1,12 @@
+[Unit]
+Description=Phosphor MAX31785 MSL
+ConditionFileNotEmpty=/etc/default/obmc/hwmon-max31785/%I.conf
+Wants=mapper-wait@-xyz-openbmc_project-inventory.service
+After=mapper-wait@-xyz-openbmc_project-inventory.service
+
+[Service]
+Type=oneshot
+ExecStart=/usr/bin/env max31785-msl -p "${PATHS}" -b ${BUS} -r ${REVISION}
+EnvironmentFile=/etc/default/obmc/hwmon-max31785/%I.conf
+SyslogIdentifier=max31785-msl
+RemainAfterExit=yes