diff options
Diffstat (limited to 'meta-phosphor/recipes-phosphor/leds')
14 files changed, 209 insertions, 0 deletions
diff --git a/meta-phosphor/recipes-phosphor/leds/phosphor-led-manager-config-example-native.bb b/meta-phosphor/recipes-phosphor/leds/phosphor-led-manager-config-example-native.bb new file mode 100644 index 0000000000..4b546d05ff --- /dev/null +++ b/meta-phosphor/recipes-phosphor/leds/phosphor-led-manager-config-example-native.bb @@ -0,0 +1,16 @@ +SUMMARY = "Phosphor LED Group Management with example data" +PR = "r1" + +inherit native +require phosphor-led-manager.inc + +PROVIDES += "virtual/phosphor-led-manager-config-native" + +S = "${WORKDIR}/git" + +# Copies example led layout yaml file +do_install() { + SRC=${S} + DEST=${D}${datadir}/phosphor-led-manager + install -D ${SRC}/led.yaml ${DEST}/led.yaml +} diff --git a/meta-phosphor/recipes-phosphor/leds/phosphor-led-manager-config-mrw-native.bb b/meta-phosphor/recipes-phosphor/leds/phosphor-led-manager-config-mrw-native.bb new file mode 100644 index 0000000000..920f637453 --- /dev/null +++ b/meta-phosphor/recipes-phosphor/leds/phosphor-led-manager-config-mrw-native.bb @@ -0,0 +1,24 @@ +SUMMARY = "Phosphor LED Group Management with MRW generated data" +PR = "r1" + +inherit native +inherit obmc-phosphor-utils +inherit obmc-phosphor-license +inherit mrw-xml + +PROVIDES += "virtual/phosphor-led-manager-config-native" +DEPENDS += "mrw-native mrw-perl-tools-native" + +# Generate a YAML files based on MRW input +do_install_append() { + USE_MRW="${@df_enabled(d, 'obmc-mrw', 'yes')}" + DEST=${D}${datadir}/phosphor-led-manager + + if [ "${USE_MRW}" = "yes" ]; then + install -d ${DEST}/ + ${STAGING_BINDIR_NATIVE}/perl-native/perl \ + ${STAGING_BINDIR_NATIVE}/gen_led_groups.pl \ + -i ${mrw_datadir}/${MRW_XML} \ + -o ${DEST}/led.yaml + fi +} diff --git a/meta-phosphor/recipes-phosphor/leds/phosphor-led-manager-error-native.bb b/meta-phosphor/recipes-phosphor/leds/phosphor-led-manager-error-native.bb new file mode 100644 index 0000000000..c8ec04127f --- /dev/null +++ b/meta-phosphor/recipes-phosphor/leds/phosphor-led-manager-error-native.bb @@ -0,0 +1,21 @@ +SUMMARY = "Copy error yaml files to known path for elog parsing" +PR = "r1" +LICENSE = "Apache-2.0" +LIC_FILES_CHKSUM = "file://${PHOSPHORBASE}/COPYING.apache-2.0;md5=34400b68072d710fecd0a2940a0d1658" + +inherit native +inherit phosphor-dbus-yaml + +require phosphor-led-manager.inc + +S = "${WORKDIR}/git" + +do_install_append() { + SRC=${S}/xyz/openbmc_project/Led/ + DEST=${D}${yaml_dir}/xyz/openbmc_project/Led/ + install -d ${DEST}/Fru + install ${SRC}/*.errors.yaml ${DEST} + install ${SRC}/*.metadata.yaml ${DEST} + install ${SRC}/Fru/*.errors.yaml ${DEST}/Fru + install ${SRC}/Fru/*.metadata.yaml ${DEST}/Fru +} diff --git a/meta-phosphor/recipes-phosphor/leds/phosphor-led-manager.bb b/meta-phosphor/recipes-phosphor/leds/phosphor-led-manager.bb new file mode 100644 index 0000000000..d501d332a1 --- /dev/null +++ b/meta-phosphor/recipes-phosphor/leds/phosphor-led-manager.bb @@ -0,0 +1,56 @@ +SUMMARY = "Phosphor LED Group Management Daemon" +DESCRIPTION = "Daemon to cater to triggering actions on LED groups" +PR = "r1" + +require ${PN}.inc + +inherit autotools pkgconfig pythonnative +inherit obmc-phosphor-dbus-service obmc-phosphor-systemd + +LED_MGR_PACKAGES = " \ + ${PN}-ledmanager \ + ${PN}-faultmonitor \ +" + +PACKAGE_BEFORE_PN += "${LED_MGR_PACKAGES}" +ALLOW_EMPTY_${PN} = "1" + +DBUS_PACKAGES = "${PN}-ledmanager" + +SYSTEMD_PACKAGES = "${LED_MGR_PACKAGES}" + +DEPENDS += "python-pyyaml-native" +DEPENDS += "autoconf-archive-native" +DEPENDS += "sdbusplus sdbusplus-native" +DEPENDS += "phosphor-logging" + +DEPENDS += "virtual/${PN}-config-native" +RDEPENDS_${PN}-ledmanager += "libsystemd" +RDEPENDS_${PN}-ledmanager += "phosphor-logging" + +RDEPENDS_${PN}-faultmonitor += "libsystemd" +RDEPENDS_${PN}-faultmonitor += "phosphor-logging" + +S = "${WORKDIR}/git" + +FILES_${PN}-ledmanager += "${sbindir}/phosphor-ledmanager" +FILES_${PN}-faultmonitor += "${sbindir}/phosphor-fru-fault-monitor" + +DBUS_SERVICE_${PN}-ledmanager += "xyz.openbmc_project.LED.GroupManager.service" + +SYSTEMD_SERVICE_${PN}-ledmanager += "obmc-led-group-start@.service obmc-led-group-stop@.service" +SYSTEMD_SERVICE_${PN}-faultmonitor += "obmc-fru-fault-monitor.service" + +SYSTEMD_LINK_${PN}-ledmanager += "../obmc-led-group-start@.service:${SYSTEMD_DEFAULT_TARGET}.wants/obmc-led-group-start@bmc_booted.service" + +STATES = "start stop" +TMPLFMT = "obmc-led-group-{0}@.service" +TGTFMT = "obmc-power-{0}@0.target" +INSTFMT = "obmc-led-group-{0}@power_on.service" +FMT = "../${TMPLFMT}:${TGTFMT}.wants/${INSTFMT}" +SYSTEMD_LINK_${PN}-ledmanager += "${@compose_list(d, 'FMT', 'STATES')}" + +# Install the override to set up a Conflicts relation +SYSTEMD_OVERRIDE_${PN}-ledmanager += "bmc_booted.conf:obmc-led-group-start@bmc_booted.service.d/bmc_booted.conf" + +EXTRA_OECONF = "YAML_PATH=${STAGING_DATADIR_NATIVE}/${PN}" diff --git a/meta-phosphor/recipes-phosphor/leds/phosphor-led-manager.inc b/meta-phosphor/recipes-phosphor/leds/phosphor-led-manager.inc new file mode 100644 index 0000000000..0562742e55 --- /dev/null +++ b/meta-phosphor/recipes-phosphor/leds/phosphor-led-manager.inc @@ -0,0 +1,5 @@ +HOMEPAGE = "http://github.com/openbmc/phosphor-led-manager" +LICENSE = "Apache-2.0" +LIC_FILES_CHKSUM = "file://LICENSE;md5=e3fc50a88d0a364313df4b21ef20c29e" +SRC_URI += "git://github.com/openbmc/phosphor-led-manager" +SRCREV = "08d613e7d549d647105bb7ff5a6d3716708d2332" diff --git a/meta-phosphor/recipes-phosphor/leds/phosphor-led-manager/bmc_booted.conf b/meta-phosphor/recipes-phosphor/leds/phosphor-led-manager/bmc_booted.conf new file mode 100644 index 0000000000..a300f6ace3 --- /dev/null +++ b/meta-phosphor/recipes-phosphor/leds/phosphor-led-manager/bmc_booted.conf @@ -0,0 +1,3 @@ +[Unit] +Wants={SYSTEMD_DEFAULT_TARGET} +After={SYSTEMD_DEFAULT_TARGET} diff --git a/meta-phosphor/recipes-phosphor/leds/phosphor-led-manager/obmc-fru-fault-monitor.service b/meta-phosphor/recipes-phosphor/leds/phosphor-led-manager/obmc-fru-fault-monitor.service new file mode 100644 index 0000000000..4810a7e860 --- /dev/null +++ b/meta-phosphor/recipes-phosphor/leds/phosphor-led-manager/obmc-fru-fault-monitor.service @@ -0,0 +1,12 @@ +[Unit] +Description=FRU Fault monitor service +Wants=mapper-wait@-xyz-openbmc_project-led-groups.service +After=mapper-wait@-xyz-openbmc_project-led-groups.service + +[Service] +Restart=always +ExecStart=/usr/bin/env phosphor-fru-fault-monitor +SyslogIdentifier=phosphor-fru-fault-monitor + +[Install] +WantedBy={SYSTEMD_DEFAULT_TARGET} diff --git a/meta-phosphor/recipes-phosphor/leds/phosphor-led-manager/obmc-led-group-start@.service b/meta-phosphor/recipes-phosphor/leds/phosphor-led-manager/obmc-led-group-start@.service new file mode 100644 index 0000000000..e0e1fc9356 --- /dev/null +++ b/meta-phosphor/recipes-phosphor/leds/phosphor-led-manager/obmc-led-group-start@.service @@ -0,0 +1,12 @@ +[Unit] +Description=Assert %i LED +Wants=mapper-wait@-xyz-openbmc_project-led-groups-%i.service +After=mapper-wait@-xyz-openbmc_project-led-groups-%i.service +Conflicts=obmc-led-group-stop@%i.service + +[Service] +Type=oneshot +RemainAfterExit=yes +Restart=no +ExecStart=/bin/sh -c "busctl call `mapper get-service /xyz/openbmc_project/led/groups/%i` /xyz/openbmc_project/led/groups/%i org.freedesktop.DBus.Properties Set ssv xyz.openbmc_project.Led.Group Asserted b true" +SyslogIdentifier=obmc-led-group-start diff --git a/meta-phosphor/recipes-phosphor/leds/phosphor-led-manager/obmc-led-group-stop@.service b/meta-phosphor/recipes-phosphor/leds/phosphor-led-manager/obmc-led-group-stop@.service new file mode 100644 index 0000000000..7b3966943a --- /dev/null +++ b/meta-phosphor/recipes-phosphor/leds/phosphor-led-manager/obmc-led-group-stop@.service @@ -0,0 +1,12 @@ +[Unit] +Description=Assert %i LED +Wants=mapper-wait@-xyz-openbmc_project-led-groups-%i.service +After=mapper-wait@-xyz-openbmc_project-led-groups-%i.service +Conflicts=obmc-led-group-start@%i.service + +[Service] +Type=oneshot +RemainAfterExit=yes +Restart=no +ExecStart=/bin/sh -c "busctl call `mapper get-service /xyz/openbmc_project/led/groups/%i` /xyz/openbmc_project/led/groups/%i org.freedesktop.DBus.Properties Set ssv xyz.openbmc_project.Led.Group Asserted b false" +SyslogIdentifier=obmc-led-group-stop diff --git a/meta-phosphor/recipes-phosphor/leds/phosphor-led-manager/xyz.openbmc_project.LED.GroupManager.service b/meta-phosphor/recipes-phosphor/leds/phosphor-led-manager/xyz.openbmc_project.LED.GroupManager.service new file mode 100644 index 0000000000..2f9a25e91e --- /dev/null +++ b/meta-phosphor/recipes-phosphor/leds/phosphor-led-manager/xyz.openbmc_project.LED.GroupManager.service @@ -0,0 +1,13 @@ +[Unit] +Description=Phosphor LED Group Management Daemon +Before=mapper-wait@-xyz-openbmc_project-led-groups.service + +[Service] +Restart=always +ExecStart=/usr/bin/env phosphor-ledmanager +SyslogIdentifier=phosphor-ledmanager +Type=dbus +BusName={BUSNAME} + +[Install] +WantedBy={SYSTEMD_DEFAULT_TARGET} diff --git a/meta-phosphor/recipes-phosphor/leds/phosphor-led-sysfs.bb b/meta-phosphor/recipes-phosphor/leds/phosphor-led-sysfs.bb new file mode 100644 index 0000000000..76da1b56af --- /dev/null +++ b/meta-phosphor/recipes-phosphor/leds/phosphor-led-sysfs.bb @@ -0,0 +1,26 @@ +SUMMARY = "Phosphor Physical LED Controller daemon" +DESCRIPTION = "Daemon to trigger actions on a physical LED" +HOMEPAGE = "http://github.com/openbmc/phosphor-led-sysfs" +PR = "r1" + +LICENSE = "Apache-2.0" +LIC_FILES_CHKSUM = "file://LICENSE;md5=e3fc50a88d0a364313df4b21ef20c29e" +inherit autotools pkgconfig +inherit obmc-phosphor-dbus-service + +DEPENDS += "autoconf-archive-native" +DEPENDS += "sdbusplus" +DEPENDS += "phosphor-dbus-interfaces" +RDEPENDS_${PN} += "libsystemd" + +DBUS_SERVICE_${PN} += "xyz.openbmc_project.led.controller@.service" + +SRC_URI += "git://github.com/openbmc/phosphor-led-sysfs" +SRC_URI += "file://70-leds.rules" +SRCREV = "8609c65aaa48eeff85cd9dd375253d7755581993" +S = "${WORKDIR}/git" + +do_install_append() { + install -d ${D}/${base_libdir}/udev/rules.d/ + install ${WORKDIR}/70-leds.rules ${D}/${base_libdir}/udev/rules.d/ +} diff --git a/meta-phosphor/recipes-phosphor/leds/phosphor-led-sysfs/70-leds.rules b/meta-phosphor/recipes-phosphor/leds/phosphor-led-sysfs/70-leds.rules new file mode 100644 index 0000000000..372d81293f --- /dev/null +++ b/meta-phosphor/recipes-phosphor/leds/phosphor-led-sysfs/70-leds.rules @@ -0,0 +1 @@ +SUBSYSTEM=="leds", ACTION=="add", TAG+="systemd", ENV{SYSTEMD_WANTS}+="xyz.openbmc_project.led.controller@sys-class-leds-$name" diff --git a/meta-phosphor/recipes-phosphor/leds/phosphor-led-sysfs/xyz.openbmc_project.led.controller@.service b/meta-phosphor/recipes-phosphor/leds/phosphor-led-sysfs/xyz.openbmc_project.led.controller@.service new file mode 100644 index 0000000000..c673cda66f --- /dev/null +++ b/meta-phosphor/recipes-phosphor/leds/phosphor-led-sysfs/xyz.openbmc_project.led.controller@.service @@ -0,0 +1,7 @@ +[Unit] +Description=Phosphor sysfs LED controller + +[Service] +Restart=always +ExecStart=/usr/bin/env phosphor-ledcontroller -p %f +SyslogIdentifier=phosphor-ledcontroller diff --git a/meta-phosphor/recipes-phosphor/leds/phosphor-logging-error-logs-native.bbappend b/meta-phosphor/recipes-phosphor/leds/phosphor-logging-error-logs-native.bbappend new file mode 100644 index 0000000000..3f2c5c811b --- /dev/null +++ b/meta-phosphor/recipes-phosphor/leds/phosphor-logging-error-logs-native.bbappend @@ -0,0 +1 @@ +DEPENDS += "phosphor-led-manager-error-native" |