meta-facebook: yosemite4: Set the fan LED to amber or blue
Set the fan led to amber when the fan tach triggers critical threshold.
Test Plan:
Modify the threshold and check if the led is correct.
Change-Id: I1ad360c15b2e4ff9c47d6e0bbc81e3a30ab1cd23
Signed-off-by: Delphine CC Chiu <Delphine_CC_Chiu@wiwynn.com>
diff --git a/meta-facebook/meta-yosemite4/recipes-phosphor/leds/phosphor-led-manager_%.bbappend b/meta-facebook/meta-yosemite4/recipes-phosphor/leds/phosphor-led-manager_%.bbappend
new file mode 100644
index 0000000..c12b056
--- /dev/null
+++ b/meta-facebook/meta-yosemite4/recipes-phosphor/leds/phosphor-led-manager_%.bbappend
@@ -0,0 +1,18 @@
+SYSTEMD_SERVICE:${PN}-faultmonitor:remove:yosemite4 = "obmc-fru-fault-monitor.service"
+SYSTEMD_LINK:${PN}:remove:yosemite4 = "../obmc-led-group-start@.service:multi-user.target.wants/obmc-led-group-start@bmc_booted.service"
+SYSTEMD_LINK:${PN}:remove:yosemite4 = "${@compose_list_zip(d, 'FMT', 'CHASSIS_TARGETS', 'STATES')}"
+SYSTEMD_LINK:${PN}:remove:yosemite4 = "${@compose_list(d, 'CHASSIS_LED_BLACKOUT_FMT', 'OBMC_CHASSIS_INSTANCES' )}"
+SYSTEMD_OVERRIDE:${PN}:remove:yosemite4 = "bmc_booted.conf:obmc-led-group-start@bmc_booted.service.d/bmc_booted.conf"
+
+FAN_INSTANCES="0 1 2 3 4 5 6 7 8 9 10 11"
+FAN_OK_START_INSTFMT="obmc-led-group-start@.service:obmc-led-group-start@fan{0}_ok.service"
+SYSTEMD_LINK:${PN} += "${@compose_list_zip(d, 'FAN_OK_START_INSTFMT', 'FAN_INSTANCES')}"
+
+FAN_FAIL_START_INSTFMT="obmc-led-group-start@.service:obmc-led-group-start@fan{0}_fail.service"
+SYSTEMD_LINK:${PN} += "${@compose_list_zip(d, 'FAN_FAIL_START_INSTFMT', 'FAN_INSTANCES')}"
+
+FAN_OK_STOP_INSTFMT="obmc-led-group-stop@.service:obmc-led-group-stop@fan{0}_ok.service"
+SYSTEMD_LINK:${PN} += "${@compose_list_zip(d, 'FAN_OK_STOP_INSTFMT', 'FAN_INSTANCES')}"
+
+FAN_FAIL_STOP_INSTFMT="obmc-led-group-stop@.service:obmc-led-group-stop@fan{0}_fail.service"
+SYSTEMD_LINK:${PN} += "${@compose_list_zip(d, 'FAN_FAIL_STOP_INSTFMT', 'FAN_INSTANCES')}"
diff --git a/meta-facebook/meta-yosemite4/recipes-phosphor/leds/yosemite4-led-manager-config-native.bb b/meta-facebook/meta-yosemite4/recipes-phosphor/leds/yosemite4-led-manager-config-native.bb
new file mode 100644
index 0000000..895d7ee
--- /dev/null
+++ b/meta-facebook/meta-yosemite4/recipes-phosphor/leds/yosemite4-led-manager-config-native.bb
@@ -0,0 +1,17 @@
+SUMMARY = "Phosphor LED Group Management for Yosemite4"
+PR = "r1"
+LICENSE = "Apache-2.0"
+LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/Apache-2.0;md5=89aea4e17d99a7cacdbeed46a0096b10"
+
+inherit native
+
+PROVIDES += "virtual/phosphor-led-manager-config-native"
+
+SRC_URI += "file://led.yaml"
+S = "${WORKDIR}"
+
+do_install() {
+ SRC=${S}
+ DEST=${D}${datadir}/phosphor-led-manager
+ install -D ${SRC}/led.yaml ${DEST}/led.yaml
+}
diff --git a/meta-facebook/meta-yosemite4/recipes-phosphor/leds/yosemite4-led-manager-config/led.yaml b/meta-facebook/meta-yosemite4/recipes-phosphor/leds/yosemite4-led-manager-config/led.yaml
new file mode 100644
index 0000000..7f89492
--- /dev/null
+++ b/meta-facebook/meta-yosemite4/recipes-phosphor/leds/yosemite4-led-manager-config/led.yaml
@@ -0,0 +1,143 @@
+fan0_ok:
+ fan0_blue:
+ Action: "On"
+ fan0_amber:
+ Action: "Off"
+
+fan0_fail:
+ fan0_blue:
+ Action: "Off"
+ fan0_amber:
+ Action: "On"
+
+fan1_ok:
+ fan1_blue:
+ Action: "On"
+ fan1_amber:
+ Action: "Off"
+
+fan1_fail:
+ fan1_blue:
+ Action: "Off"
+ fan1_amber:
+ Action: "On"
+
+fan2_ok:
+ fan2_blue:
+ Action: "On"
+ fan2_amber:
+ Action: "Off"
+
+fan2_fail:
+ fan2_blue:
+ Action: "Off"
+ fan2_amber:
+ Action: "On"
+
+fan3_ok:
+ fan3_blue:
+ Action: "On"
+ fan3_amber:
+ Action: "Off"
+
+fan3_fail:
+ fan3_blue:
+ Action: "Off"
+ fan3_amber:
+ Action: "On"
+
+fan4_ok:
+ fan4_blue:
+ Action: "On"
+ fan4_amber:
+ Action: "Off"
+
+fan4_fail:
+ fan4_blue:
+ Action: "Off"
+ fan4_amber:
+ Action: "On"
+
+fan5_ok:
+ fan5_blue:
+ Action: "On"
+ fan5_amber:
+ Action: "Off"
+
+fan5_fail:
+ fan5_blue:
+ Action: "Off"
+ fan5_amber:
+ Action: "On"
+
+fan6_ok:
+ fan6_blue:
+ Action: "On"
+ fan6_amber:
+ Action: "Off"
+
+fan6_fail:
+ fan6_blue:
+ Action: "Off"
+ fan6_amber:
+ Action: "On"
+
+fan7_ok:
+ fan7_blue:
+ Action: "On"
+ fan7_amber:
+ Action: "Off"
+
+fan7_fail:
+ fan7_blue:
+ Action: "Off"
+ fan7_amber:
+ Action: "On"
+
+fan8_ok:
+ fan8_blue:
+ Action: "On"
+ fan8_amber:
+ Action: "Off"
+
+fan8_fail:
+ fan8_blue:
+ Action: "Off"
+ fan8_amber:
+ Action: "On"
+
+fan9_ok:
+ fan9_blue:
+ Action: "On"
+ fan9_amber:
+ Action: "Off"
+
+fan9_fail:
+ fan9_blue:
+ Action: "Off"
+ fan9_amber:
+ Action: "On"
+
+fan10_ok:
+ fan10_blue:
+ Action: "On"
+ fan10_amber:
+ Action: "Off"
+
+fan10_fail:
+ fan10_blue:
+ Action: "Off"
+ fan10_amber:
+ Action: "On"
+
+fan11_ok:
+ fan11_blue:
+ Action: "On"
+ fan11_amber:
+ Action: "Off"
+
+fan11_fail:
+ fan11_blue:
+ Action: "Off"
+ fan11_amber:
+ Action: "On"