summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVincent Chou <vincent.chou@fii-na.com>2022-09-12 18:31:29 +0300
committerVincent Chou <vincent.chou@fii-na.com>2022-10-27 22:17:36 +0300
commitf16ca766474c5fee7f28cf7e17d7053e4903ffa3 (patch)
tree8c180f174eeb43fb1364c986c5d30f97dfbdf781
parent3a39b8b9d50593dc53f828a059beb770f0123ff4 (diff)
downloadopenbmc-f16ca766474c5fee7f28cf7e17d7053e4903ffa3.tar.xz
meta-fii: meta-mori: Set up phosphor-led-manager
Summary of changes: 1. Create a yaml file to set up the action of SYSTEM BOOT STATUS LED 2. Add bb file to install yaml to phosphor led manager package 3. Add a script to control the SYSTEM BOOT STATUS LED corresponding to the OS status 4. Set up phosphor led sysfs so the physical led can be controlled 5. Set CHASSIS TARGET to none to remove unnecessary service call to obmc-led-group-start/stop@power_on/off. Signed-off-by: Vincent Chou <vincent.chou@fii-na.com> Change-Id: Ia7b136c52518a1e2af6662ffc42b4f72b3e15584
-rw-r--r--meta-fii/meta-mori/conf/machine/mori.conf1
-rw-r--r--meta-fii/meta-mori/recipes-mori/boot-status-led/files/boot-status-led.service12
-rw-r--r--meta-fii/meta-mori/recipes-mori/boot-status-led/files/boot-status-led.sh34
-rw-r--r--meta-fii/meta-mori/recipes-mori/boot-status-led/mori-boot-status-led.bb25
-rw-r--r--meta-fii/meta-mori/recipes-phosphor/image/obmc-phosphor-image.bbappend3
-rw-r--r--meta-fii/meta-mori/recipes-phosphor/leds/mori-led-manager-config-native.bb19
-rw-r--r--meta-fii/meta-mori/recipes-phosphor/leds/mori-led-manager-config/led.yaml11
-rw-r--r--meta-fii/meta-mori/recipes-phosphor/leds/phosphor-led-manager_%.bbappend1
8 files changed, 106 insertions, 0 deletions
diff --git a/meta-fii/meta-mori/conf/machine/mori.conf b/meta-fii/meta-mori/conf/machine/mori.conf
index 25ce57cc4d..4d99cb26ce 100644
--- a/meta-fii/meta-mori/conf/machine/mori.conf
+++ b/meta-fii/meta-mori/conf/machine/mori.conf
@@ -25,6 +25,7 @@ PREFERRED_PROVIDER_virtual/obmc-host-ipmi-hw = "phosphor-ipmi-ssif"
PREFERRED_PROVIDER_virtual/bmc-update = "mori-bmc-update"
PREFERRED_PROVIDER_virtual/bios-update = "mori-bios-update"
PREFERRED_PROVIDER_virtual/cpld-update = "mori-cpld-update"
+PREFERRED_PROVIDER_virtual/phosphor-led-manager-config-native = "mori-led-manager-config-native"
# Remove unneeded binaries from image
IMAGE_FEATURES:remove = "obmc-bmcweb"
diff --git a/meta-fii/meta-mori/recipes-mori/boot-status-led/files/boot-status-led.service b/meta-fii/meta-mori/recipes-mori/boot-status-led/files/boot-status-led.service
new file mode 100644
index 0000000000..dc41a1d4a9
--- /dev/null
+++ b/meta-fii/meta-mori/recipes-mori/boot-status-led/files/boot-status-led.service
@@ -0,0 +1,12 @@
+[Unit]
+Description=Boot Status LED Manager
+After=xyz.openbmc_project.LED.GroupManager.service
+Wants=xyz.openbmc_project.LED.GroupManager.service
+
+[Service]
+ExecStart=/usr/bin/boot-status-led.sh
+Type=simple
+Restart=on-failure
+
+[Install]
+WantedBy=multi-user.target
diff --git a/meta-fii/meta-mori/recipes-mori/boot-status-led/files/boot-status-led.sh b/meta-fii/meta-mori/recipes-mori/boot-status-led/files/boot-status-led.sh
new file mode 100644
index 0000000000..e08e1785ef
--- /dev/null
+++ b/meta-fii/meta-mori/recipes-mori/boot-status-led/files/boot-status-led.sh
@@ -0,0 +1,34 @@
+#!/bin/bash
+
+BOOT_SERVICE_NAME="xyz.openbmc_project.State.Host"
+BOOT_STATUS_OBJPATH="/xyz/openbmc_project/state/host0"
+BOOT_INTERFACE_NAME="xyz.openbmc_project.State.OperatingSystem.Status"
+BOOT_Property="OperatingSystemState"
+
+LED_SERVICE_NAME="xyz.openbmc_project.LED.GroupManager"
+LED_INACTIVE_OBJPATH="/xyz/openbmc_project/led/groups/boot_status_inactive"
+LED_STANDBY_OBJPATH="/xyz/openbmc_project/led/groups/boot_status_standby"
+LED_INTERFACE_NAME="xyz.openbmc_project.Led.Group"
+LED_Property="Asserted"
+
+boot_status=""
+led_status=""
+
+while true; do
+ boot_status="$(busctl get-property $BOOT_SERVICE_NAME $BOOT_STATUS_OBJPATH $BOOT_INTERFACE_NAME $BOOT_Property | awk '{print $2}')"
+
+ if [[ $boot_status != "\"xyz.openbmc_project.State.OperatingSystem.Status.OSStatus.Standby\"" ]] && [[ $led_status != "BLINKING" ]];then
+ busctl set-property $LED_SERVICE_NAME $LED_INACTIVE_OBJPATH $LED_INTERFACE_NAME $LED_Property b true
+ busctl set-property $LED_SERVICE_NAME $LED_STANDBY_OBJPATH $LED_INTERFACE_NAME $LED_Property b false
+ led_status="BLINKING"
+ elif [[ $boot_status == "\"xyz.openbmc_project.State.OperatingSystem.Status.OSStatus.Standby\"" ]] && [[ $led_status != "ON" ]];then
+ busctl set-property $LED_SERVICE_NAME $LED_INACTIVE_OBJPATH $LED_INTERFACE_NAME $LED_Property b false
+ busctl set-property $LED_SERVICE_NAME $LED_STANDBY_OBJPATH $LED_INTERFACE_NAME $LED_Property b true
+ led_status="ON"
+ fi
+
+ sleep 10
+
+done
+
+exit 0
diff --git a/meta-fii/meta-mori/recipes-mori/boot-status-led/mori-boot-status-led.bb b/meta-fii/meta-mori/recipes-mori/boot-status-led/mori-boot-status-led.bb
new file mode 100644
index 0000000000..c9b2e9d5e4
--- /dev/null
+++ b/meta-fii/meta-mori/recipes-mori/boot-status-led/mori-boot-status-led.bb
@@ -0,0 +1,25 @@
+SUMMARY = "OpenBMC Mori Boot Status LED Service"
+DESCRIPTION = "OpenBMC Mori Boot Status LED Daemon."
+PR = "r1"
+LICENSE = "Apache-2.0"
+LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/Apache-2.0;md5=89aea4e17d99a7cacdbeed46a0096b10"
+
+inherit systemd
+
+DEPENDS += "systemd"
+RDEPENDS:${PN} += "bash"
+
+SRC_URI = " file://boot-status-led.sh \
+ file://boot-status-led.service \
+ "
+
+do_install() {
+ install -d ${D}${bindir}
+ install -m 0755 ${WORKDIR}/boot-status-led.sh ${D}${bindir}/
+
+ install -d ${D}${systemd_system_unitdir}
+ install -m 0644 ${WORKDIR}/boot-status-led.service ${D}${systemd_system_unitdir}
+}
+
+SYSTEMD_PACKAGES = "${PN}"
+SYSTEMD_SERVICE:${PN} = "boot-status-led.service"
diff --git a/meta-fii/meta-mori/recipes-phosphor/image/obmc-phosphor-image.bbappend b/meta-fii/meta-mori/recipes-phosphor/image/obmc-phosphor-image.bbappend
index 7fe06dc877..0553468075 100644
--- a/meta-fii/meta-mori/recipes-phosphor/image/obmc-phosphor-image.bbappend
+++ b/meta-fii/meta-mori/recipes-phosphor/image/obmc-phosphor-image.bbappend
@@ -56,3 +56,6 @@ OBMC_IMAGE_EXTRA_INSTALL:append:mori = " phosphor-software-manager-download-mgr"
OBMC_IMAGE_EXTRA_INSTALL:append:mori = " phosphor-software-manager-version"
OBMC_IMAGE_EXTRA_INSTALL:append:mori = " phosphor-software-manager-updater"
OBMC_IMAGE_EXTRA_INSTALL:append:mori = " obmc-targets"
+OBMC_IMAGE_EXTRA_INSTALL:append:mori = " mori-boot-status-led"
+OBMC_IMAGE_EXTRA_INSTALL:append:mori = " phosphor-led-manager"
+OBMC_IMAGE_EXTRA_INSTALL:append:mori = " phosphor-led-sysfs"
diff --git a/meta-fii/meta-mori/recipes-phosphor/leds/mori-led-manager-config-native.bb b/meta-fii/meta-mori/recipes-phosphor/leds/mori-led-manager-config-native.bb
new file mode 100644
index 0000000000..0a5282f4bd
--- /dev/null
+++ b/meta-fii/meta-mori/recipes-phosphor/leds/mori-led-manager-config-native.bb
@@ -0,0 +1,19 @@
+SUMMARY = "Phosphor LED Group Management for mori"
+PR = "r1"
+LICENSE = "Apache-2.0"
+LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/Apache-2.0;md5=89aea4e17d99a7cacdbeed46a0096b10"
+
+FILES:${PN} += "${datadir}/phosphor-led-manager/led.yaml"
+
+inherit native
+PROVIDES += "virtual/phosphor-led-manager-config-native"
+SRC_URI += "file://led.yaml"
+S = "${WORKDIR}"
+
+# Overwrite the example led layout yaml file prior
+# to building the phosphor-led-manager package
+do_install() {
+ SRC=${S}
+ DEST=${D}${datadir}/phosphor-led-manager
+ install -D ${SRC}/led.yaml ${DEST}/led.yaml
+}
diff --git a/meta-fii/meta-mori/recipes-phosphor/leds/mori-led-manager-config/led.yaml b/meta-fii/meta-mori/recipes-phosphor/leds/mori-led-manager-config/led.yaml
new file mode 100644
index 0000000000..9d84f94879
--- /dev/null
+++ b/meta-fii/meta-mori/recipes-phosphor/leds/mori-led-manager-config/led.yaml
@@ -0,0 +1,11 @@
+bmc_booted:
+
+boot_status_inactive:
+ boot_status_led:
+ Action: 'Blink'
+ DutyOn: 50
+ Period: 1000
+
+boot_status_standby:
+ boot_status_led:
+ Action: 'On'
diff --git a/meta-fii/meta-mori/recipes-phosphor/leds/phosphor-led-manager_%.bbappend b/meta-fii/meta-mori/recipes-phosphor/leds/phosphor-led-manager_%.bbappend
new file mode 100644
index 0000000000..1231cae2ac
--- /dev/null
+++ b/meta-fii/meta-mori/recipes-phosphor/leds/phosphor-led-manager_%.bbappend
@@ -0,0 +1 @@
+CHASSIS_TARGETS=""