diff options
Diffstat (limited to 'meta-phosphor/classes')
13 files changed, 125 insertions, 0 deletions
diff --git a/meta-phosphor/classes/obmc-phosphor-c-daemon.bbclass b/meta-phosphor/classes/obmc-phosphor-c-daemon.bbclass new file mode 100644 index 0000000000..e21d17c055 --- /dev/null +++ b/meta-phosphor/classes/obmc-phosphor-c-daemon.bbclass @@ -0,0 +1,17 @@ +# Common code for dbus applications using c. + +inherit obmc-phosphor-systemd +inherit obmc-phosphor-license + +DEPENDS += "glib-2.0" +SRC_URI += " \ + file://Makefile \ + file://${PN}.c \ + " +S = "${WORKDIR}" + +do_install_append() { + # install the binary + install -d ${D}${sbindir} + install -m 0755 ${WORKDIR}/${PN} ${D}${sbindir} +} diff --git a/meta-phosphor/classes/obmc-phosphor-chassis-mgmt.bbclass b/meta-phosphor/classes/obmc-phosphor-chassis-mgmt.bbclass new file mode 100644 index 0000000000..377da0a3c3 --- /dev/null +++ b/meta-phosphor/classes/obmc-phosphor-chassis-mgmt.bbclass @@ -0,0 +1,3 @@ +# Common code for recipes that implement Phosphor OpenBMC chassis management. + +RPROVIDES_${PN} += "virtual/obmc-phosphor-chassis-mgmt" diff --git a/meta-phosphor/classes/obmc-phosphor-event-mgmt.bbclass b/meta-phosphor/classes/obmc-phosphor-event-mgmt.bbclass new file mode 100644 index 0000000000..01f2edf988 --- /dev/null +++ b/meta-phosphor/classes/obmc-phosphor-event-mgmt.bbclass @@ -0,0 +1,3 @@ +# Common code for recipes that implement Phosphor OpenBMC event management. + +RPROVIDES_${PN} += "virtual/obmc-phosphor-event-mgmt" diff --git a/meta-phosphor/classes/obmc-phosphor-fan-mgmt.bbclass b/meta-phosphor/classes/obmc-phosphor-fan-mgmt.bbclass new file mode 100644 index 0000000000..973376d6b9 --- /dev/null +++ b/meta-phosphor/classes/obmc-phosphor-fan-mgmt.bbclass @@ -0,0 +1,3 @@ +# Common code for recipes that implement Phosphor OpenBMC fan management. + +RPROVIDES_${PN} += "virtual/obmc-phosphor-fan-mgmt" diff --git a/meta-phosphor/classes/obmc-phosphor-flash-mgmt.bbclass b/meta-phosphor/classes/obmc-phosphor-flash-mgmt.bbclass new file mode 100644 index 0000000000..d1669499ad --- /dev/null +++ b/meta-phosphor/classes/obmc-phosphor-flash-mgmt.bbclass @@ -0,0 +1,3 @@ +# Common code for recipes that implement Phosphor OpenBMC flash management. + +RPROVIDES_${PN} += "virtual/obmc-phosphor-flash-mgmt" diff --git a/meta-phosphor/classes/obmc-phosphor-image.bbclass b/meta-phosphor/classes/obmc-phosphor-image.bbclass new file mode 100644 index 0000000000..59be3454e5 --- /dev/null +++ b/meta-phosphor/classes/obmc-phosphor-image.bbclass @@ -0,0 +1,38 @@ +# Common code for generating Phosphor OpenBMC images. + +# Additional IMAGE_FEATURES available with Phosphor OpenBMC: +# +# - obmc-phosphor-fan-mgmt - Phosphor OpenBMC fan management +# - obmc-phosphor-chassis-mgmt - Phosphor OpenBMC chassis management +# - obmc-phosphor-sensor-mgmt - Phosphor OpenBMC sensor management +# - obmc-phosphor-flash-mgmt - Phosphor OpenBMC flash management +# - obmc-phosphor-event-mgmt - Phosphor OpenBMC event management +# - obmc-phosphor-policy-mgmt - Phosphor OpenBMC policy management +# - obmc-phosphor-system-mgmt - Phosphor OpenBMC system management + +inherit core-image +inherit obmc-phosphor-license + +FEATURE_PACKAGES_obmc-phosphor-fan-mgmt ?= "packagegroup-obmc-phosphor-apps-fan-mgmt" +FEATURE_PACKAGES_obmc-phosphor-chassis-mgmt ?= "packagegroup-obmc-phosphor-apps-chassis-mgmt" +FEATURE_PACKAGES_obmc-phosphor-sensor-mgmt ?= "packagegroup-obmc-phosphor-apps-sensor-mgmt" +FEATURE_PACKAGES_obmc-phosphor-flash-mgmt ?= "packagegroup-obmc-phosphor-apps-flash-mgmt" +FEATURE_PACKAGES_obmc-phosphor-event-mgmt ?= "packagegroup-obmc-phosphor-apps-event-mgmt" +FEATURE_PACKAGES_obmc-phosphor-policy-mgmt ?= "packagegroup-obmc-phosphor-apps-policy-mgmt" +FEATURE_PACKAGES_obmc-phosphor-system-mgmt ?= "packagegroup-obmc-phosphor-apps-system-mgmt" + +# Install entire Phosphor application stack by default +IMAGE_FEATURES += " \ + obmc-phosphor-fan-mgmt \ + obmc-phosphor-chassis-mgmt \ + obmc-phosphor-sensor-mgmt \ + obmc-phosphor-flash-mgmt \ + obmc-phosphor-event-mgmt \ + obmc-phosphor-policy-mgmt \ + obmc-phosphor-system-mgmt \ + ssh-server-openssh \ + " + +IMAGE_INSTALL += " \ + bash \ + " diff --git a/meta-phosphor/classes/obmc-phosphor-license.bbclass b/meta-phosphor/classes/obmc-phosphor-license.bbclass new file mode 100644 index 0000000000..9694f7fa2e --- /dev/null +++ b/meta-phosphor/classes/obmc-phosphor-license.bbclass @@ -0,0 +1,4 @@ +# Common code for packages distributed without a license that want Apache-2.0. + +LICENSE = "Apache-2.0" +LIC_FILES_CHKSUM = "file://${PHOSPHORBASE}/COPYING.apache-2.0;md5=34400b68072d710fecd0a2940a0d1658" diff --git a/meta-phosphor/classes/obmc-phosphor-policy-mgmt.bbclass b/meta-phosphor/classes/obmc-phosphor-policy-mgmt.bbclass new file mode 100644 index 0000000000..86e0cbefd7 --- /dev/null +++ b/meta-phosphor/classes/obmc-phosphor-policy-mgmt.bbclass @@ -0,0 +1,3 @@ +# Common code for recipes that implement Phosphor OpenBMC policy management. + +RPROVIDES_${PN} += "virtual/obmc-phosphor-policy-mgmt" diff --git a/meta-phosphor/classes/obmc-phosphor-py-daemon.bbclass b/meta-phosphor/classes/obmc-phosphor-py-daemon.bbclass new file mode 100644 index 0000000000..35c2714153 --- /dev/null +++ b/meta-phosphor/classes/obmc-phosphor-py-daemon.bbclass @@ -0,0 +1,17 @@ +# Common code for dbus applications using python. + +inherit allarch +inherit obmc-phosphor-systemd +inherit obmc-phosphor-license + +RDEPENDS_${PN} += "python-dbus python-pygobject" +SRC_URI += " \ + file://${PN}.py \ + " +S = "${WORKDIR}" + +do_install_append() { + # install the script + install -d ${D}${sbindir} + install -m 0755 ${WORKDIR}/${PN}.py ${D}${sbindir}/${PN} +} diff --git a/meta-phosphor/classes/obmc-phosphor-sensor-mgmt.bbclass b/meta-phosphor/classes/obmc-phosphor-sensor-mgmt.bbclass new file mode 100644 index 0000000000..9939386c2e --- /dev/null +++ b/meta-phosphor/classes/obmc-phosphor-sensor-mgmt.bbclass @@ -0,0 +1,3 @@ +# Common code for recipes that implement Phosphor OpenBMC sensor management. + +RPROVIDES_${PN} += "virtual/obmc-phosphor-sensor-mgmt" diff --git a/meta-phosphor/classes/obmc-phosphor-system-mgmt.bbclass b/meta-phosphor/classes/obmc-phosphor-system-mgmt.bbclass new file mode 100644 index 0000000000..4939d2f69d --- /dev/null +++ b/meta-phosphor/classes/obmc-phosphor-system-mgmt.bbclass @@ -0,0 +1,3 @@ +# Common code for recipes that implement Phosphor OpenBMC system management. + +RPROVIDES_${PN} += "virtual/obmc-phosphor-system-mgmt" diff --git a/meta-phosphor/classes/obmc-phosphor-systemd.bbclass b/meta-phosphor/classes/obmc-phosphor-systemd.bbclass new file mode 100644 index 0000000000..7bd2d9d747 --- /dev/null +++ b/meta-phosphor/classes/obmc-phosphor-systemd.bbclass @@ -0,0 +1,14 @@ +# Common code for Phosphor OpenBMC systemd services. + +inherit systemd + +SYSTEMD_SERVICE_${PN} = "${PN}.service" +SRC_URI += " \ + file://${PN}.service \ + " + +do_install_append() { + # install systemd unit files + install -d ${D}${systemd_unitdir}/system + install -m 0644 ${WORKDIR}/${PN}.service ${D}${systemd_unitdir}/system +} diff --git a/meta-phosphor/classes/obmc-phosphor-utils.bbclass b/meta-phosphor/classes/obmc-phosphor-utils.bbclass new file mode 100644 index 0000000000..4f556294bc --- /dev/null +++ b/meta-phosphor/classes/obmc-phosphor-utils.bbclass @@ -0,0 +1,14 @@ +# Helper functions for checking feature variables. + +inherit utils + +def df_enabled(feature, value, d): + return base_contains("DISTRO_FEATURES", feature, value, "", d) + +def mf_enabled(feature, value, d): + return base_contains("MACHINE_FEATURES", feature, value, "", d) + +def cf_enabled(feature, value, d): + return value if df_enabled(feature, value, d) \ + and mf_enabled(feature, value, d) \ + else "" |