From d793c994c8b704f43761d3cb717153d1f766fe4b Mon Sep 17 00:00:00 2001 From: Matt Spinler Date: Fri, 12 Feb 2021 13:02:05 -0600 Subject: Get phosphor-fan-monitor service files from repo The phosphor-fan-presence repo installs different fan monitor service files based on if it was configured in YAML vs JSON mode. Update the recipe to link them in appropriately based on the mode, which is a packageconfig. Delete the service files out of meta-phosphor as they they now come from the repo. Signed-off-by: Matt Spinler Change-Id: Ie2b1bca8aca78b45f77acaff55721a0ff480400d --- .../phosphor-fan/phosphor-fan-monitor-init@.service | 13 ------------- .../fans/phosphor-fan/phosphor-fan-monitor@.service | 11 ----------- .../recipes-phosphor/fans/phosphor-fan_git.bb | 18 ++++++++++++++---- 3 files changed, 14 insertions(+), 28 deletions(-) delete mode 100644 meta-phosphor/recipes-phosphor/fans/phosphor-fan/phosphor-fan-monitor-init@.service delete mode 100644 meta-phosphor/recipes-phosphor/fans/phosphor-fan/phosphor-fan-monitor@.service diff --git a/meta-phosphor/recipes-phosphor/fans/phosphor-fan/phosphor-fan-monitor-init@.service b/meta-phosphor/recipes-phosphor/fans/phosphor-fan/phosphor-fan-monitor-init@.service deleted file mode 100644 index e8a6f699a..000000000 --- a/meta-phosphor/recipes-phosphor/fans/phosphor-fan/phosphor-fan-monitor-init@.service +++ /dev/null @@ -1,13 +0,0 @@ -[Unit] -Description=Phosphor Fan Monitor Initialization -Wants=obmc-power-on@%i.target -After=obmc-power-on@%i.target -Conflicts=obmc-chassis-powered-off@%i.target - -[Service] -Restart=on-failure -ExecStart=/usr/bin/env phosphor-fan-monitor --init -SyslogIdentifier=phosphor-fan-monitor - -[Install] -WantedBy=obmc-chassis-poweron@%i.target diff --git a/meta-phosphor/recipes-phosphor/fans/phosphor-fan/phosphor-fan-monitor@.service b/meta-phosphor/recipes-phosphor/fans/phosphor-fan/phosphor-fan-monitor@.service deleted file mode 100644 index ddecfba3c..000000000 --- a/meta-phosphor/recipes-phosphor/fans/phosphor-fan/phosphor-fan-monitor@.service +++ /dev/null @@ -1,11 +0,0 @@ -[Unit] -Description=Phosphor Fan Monitor Daemon -Conflicts=obmc-chassis-powered-off@%i.target - -[Service] -Restart=on-failure -ExecStart=/usr/bin/env phosphor-fan-monitor --monitor -SyslogIdentifier=phosphor-fan-monitor - -[Install] -RequiredBy=obmc-fan-control-ready@%i.target diff --git a/meta-phosphor/recipes-phosphor/fans/phosphor-fan_git.bb b/meta-phosphor/recipes-phosphor/fans/phosphor-fan_git.bb index e1eb2caca..e13434eef 100644 --- a/meta-phosphor/recipes-phosphor/fans/phosphor-fan_git.bb +++ b/meta-phosphor/recipes-phosphor/fans/phosphor-fan_git.bb @@ -105,16 +105,26 @@ PACKAGECONFIG[monitor] = "--enable-monitor \ TMPL_MONITOR = "phosphor-fan-monitor@.service" INSTFMT_MONITOR = "phosphor-fan-monitor@{0}.service" -FMT_MONITOR = "../${TMPL_MONITOR}:${FAN_CONTROL_TGT}.requires/${INSTFMT_MONITOR}" +FMT_MONITOR_FANSREADY = "../${TMPL_MONITOR}:${FAN_CONTROL_TGT}.requires/${INSTFMT_MONITOR}" +FMT_MONITOR_PWRON = "../${TMPL_MONITOR}:${POWERON_TGT}.requires/${INSTFMT_MONITOR}" +FMT_MONITOR_MUSR = "../${TMPL_MONITOR}:${MULTI_USR_TGT}.wants/${INSTFMT_MONITOR}" TMPL_MONITOR_INIT = "phosphor-fan-monitor-init@.service" INSTFMT_MONITOR_INIT = "phosphor-fan-monitor-init@{0}.service" FMT_MONITOR_INIT = "../${TMPL_MONITOR_INIT}:${POWERON_TGT}.wants/${INSTFMT_MONITOR_INIT}" FILES_${PN}-monitor = "${bindir}/phosphor-fan-monitor" -SYSTEMD_SERVICE_${PN}-monitor += "${TMPL_MONITOR} ${TMPL_MONITOR_INIT}" -SYSTEMD_LINK_${PN}-monitor += "${@compose_list(d, 'FMT_MONITOR', 'OBMC_CHASSIS_INSTANCES')}" -SYSTEMD_LINK_${PN}-monitor += "${@compose_list(d, 'FMT_MONITOR_INIT', 'OBMC_CHASSIS_INSTANCES')}" +SYSTEMD_SERVICE_${PN}-monitor += "${TMPL_MONITOR}" +SYSTEMD_SERVICE_${PN}-monitor += "${@bb.utils.contains('PACKAGECONFIG', 'json', '', '${TMPL_MONITOR_INIT}', d)}" + +# JSON: power on and multi-user links. YAML: fans-ready and fan monitor init links +SYSTEMD_LINK_${PN}-monitor += "${@bb.utils.contains('PACKAGECONFIG', 'json', \ + compose_list(d, 'FMT_MONITOR_PWRON', 'OBMC_CHASSIS_INSTANCES'), \ + compose_list(d, 'FMT_MONITOR_FANSREADY', 'OBMC_CHASSIS_INSTANCES'), d)}" + +SYSTEMD_LINK_${PN}-monitor += "${@bb.utils.contains('PACKAGECONFIG', 'json', \ + compose_list(d, 'FMT_MONITOR_MUSR', 'OBMC_CHASSIS_INSTANCES'), \ + compose_list(d, 'FMT_MONITOR_INIT', 'OBMC_CHASSIS_INSTANCES'), d)}" # -------------------------------------- # phosphor-cooling-type specific configuration -- cgit v1.2.3