From cd9db6b70866d3ec78a420c8809d97ac1621e365 Mon Sep 17 00:00:00 2001 From: Matthew Barth Date: Thu, 17 Jun 2021 16:04:30 -0500 Subject: fans: Link phosphor-fan-control service for JSON vs YAML JSON configured phosphor-fan-control only uses the non-init service to start phosphor-fan-control at multi-user.target and poweron in case its stopped after multi-user.target is loaded. YAML configured phosphor-fan-control continues to use both the init and non-init service files without changing the targets each is linked to. Change-Id: I51a6fd9cafb72cde3dc8a0b37423dd56d1184a21 Signed-off-by: Matthew Barth --- meta-phosphor/recipes-phosphor/fans/phosphor-fan_git.bb | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'meta-phosphor/recipes-phosphor/fans/phosphor-fan_git.bb') diff --git a/meta-phosphor/recipes-phosphor/fans/phosphor-fan_git.bb b/meta-phosphor/recipes-phosphor/fans/phosphor-fan_git.bb index e13434eef..708fe4d22 100644 --- a/meta-phosphor/recipes-phosphor/fans/phosphor-fan_git.bb +++ b/meta-phosphor/recipes-phosphor/fans/phosphor-fan_git.bb @@ -84,15 +84,25 @@ FAN_CONTROL_TGT = "obmc-fan-control-ready@{0}.target" TMPL_CONTROL = "phosphor-fan-control@.service" INSTFMT_CONTROL = "phosphor-fan-control@{0}.service" FMT_CONTROL = "../${TMPL_CONTROL}:${FAN_CONTROL_TGT}.requires/${INSTFMT_CONTROL}" +FMT_CONTROL_MUSR = "../${TMPL_CONTROL}:${MULTI_USR_TGT}.wants/${INSTFMT_CONTROL}" +FMT_CONTROL_PWRON = "../${TMPL_CONTROL}:${POWERON_TGT}.requires/${INSTFMT_CONTROL}" TMPL_CONTROL_INIT = "phosphor-fan-control-init@.service" INSTFMT_CONTROL_INIT = "phosphor-fan-control-init@{0}.service" FMT_CONTROL_INIT = "../${TMPL_CONTROL_INIT}:${POWERON_TGT}.wants/${INSTFMT_CONTROL_INIT}" FILES_${PN}-control = "${bindir}/phosphor-fan-control" -SYSTEMD_SERVICE_${PN}-control += "${TMPL_CONTROL} ${TMPL_CONTROL_INIT}" -SYSTEMD_LINK_${PN}-control += "${@compose_list(d, 'FMT_CONTROL', 'OBMC_CHASSIS_INSTANCES')}" -SYSTEMD_LINK_${PN}-control += "${@compose_list(d, 'FMT_CONTROL_INIT', 'OBMC_CHASSIS_INSTANCES')}" +SYSTEMD_SERVICE_${PN}-control += "${TMPL_CONTROL}" +SYSTEMD_SERVICE_${PN}-control += "${@bb.utils.contains('PACKAGECONFIG', 'json', '', '${TMPL_CONTROL_INIT}', d)}" + +# JSON: Linked to multi-user and poweron +# YAML: Linked to fans-ready and fan control-init poweron +SYSTEMD_LINK_${PN}-control += "${@bb.utils.contains('PACKAGECONFIG', 'json', \ + compose_list(d, 'FMT_CONTROL_MUSR', 'OBMC_CHASSIS_INSTANCES'), \ + compose_list(d, 'FMT_CONTROL', 'OBMC_CHASSIS_INSTANCES'), d)}" +SYSTEMD_LINK_${PN}-control += "${@bb.utils.contains('PACKAGECONFIG', 'json', \ + compose_list(d, 'FMT_CONTROL_PWRON', 'OBMC_CHASSIS_INSTANCES'), \ + compose_list(d, 'FMT_CONTROL_INIT', 'OBMC_CHASSIS_INSTANCES'), d)}" # -------------------------------------- # ${PN}-monitor specific configuration -- cgit v1.2.3