diff --git a/meta-oniro-support/classes/supportability.bbclass b/meta-oniro-support/classes/supportability.bbclass new file mode 100644 index 0000000000000000000000000000000000000000..9a30a22355dadf39b53da95c040abfce97b53250 --- /dev/null +++ b/meta-oniro-support/classes/supportability.bbclass @@ -0,0 +1,36 @@ +# SPDX-FileCopyrightText: Huawei Inc. +# +# SPDX-License-Identifier: Apache-2.0 + +# This class provides a mechanism to analize image and provide developers with +# "supportability" status of the project + +SUPPORT_LOG_DIR ?= "${LOG_DIR}/supportability/" +SUPPORT_LOG_FILE ?= "${SUPPORT_LOG_DIR}/supportability.txt" +SUPPORT_EXCLUDE_LAYERS ?= "" + +addtask supportability_report before do_fetch + +python do_supportability_report () { + support = d.getVar("SUPPORT_LEVEL") or "0" + pn = d.getVar("PN" or "%unknown%") + if d.getVar("SUPPORT_SILENT") != "1": + if support.strip() == "Unsupported": + bb.error("The \"{pn}\" package is unsupported by Oniro Project." \ + "Please check your image dependencies and consider replacement {pn} with an alternative".format(pn=pn)) +} + +def support_status(): + ret = "" + ret += "{}\n".format(d.getVar("SUPPORT_LEVEL") or "0") + return ret + +python do_generate_report () { + deploy_file = d.getVar("SUPPORT_LOG_DIR") + bb.utils.mkdirhier(os.path.dirname(deploy_file)) + with open(REPORTFILE, 'a') as reportfile: + bb.warn("Writing file: {}".format(reportfile)) + reportfile.write(support_status) +} + +do_fetch[prefunc] += "do_generate_report" diff --git a/meta-oniro-support/conf/layer.conf b/meta-oniro-support/conf/layer.conf new file mode 100644 index 0000000000000000000000000000000000000000..305087dcc696fc24d532250d07ce7ddd63c4e4af --- /dev/null +++ b/meta-oniro-support/conf/layer.conf @@ -0,0 +1,20 @@ +# SPDX-FileCopyrightText: Huawei Inc. +# +# SPDX-License-Identifier: Apache-2.0 + +# We have a conf and classes directory, add to BBPATH +BBPATH .= ":${LAYERDIR}" + +# We have recipes-* directories, add to BBFILES +BBFILES += "${LAYERDIR}/recipes-*/*/*.bb \ + ${LAYERDIR}/recipes-*/*/*.bbappend" + +BBFILE_COLLECTIONS += "oniro-supportability" +BBFILE_PATTERN_oniro-supportability = "^${LAYERDIR}/" +BBFILE_PRIORITY_oniro-supportability = "8" + +LAYERDEPENDS_oniro-supportability = " \ + core \ + " +LAYERSERIES_COMPAT_oniro-supportability = "kirkstone" + diff --git a/meta-oniro-support/recipes-connectivity/bind/bind.support b/meta-oniro-support/recipes-connectivity/bind/bind.support new file mode 100644 index 0000000000000000000000000000000000000000..c5a52f77ef4018d8974d41f6e45573c4915cd6c1 --- /dev/null +++ b/meta-oniro-support/recipes-connectivity/bind/bind.support @@ -0,0 +1,4 @@ +SUPPORT_META_VERSION="1" +SUPPORT_EOL="0" +SUPPORT_LEVEL="Unsupported" +SUPPORT_REASON="High supportability cost. Not suitable for IoT devices" \ No newline at end of file diff --git a/meta-oniro-support/recipes-connectivity/bind/bind_%.bbappend b/meta-oniro-support/recipes-connectivity/bind/bind_%.bbappend new file mode 100644 index 0000000000000000000000000000000000000000..c5a52f77ef4018d8974d41f6e45573c4915cd6c1 --- /dev/null +++ b/meta-oniro-support/recipes-connectivity/bind/bind_%.bbappend @@ -0,0 +1,4 @@ +SUPPORT_META_VERSION="1" +SUPPORT_EOL="0" +SUPPORT_LEVEL="Unsupported" +SUPPORT_REASON="High supportability cost. Not suitable for IoT devices" \ No newline at end of file