summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick Williams <patrick@stwcx.xyz>2022-11-02 20:50:45 +0300
committerPatrick Williams <patrick@stwcx.xyz>2022-11-02 23:09:13 +0300
commitb7950eec2cbe95032e524bd64be054d80ee55798 (patch)
tree1bc0e322e953bf6ede7dc956b9816fe969c2a3de
parent1f649909eb50e641e6f61c3733017197d088e6a3 (diff)
downloadopenbmc-b7950eec2cbe95032e524bd64be054d80ee55798.tar.xz
meta-facebook: phosphor-fan: avoid conflict with PSM targets
When using PSM, phosphor-fan is not responsible for installing some of the target files and bitbake fails with two packages installing the same files. Add some detection as a quick workaround so that Greatlakes can successfully build. Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: Idf7b49baa9a030cbf5afc983459d66f2557e085b
-rw-r--r--meta-facebook/recipes-phosphor/fans/phosphor-fan_%.bbappend52
1 files changed, 26 insertions, 26 deletions
diff --git a/meta-facebook/recipes-phosphor/fans/phosphor-fan_%.bbappend b/meta-facebook/recipes-phosphor/fans/phosphor-fan_%.bbappend
index 54eb51d1bb..4688d8b1df 100644
--- a/meta-facebook/recipes-phosphor/fans/phosphor-fan_%.bbappend
+++ b/meta-facebook/recipes-phosphor/fans/phosphor-fan_%.bbappend
@@ -1,5 +1,13 @@
FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:"
+OVERRIDES:append = "${@bb.utils.contains('VIRTUAL-RUNTIME_obmc-host-state-manager', 'phosphor-state-manager-host', ':phosphor-fan-with-psm', ':phosphor-fan-without-psm', d)}"
+
+PHOSPHOR_FAN_EXTRA_SERVICES = "obmc-poweroff.service"
+PHOSPHOR_FAN_EXTRA_SERVICES:append:phosphor-fan-without-psm = " \
+ obmc-chassis-hard-poweroff@.target \
+ obmc-chassis-poweroff@.target \
+ "
+
SRC_URI:append:fb-withhost = " file://obmc-chassis-hard-poweroff@.target \
file://obmc-chassis-poweroff@0.target \
file://obmc-poweroff.service \
@@ -12,40 +20,32 @@ EXTRA_OEMESON = "-Duse-host-power-state=enabled"
RDEPENDS:sensor-monitor = " bash"
do_install:append:fb-withhost() {
+ install -d ${D}${systemd_system_unitdir}
+ for svc in ${PHOSPHOR_FAN_EXTRA_SERVCIES}; do
+ install -m 0644 ${WORKDIR}/${svc} ${D}${systemd_system_unitdir}
+ done
-install -d ${D}${systemd_system_unitdir}
-install -m 0644 ${WORKDIR}/obmc-chassis-hard-poweroff@.target ${D}${systemd_system_unitdir}
-install -m 0644 ${WORKDIR}/obmc-chassis-poweroff@0.target ${D}${systemd_system_unitdir}
-install -m 0644 ${WORKDIR}/obmc-poweroff.service ${D}${systemd_system_unitdir}
-
-# Store the bitbake variable OBMC_HOST_INSTANCES inside the script as HOST_INSTANCES variable using sed.
-sed -i -e "s,HOST_INSTANCES_SED_REPLACEMENT_VALUE,${OBMC_HOST_INSTANCES},g" ${WORKDIR}/host-poweroff
-
-install -m 0755 -d ${D}/var/lib/phosphor-fan-presence/sensor-monitor
+ # Store the bitbake variable OBMC_HOST_INSTANCES inside the script as HOST_INSTANCES variable using sed.
+ sed -i -e "s,HOST_INSTANCES_SED_REPLACEMENT_VALUE,${OBMC_HOST_INSTANCES},g" ${WORKDIR}/host-poweroff
-install -d ${D}/usr/libexec/phosphor-fan-sensor-monitor
-install -m 0777 ${WORKDIR}/host-poweroff ${D}/usr/libexec/phosphor-fan-sensor-monitor/
+ install -m 0755 -d ${D}/var/lib/phosphor-fan-presence/sensor-monitor
+ install -d ${D}/usr/libexec/phosphor-fan-sensor-monitor
+ install -m 0777 ${WORKDIR}/host-poweroff ${D}/usr/libexec/phosphor-fan-sensor-monitor/
}
pkg_postinst:${PN}() {
+ mkdir -p $D$systemd_system_unitdir/obmc-chassis-hard-poweroff@0.target.requires
+ mkdir -p $D$systemd_system_unitdir/obmc-chassis-hard-poweroff@0.target.requires/obmc-chassis-poweroff@0.target.requires
-mkdir -p $D$systemd_system_unitdir/obmc-chassis-hard-poweroff@0.target.requires
-mkdir -p $D$systemd_system_unitdir/obmc-chassis-hard-poweroff@0.target.requires/obmc-chassis-poweroff@0.target.requires
-
-LINK="$D$systemd_system_unitdir/obmc-chassis-hard-poweroff@0.target.requires/obmc-chassis-poweroff@0.target"
-TARGET="../obmc-chassis-poweroff@0.target"
-ln -s $TARGET $LINK
-
-LINK="$D$systemd_system_unitdir/obmc-chassis-hard-poweroff@0.target.requires/obmc-chassis-poweroff@0.target.requires/obmc-poweroff.service"
-TARGET="../../obmc-poweroff.service"
-ln -s $TARGET $LINK
+ LINK="$D$systemd_system_unitdir/obmc-chassis-hard-poweroff@0.target.requires/obmc-chassis-poweroff@0.target"
+ TARGET="../obmc-chassis-poweroff@0.target"
+ ln -s $TARGET $LINK
+ LINK="$D$systemd_system_unitdir/obmc-chassis-poweroff@0.target.requires/obmc-poweroff.service"
+ TARGET="../../obmc-poweroff.service"
+ ln -s $TARGET $LINK
}
FILES:sensor-monitor += "/usr/libexec/phosphor-fan-sensor-monitor/host-poweroff"
-
-FILES:sensor-monitor += "${systemd_system_unitdir}/obmc-chassis-hard-poweroff@.target"
-FILES:sensor-monitor += "${systemd_system_unitdir}/obmc-chassis-poweroff@0.target "
-FILES:sensor-monitor += "${systemd_system_unitdir}/obmc-poweroff.service"
-
+FILES:sensor-monitor += "${systemd_system_unitdir}"