diff options
author | Vishwanatha Subbanna <vishwa@linux.vnet.ibm.com> | 2017-06-12 10:39:10 +0300 |
---|---|---|
committer | Patrick Williams <patrick@stwcx.xyz> | 2017-06-15 07:47:53 +0300 |
commit | 2d78dd05dd61744536cad850b514e1a278500582 (patch) | |
tree | 89aa95b38e241ea5e3f12cc4b7057492f68c072a /meta-phosphor | |
parent | e6621908b79e7cd5f244aaa92dbee45c5a5f57cf (diff) | |
download | openbmc-2d78dd05dd61744536cad850b514e1a278500582.tar.xz |
Watchdog: Add recipe for phosphor-watchdog
Change-Id: I460e086e1e5d3d5db5405ac29927a7b460f56ff6
Signed-off-by: Vishwanatha Subbanna <vishwa@linux.vnet.ibm.com>
Diffstat (limited to 'meta-phosphor')
6 files changed, 60 insertions, 0 deletions
diff --git a/meta-phosphor/common/recipes-phosphor/ipmi/phosphor-ipmi-host.bb b/meta-phosphor/common/recipes-phosphor/ipmi/phosphor-ipmi-host.bb index e52bf41d4..91658f6bd 100644 --- a/meta-phosphor/common/recipes-phosphor/ipmi/phosphor-ipmi-host.bb +++ b/meta-phosphor/common/recipes-phosphor/ipmi/phosphor-ipmi-host.bb @@ -29,6 +29,7 @@ RDEPENDS_${PN} += "network" RDEPENDS_${PN} += "libmapper" RDEPENDS_${PN} += "phosphor-time-manager" RDEPENDS_${PN} += "sdbusplus phosphor-dbus-interfaces" +RDEPENDS_${PN} += "virtual/obmc-watchdog" SYSTEMD_SERVICE_${PN} += "xyz.openbmc_project.Ipmi.Internal.SoftPowerOff.service phosphor-ipmi-host.service" diff --git a/meta-phosphor/common/recipes-phosphor/watchdog/phosphor-watchdog.bb b/meta-phosphor/common/recipes-phosphor/watchdog/phosphor-watchdog.bb new file mode 100644 index 000000000..41e454aee --- /dev/null +++ b/meta-phosphor/common/recipes-phosphor/watchdog/phosphor-watchdog.bb @@ -0,0 +1,41 @@ +SUMMARY = "Phosphor Watchdog application" +DESCRIPTION = "Application that implements software watchdog" +HOMEPAGE = "http://github.com/openbmc/phosphor-watchdog" +PR = "r1" + +LICENSE = "Apache-2.0" +LIC_FILES_CHKSUM = "file://LICENSE;md5=e3fc50a88d0a364313df4b21ef20c29e" +inherit autotools pkgconfig +inherit obmc-phosphor-dbus-service + +RPROVIDES_${PN} += "virtual/obmc-watchdog" +PROVIDES += "virtual/obmc-watchdog" + +DEPENDS += "autoconf-archive-native" +DEPENDS += "sdbusplus sdbusplus-native" +DEPENDS += "phosphor-dbus-interfaces" +DEPENDS += "phosphor-logging" +RDEPENDS_${PN} += "libsystemd" +RDEPENDS_${PN} += "phosphor-logging" + +SRC_URI += "git://github.com/openbmc/phosphor-watchdog" +SRCREV = "f2309dd978eacd53343b68e012a1406eaf484e2e" +S = "${WORKDIR}/git" + +# Copies config file having arguments for host watchdog +SYSTEMD_ENVIRONMENT_FILE_${PN} +="obmc/watchdog/poweron" + +# Install the override to set up a Conflicts relation +SYSTEMD_OVERRIDE_${PN} += "poweron.conf:phosphor-watchdog@poweron.service.d/poweron.conf" + +# For now, watching PowerOn is the only usecase +OBMC_HOST_WATCHDOG_INSTANCES = "poweron" + +# This is really a DBUS service but the service name is +# an argument, so making it this way. +WATCHDOG_TMPL = "phosphor-watchdog@.service" +SYSTEMD_SERVICE_${PN} += "${WATCHDOG_TMPL}" + +WATCHDOG_TGTFMT = "phosphor-watchdog@{0}.service" +WATCHDOG_FMT = "../${WATCHDOG_TMPL}:obmc-host-start@{1}.target.wants/${WATCHDOG_TGTFMT}" +SYSTEMD_LINK_${PN} += "${@compose_list(d, 'WATCHDOG_FMT', 'OBMC_HOST_WATCHDOG_INSTANCES', 'OBMC_HOST_INSTANCES')}" diff --git a/meta-phosphor/common/recipes-phosphor/watchdog/phosphor-watchdog/obmc/watchdog/poweron b/meta-phosphor/common/recipes-phosphor/watchdog/phosphor-watchdog/obmc/watchdog/poweron new file mode 100644 index 000000000..384247451 --- /dev/null +++ b/meta-phosphor/common/recipes-phosphor/watchdog/phosphor-watchdog/obmc/watchdog/poweron @@ -0,0 +1,3 @@ +PATH=/xyz/openbmc_project/watchdog/host0 +SERVICE=xyz.openbmc_project.Watchdog +TARGET=obmc-host-timeout@0.target diff --git a/meta-phosphor/common/recipes-phosphor/watchdog/phosphor-watchdog/phosphor-watchdog@.service b/meta-phosphor/common/recipes-phosphor/watchdog/phosphor-watchdog/phosphor-watchdog@.service new file mode 100644 index 000000000..8a7e8b64b --- /dev/null +++ b/meta-phosphor/common/recipes-phosphor/watchdog/phosphor-watchdog/phosphor-watchdog@.service @@ -0,0 +1,7 @@ +[Unit] +Description=Phosphor %I watchdog + +[Service] +Restart=no +EnvironmentFile={envfiledir}/obmc/watchdog/%I +ExecStart={sbindir}/phosphor-watchdog --service=${{SERVICE}} --path=${{PATH}} --target=${{TARGET}} diff --git a/meta-phosphor/common/recipes-phosphor/watchdog/phosphor-watchdog/poweron.conf b/meta-phosphor/common/recipes-phosphor/watchdog/phosphor-watchdog/poweron.conf new file mode 100644 index 000000000..7399fa582 --- /dev/null +++ b/meta-phosphor/common/recipes-phosphor/watchdog/phosphor-watchdog/poweron.conf @@ -0,0 +1,2 @@ +[Unit] +Conflicts=obmc-host-stop@0.target diff --git a/meta-phosphor/conf/distro/include/phosphor-defaults.inc b/meta-phosphor/conf/distro/include/phosphor-defaults.inc index e7e48238f..b53eb136a 100644 --- a/meta-phosphor/conf/distro/include/phosphor-defaults.inc +++ b/meta-phosphor/conf/distro/include/phosphor-defaults.inc @@ -205,5 +205,11 @@ PREFERRED_PROVIDER_virtual/phosphor-ipmi-inventory-sel ?= \ # in input. PREFERRED_PROVIDER_virtual/obmc-gpio-monitor ?= "phosphor-gpio-monitor" +# The phosphor-watchdog application is data-driven and requires an input. +# The application then starts a timer in disabled state. User of this timer +# needs to first enable and then use it. This also provides a way for changing +# the timeout if needed. +PREFERRED_PROVIDER_virtual/obmc-watchdog ?= "phosphor-watchdog" + OBMC_DBUS_PATH_ROOT ?= "/xyz/openbmc_project" OBMC_DBUS_IFACE_ROOT ?= "xyz.openbmc_project" |