greatlakes: Fix NIC OTP 12V off bug
BMC should 12V-off GL once NIC temperature exceed UNR threshold, the OTP
triggered but didn't link to the 12V-off service. The root cause is the
pkg_postinst was for ${PN} (i.e., phosphor-fan), but meta-facebook only
required "sensor-monitor", which is the sub-package in phosphor-fan. We
also fixed some misspelling and deleted unused statement for folder
creation.
Note:
- Customized meson config for specific project were also be added.
Test Case:
- When NIC temperature touch the UNR threshold, all four slot should
12V Off. --pass
Signed-off-by: Bonnie Lo <Bonnie_Lo@wiwynn.com>
Change-Id: Ic86f0571ce8fbfeef3774cbed9036b58a48d638f
diff --git a/meta-facebook/meta-greatlakes/recipes-phosphor/fans/phosphor-fan_%.bbappend b/meta-facebook/meta-greatlakes/recipes-phosphor/fans/phosphor-fan_%.bbappend
new file mode 100644
index 0000000..0099418
--- /dev/null
+++ b/meta-facebook/meta-greatlakes/recipes-phosphor/fans/phosphor-fan_%.bbappend
@@ -0,0 +1 @@
+EXTRA_OEMESON:greatlakes = "-Duse-host-power-state=enabled -Dsensor-monitor-hard-shutdown-delay=0"
diff --git a/meta-facebook/recipes-fb/packagegroups/packagegroup-fb-apps.bb b/meta-facebook/recipes-fb/packagegroups/packagegroup-fb-apps.bb
index 7c7282b..dd6eeab 100644
--- a/meta-facebook/recipes-fb/packagegroups/packagegroup-fb-apps.bb
+++ b/meta-facebook/recipes-fb/packagegroups/packagegroup-fb-apps.bb
@@ -61,7 +61,7 @@
entity-manager \
dbus-sensors \
phosphor-virtual-sensor \
- sensor-monitor \
+ phosphor-fan-sensor-monitor \
phosphor-gpio-monitor-monitor \
tzdata-core \
${RDEPENDS_PN_SYSTEM_EXTRAS} \
diff --git a/meta-facebook/recipes-phosphor/fans/phosphor-fan_%.bbappend b/meta-facebook/recipes-phosphor/fans/phosphor-fan_%.bbappend
index 4688d8b..9ed68ab 100644
--- a/meta-facebook/recipes-phosphor/fans/phosphor-fan_%.bbappend
+++ b/meta-facebook/recipes-phosphor/fans/phosphor-fan_%.bbappend
@@ -5,7 +5,7 @@
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 \
+ obmc-chassis-poweroff@0.target \
"
SRC_URI:append:fb-withhost = " file://obmc-chassis-hard-poweroff@.target \
@@ -17,11 +17,11 @@
EXTRA_OEMESON = "-Duse-host-power-state=enabled"
-RDEPENDS:sensor-monitor = " bash"
+RDEPENDS:${PN}-sensor-monitor = " bash"
do_install:append:fb-withhost() {
install -d ${D}${systemd_system_unitdir}
- for svc in ${PHOSPHOR_FAN_EXTRA_SERVCIES}; do
+ for svc in ${PHOSPHOR_FAN_EXTRA_SERVICES}; do
install -m 0644 ${WORKDIR}/${svc} ${D}${systemd_system_unitdir}
done
@@ -34,18 +34,19 @@
install -m 0777 ${WORKDIR}/host-poweroff ${D}/usr/libexec/phosphor-fan-sensor-monitor/
}
-pkg_postinst:${PN}() {
+pkg_postinst:${PN}-sensor-monitor() {
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-poweroff@0.target.requires
+ mkdir -p $D/var/lib/phosphor-fan-presence
- LINK="$D$systemd_system_unitdir/obmc-chassis-hard-poweroff@0.target.requires/obmc-chassis-poweroff@0.target"
+ LINK="$D$systemd_system_unitdir/obmc-chassis-hard-poweroff@0.target.requires/obmc-chassis-poweroff@.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"
+ 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}"
+FILES:${PN}-sensor-monitor += "/usr/libexec/phosphor-fan-sensor-monitor/host-poweroff"
+FILES:${PN}-sensor-monitor += "${systemd_system_unitdir}"