diff options
author | Vishwanatha Subbanna <vishwa@linux.vnet.ibm.com> | 2017-08-22 21:34:43 +0530 |
---|---|---|
committer | Patrick Williams <patrick@stwcx.xyz> | 2017-08-28 20:52:14 +0000 |
commit | 79bc0a4471ba09cfebaab09b54ca81e53bc245ad (patch) | |
tree | d6dd7199db708a5c77da3d6cf49e2bc84d20ec32 | |
parent | 1696ec2f7a94f5c1c85cd73780a988467ae3b74a (diff) | |
download | talos-openbmc-79bc0a4471ba09cfebaab09b54ca81e53bc245ad.tar.gz talos-openbmc-79bc0a4471ba09cfebaab09b54ca81e53bc245ad.zip |
Enable OCC Active on BMC reset reload
Post BMC reset reload, if the host is up, then we deem
the OCCs are present and hence enable Active state.
Fixes openbmc/openbmc#2126
Change-Id: Ife4af19cda0010f55a1067d1b1c1875632ce81aa
Signed-off-by: Vishwanatha Subbanna <vishwa@linux.vnet.ibm.com>
3 files changed, 29 insertions, 6 deletions
diff --git a/meta-openbmc-machines/meta-openpower/common/recipes-phosphor/occ/openpower-occ-control.bb b/meta-openbmc-machines/meta-openpower/common/recipes-phosphor/occ/openpower-occ-control.bb index 0befe277e..33dac2f82 100644 --- a/meta-openbmc-machines/meta-openpower/common/recipes-phosphor/occ/openpower-occ-control.bb +++ b/meta-openbmc-machines/meta-openpower/common/recipes-phosphor/occ/openpower-occ-control.bb @@ -18,6 +18,7 @@ do_install_append() { } DBUS_SERVICE_${PN} += "org.open_power.OCC.Control.service" +SYSTEMD_SERVICE_${PN} += "op-occ-enable@.service" SYSTEMD_SERVICE_${PN} += "op-occ-disable@.service" DEPENDS += "virtual/${PN}-config-native" @@ -43,11 +44,17 @@ RDEPENDS_${PN} += " \ EXTRA_OECONF = "YAML_PATH=${STAGING_DATADIR_NATIVE}/${PN}" EXTRA_OECONF_append = "${@bb.utils.contains('OBMC_MACHINE_FEATURES', 'i2c-occ', ' --enable-i2c-occ', '', d)}" -# Ensure host stop target requires occ disable service -OCC_DISABLE_TMPL = "op-occ-disable@.service" -HOST_STOP_TGTFMT = "obmc-host-stop@{0}.target" -OCC_DISABLE_INSTFMT = "op-occ-disable@{0}.service" -HOST_STOP_OCC_DISABLE_FMT = "../${OCC_DISABLE_TMPL}:${HOST_STOP_TGTFMT}.requires/${OCC_DISABLE_INSTFMT}" -SYSTEMD_LINK_${PN} += "${@compose_list_zip(d, 'HOST_STOP_OCC_DISABLE_FMT', 'OBMC_HOST_INSTANCES')}" +OCC_ENABLE = "enable" +OCC_DISABLE = "disable" +HOST_START = "start" +HOST_STOP = "stop" + +# Ensure host-stop and host-start targets require needed occ states +OCC_TMPL = "op-occ-{0}@.service" +HOST_TGTFMT = "obmc-host-{1}@{2}.target" +OCC_INSTFMT = "op-occ-{0}@{2}.service" +HOST_OCC_FMT = "../${OCC_TMPL}:${HOST_TGTFMT}.requires/${OCC_INSTFMT}" +SYSTEMD_LINK_${PN} += "${@compose_list_zip(d, 'HOST_OCC_FMT', 'OCC_ENABLE', 'HOST_START', 'OBMC_HOST_INSTANCES')}" +SYSTEMD_LINK_${PN} += "${@compose_list_zip(d, 'HOST_OCC_FMT', 'OCC_DISABLE', 'HOST_STOP', 'OBMC_HOST_INSTANCES')}" S = "${WORKDIR}/git" diff --git a/meta-openbmc-machines/meta-openpower/common/recipes-phosphor/occ/openpower-occ-control/op-occ-disable@.service b/meta-openbmc-machines/meta-openpower/common/recipes-phosphor/occ/openpower-occ-control/op-occ-disable@.service index f89d0f037..0179a5083 100644 --- a/meta-openbmc-machines/meta-openpower/common/recipes-phosphor/occ/openpower-occ-control/op-occ-disable@.service +++ b/meta-openbmc-machines/meta-openpower/common/recipes-phosphor/occ/openpower-occ-control/op-occ-disable@.service @@ -1,6 +1,7 @@ [Unit] Description=OpenPOWER OCC Active Disable Before=obmc-host-stop-pre@%i.target +Conflicts=op-occ-enable@%i.service [Service] ExecStart=/usr/bin/env occ-active.sh disable diff --git a/meta-openbmc-machines/meta-openpower/common/recipes-phosphor/occ/openpower-occ-control/op-occ-enable@.service b/meta-openbmc-machines/meta-openpower/common/recipes-phosphor/occ/openpower-occ-control/op-occ-enable@.service new file mode 100644 index 000000000..79373828d --- /dev/null +++ b/meta-openbmc-machines/meta-openpower/common/recipes-phosphor/occ/openpower-occ-control/op-occ-enable@.service @@ -0,0 +1,15 @@ +[Unit] +Description=OpenPOWER OCC Active Enable for host %I +Conflicts=obmc-host-stop@%i.target +Conflicts=op-occ-disable@%i.service +Wants=org.open_power.OCC.Control.service +After=org.open_power.OCC.Control.service +ConditionPathExists=/run/openbmc/host@%i-on + +[Service] +ExecStart=/usr/bin/env occ-active.sh enable +SyslogIdentifier=occ-active.sh +Type=oneshot + +[Install] +WantedBy=obmc-host-start@%i.target |