diff options
author | Anton D. Kachalov <gmouse@google.com> | 2021-02-06 14:23:10 +0300 |
---|---|---|
committer | Anton D. Kachalov <gmouse@google.com> | 2021-05-07 11:48:55 +0300 |
commit | 22e0025925e853040a4c829abd3077c960aca831 (patch) | |
tree | a289ad41c92b3d98090b9855e7ddf0cd7512b1e8 | |
parent | 39c444bb509d1d3560b63ebaa66b573772dcf223 (diff) | |
download | openbmc-22e0025925e853040a4c829abd3077c960aca831.tar.xz |
phosphor-hwmon: install configs from repo
Use meson to build the package.
This change required as a part of privilege separation work:
https://github.com/openbmc/openbmc/issues/3383
This change should be merged after individual repo change:
https://gerrit.openbmc-project.xyz/c/openbmc/phosphor-hwmon/+/40277
Signed-off-by: Anton D. Kachalov <gmouse@google.com>
Change-Id: I542645d55b8646e0ddb3fb95f50a1cd87334706e
6 files changed, 7 insertions, 67 deletions
diff --git a/meta-phosphor/recipes-phosphor/sensors/phosphor-hwmon/70-hwmon.rules b/meta-phosphor/recipes-phosphor/sensors/phosphor-hwmon/70-hwmon.rules deleted file mode 100644 index 503b2d002b..0000000000 --- a/meta-phosphor/recipes-phosphor/sensors/phosphor-hwmon/70-hwmon.rules +++ /dev/null @@ -1,2 +0,0 @@ -SUBSYSTEM=="hwmon", ACTION=="add", RUN="/usr/bin/start_hwmon.sh start %p %E{OF_FULLNAME}" -SUBSYSTEM=="hwmon", ACTION=="remove", RUN="/usr/bin/start_hwmon.sh stop %p %E{OF_FULLNAME}" diff --git a/meta-phosphor/recipes-phosphor/sensors/phosphor-hwmon/70-iio.rules b/meta-phosphor/recipes-phosphor/sensors/phosphor-hwmon/70-iio.rules deleted file mode 100644 index 45fb4b0fb6..0000000000 --- a/meta-phosphor/recipes-phosphor/sensors/phosphor-hwmon/70-iio.rules +++ /dev/null @@ -1,2 +0,0 @@ -SUBSYSTEM=="iio", ACTION=="add", RUN="/usr/bin/start_hwmon.sh start %p %E{OF_FULLNAME}" -SUBSYSTEM=="iio", ACTION=="remove", RUN="/usr/bin/start_hwmon.sh stop %p %E{OF_FULLNAME}" diff --git a/meta-phosphor/recipes-phosphor/sensors/phosphor-hwmon/phosphor-max31785-msl@.service b/meta-phosphor/recipes-phosphor/sensors/phosphor-hwmon/phosphor-max31785-msl@.service deleted file mode 100644 index c007f1188b..0000000000 --- a/meta-phosphor/recipes-phosphor/sensors/phosphor-hwmon/phosphor-max31785-msl@.service +++ /dev/null @@ -1,12 +0,0 @@ -[Unit] -Description=Phosphor MAX31785 MSL -ConditionFileNotEmpty={envfiledir}/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={envfiledir}/obmc/hwmon-max31785/%I.conf -SyslogIdentifier=max31785-msl -RemainAfterExit=yes diff --git a/meta-phosphor/recipes-phosphor/sensors/phosphor-hwmon/start_hwmon.sh b/meta-phosphor/recipes-phosphor/sensors/phosphor-hwmon/start_hwmon.sh deleted file mode 100755 index 2e346d0fb3..0000000000 --- a/meta-phosphor/recipes-phosphor/sensors/phosphor-hwmon/start_hwmon.sh +++ /dev/null @@ -1,24 +0,0 @@ -#!/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" diff --git a/meta-phosphor/recipes-phosphor/sensors/phosphor-hwmon/xyz.openbmc_project.Hwmon@.service b/meta-phosphor/recipes-phosphor/sensors/phosphor-hwmon/xyz.openbmc_project.Hwmon@.service deleted file mode 100644 index b930b57110..0000000000 --- a/meta-phosphor/recipes-phosphor/sensors/phosphor-hwmon/xyz.openbmc_project.Hwmon@.service +++ /dev/null @@ -1,10 +0,0 @@ -[Unit] -Description=Phosphor Hwmon Poller -ConditionFileNotEmpty=/etc/default/obmc/hwmon/%I.conf -After=xyz.openbmc_project.ObjectMapper.service - -[Service] -Restart=on-failure -ExecStart=/usr/bin/env phosphor-hwmon-readd -o %I -SyslogIdentifier=phosphor-hwmon-readd -EnvironmentFile=/etc/default/obmc/hwmon/%I.conf diff --git a/meta-phosphor/recipes-phosphor/sensors/phosphor-hwmon_git.bb b/meta-phosphor/recipes-phosphor/sensors/phosphor-hwmon_git.bb index 59bb0b9830..f0b7fc81f7 100644 --- a/meta-phosphor/recipes-phosphor/sensors/phosphor-hwmon_git.bb +++ b/meta-phosphor/recipes-phosphor/sensors/phosphor-hwmon_git.bb @@ -5,10 +5,11 @@ PV = "1.0+git${SRCPV}" LICENSE = "Apache-2.0" LIC_FILES_CHKSUM = "file://LICENSE;md5=fa818a259cbed7ce8bc2a22d35a464fc" -inherit meson pkgconfig +inherit meson inherit obmc-phosphor-systemd PACKAGECONFIG ??= "" +# Meson configure option to enable/disable max31785-msl PACKAGECONFIG[max31785-msl] = "-Denable-max31785-msl=true, -Denable-max31785-msl=false" PACKAGE_BEFORE_PN = "max31785-msl" @@ -17,7 +18,6 @@ SYSTEMD_PACKAGES = "${PN} max31785-msl" SYSTEMD_SERVICE_${PN} = "xyz.openbmc_project.Hwmon@.service" SYSTEMD_SERVICE_max31785-msl = "${@bb.utils.contains('PACKAGECONFIG', 'max31785-msl', 'phosphor-max31785-msl@.service', '', d)}" -DEPENDS += "autoconf-archive-native" DEPENDS += " \ sdbusplus \ sdeventplus \ @@ -28,31 +28,21 @@ DEPENDS += " \ cli11 \ " - +FILES_${PN} += "${base_libdir}/systemd/system/xyz.openbmc_project.Hwmon@.service" RDEPENDS_${PN} += "\ bash \ " RRECOMMENDS_${PN} += "${VIRTUAL-RUNTIME_phosphor-hwmon-config}" -FILES_max31785-msl = "${bindir}/max31785-msl" +FILES_max31785-msl = "\ + ${base_libdir}/systemd/system/phosphor-max31785-msl@.service \ + ${bindir}/max31785-msl \ + " RDEPENDS_max31785-msl = "${VIRTUAL-RUNTIME_base-utils} i2c-tools bash" SRC_URI += "git://github.com/openbmc/phosphor-hwmon" -SRC_URI += "file://70-hwmon.rules" -SRC_URI += "file://70-iio.rules" -SRC_URI += "file://start_hwmon.sh" SRCREV = "5b520cf494ad65be2d336f60ee622efc456c2e3f" S = "${WORKDIR}/git" - -do_install_append() { - - install -d ${D}/${base_libdir}/udev/rules.d/ - install -m 0644 ${WORKDIR}/70-hwmon.rules ${D}/${base_libdir}/udev/rules.d/ - install -m 0644 ${WORKDIR}/70-iio.rules ${D}/${base_libdir}/udev/rules.d/ - - install -d ${D}${bindir} - install -m 0755 ${WORKDIR}/start_hwmon.sh ${D}${bindir} -} |