Skip to content
Snippets Groups Projects
Commit 427a0ca0 authored by Pavel Zhukov's avatar Pavel Zhukov
Browse files

supportability.bbclass: Add supportability class

parent 952a5aac
No related tags found
No related merge requests found
SUPPORT_DIRECTORY ?= "${DEPLOY_DIR}/supportability"
### Print warnings if package is unsupported
### Note: Warn only if package is defined as
###:unsupported and not for default policy
WARN_IF_UNSUPPORTED ?= "1"
ONIRO_SUPPORT_REPORT_FMT ?= "text"
def getrecipereverse(d, pkg):
pkgdata_dir = d.getVar("PKGDATA_DIR")
pkgdatafile = os.path.join(pkgdata_dir, 'runtime-reverse', pkg)
if not os.path.exists(pkgdatafile):
bb.warn("Package data file of {} doesn't exist. Unable to lookup recipe name".format(pkgdatafile))
return None
with open(pkgdatafile) as f:
pn = f.readline()
if pn is None or not pn.startswith("PN:") or len(pn) < 5:
bb.warn("Wrong format of pkgdatafile {}".format(pkgdatafile))
return None
return pn[pn.index(":") + 1:].strip()
def get_supportability_status(d, recipe, pkg):
## "default policy" for packages
ONIRO_DEFAULT_POLICY = d.getVar("ONIRO_SUPPORT_DEFAULT_POLICY")
if recipe is None:
return "unsupported"
## Packages which are marked as unsupported (not affected by default policy)
ONIRO_SUPPORT_UNSUPPORTED = d.getVar("ONIRO_SUPPORT_UNSUPPORTED")
WARN_IF_UNSUPPORTED = d.getVar("WARN_IF_UNSUPPORTED") != 0
if ONIRO_SUPPORT_UNSUPPORTED is not None and \
recipe in ONIRO_SUPPORT_UNSUPPORTED.split():
if WARN_IF_UNSUPPORTED:
bb.warn("Supportability class: package {} is unsupported".format(recipe))
return "unsupported"
## Packages which are in Oniro reference images are always supported
## Not affected by default policy
ONIRO_SUPPORT_REF = d.getVar("ONIRO_SUPPORT_REF")
if ONIRO_SUPPORT_REF is not None and recipe in ONIRO_SUPPORT_REF.split():
return "supported"
ONIRO_SUPPORT_SUPPORTED = d.getVar("ONIRO_SUPPORT_SUPPORTED")
if ONIRO_SUPPORT_SUPPORTED is not None and recipe in ONIRO_SUPPORT_SUPPORTED.split():
return "supported"
return ONIRO_DEFAULT_POLICY
def build_deps_list(items):
deps = []
for item in items.split('\n'):
splitted = item.split('|')
depend = ' '.join(splitted[1:]).lstrip('|')
deps.append(depend)
return deps
def generate_report_txt(data):
report = []
for pkg in data:
report.append("{} : {} => {} \n".format(pkg["package"], pkg["recipe"], pkg["supportstatus"]))
return report
python supportability_report () {
sreport_dir = d.expand('${SUPPORT_DIRECTORY}/${IMAGE_NAME}')
sreport_latest_link = d.expand('${SUPPORT_DIRECTORY}/latest')
report_file = os.path.join(sreport_dir, 'supportability.report.txt')
bb.utils.mkdirhier(sreport_dir)
from oe.rootfs import image_list_installed_packages
packages = image_list_installed_packages(d)
supportabilitydata = []
for pkg in packages:
pkgdata = {}
pkgdata["package"] = pkg
pkgdata["recipe"] = getrecipereverse(d, pkg)
pkgdata["supportstatus"] = get_supportability_status(d, pkgdata["package"], pkgdata["recipe"])
supportabilitydata.append(pkgdata)
with open(report_file, "w+") as report:
report_format = d.getVar("ONIRO_SUPPORT_REPORT_FMT")
if report_format is None or report_format == "text":
report.write(" ".join(generate_report_txt(supportabilitydata)))
else:
bb.warn("Format {} is not implemeted yet".format(report_format))
## TODO Move into oe-core (widely used flow accross the distributionn
if os.path.exists(sreport_latest_link):
os.remove(sreport_latest_link)
os.symlink(report_file, sreport_latest_link);
}
ROOTFS_POSTPROCESS_COMMAND += " supportability_report; "
...@@ -24,3 +24,5 @@ LAYERDEPENDS_oniro-core = " \ ...@@ -24,3 +24,5 @@ LAYERDEPENDS_oniro-core = " \
LAYERSERIES_COMPAT_oniro-core = "kirkstone" LAYERSERIES_COMPAT_oniro-core = "kirkstone"
ONIRO_COREBASE = '${@os.path.normpath("${LAYERDIR}/../")}' ONIRO_COREBASE = '${@os.path.normpath("${LAYERDIR}/../")}'
include conf/supportability.conf
\ No newline at end of file
# SPDX-FileCopyrightText: Huawei Inc.
#
# SPDX-License-Identifier: Apache-2.0
ONIRO_SUPPORT_DEFAULT_POLICY = "unsupported"
## Unsupported packages
## Warn if installed
ONIRO_SUPPORT_UNSUPPORTED+="bind"
ONIRO_SUPPORT_UNSUPPORTED+="httpd"
## List of recipes built in Oniro references images
ONIRO_SUPPORT_REF += " acl"
ONIRO_SUPPORT_REF += " argp-standalone"
ONIRO_SUPPORT_REF += " attr"
ONIRO_SUPPORT_REF += " autoconf-archive"
ONIRO_SUPPORT_REF += " avahi"
ONIRO_SUPPORT_REF += " base-files"
ONIRO_SUPPORT_REF += " base-passwd"
ONIRO_SUPPORT_REF += " bash"
ONIRO_SUPPORT_REF += " bash-completion"
ONIRO_SUPPORT_REF += " bc"
ONIRO_SUPPORT_REF += " bind"
ONIRO_SUPPORT_REF += " bluez5"
ONIRO_SUPPORT_REF += " bsd-headers"
ONIRO_SUPPORT_REF += " btrfs-tools"
ONIRO_SUPPORT_REF += " busybox"
ONIRO_SUPPORT_REF += " bzip2"
ONIRO_SUPPORT_REF += " ca-certificates"
ONIRO_SUPPORT_REF += " cairo"
ONIRO_SUPPORT_REF += " coreutils"
ONIRO_SUPPORT_REF += " cracklib"
ONIRO_SUPPORT_REF += " curl"
ONIRO_SUPPORT_REF += " dbus"
ONIRO_SUPPORT_REF += " diffutils"
ONIRO_SUPPORT_REF += " dropbear"
ONIRO_SUPPORT_REF += " e2fsprogs"
ONIRO_SUPPORT_REF += " elfutils"
ONIRO_SUPPORT_REF += " expat"
ONIRO_SUPPORT_REF += " file"
ONIRO_SUPPORT_REF += " findutils"
ONIRO_SUPPORT_REF += " flex"
ONIRO_SUPPORT_REF += " fontconfig"
ONIRO_SUPPORT_REF += " freetype"
ONIRO_SUPPORT_REF += " fts"
ONIRO_SUPPORT_REF += " gawk"
ONIRO_SUPPORT_REF += " gcc-runtime"
ONIRO_SUPPORT_REF += " gdbm"
ONIRO_SUPPORT_REF += " glib-2.0"
ONIRO_SUPPORT_REF += " gmp"
ONIRO_SUPPORT_REF += " gnome-desktop-testing"
ONIRO_SUPPORT_REF += " gnutls"
ONIRO_SUPPORT_REF += " gobject-introspection"
ONIRO_SUPPORT_REF += " go-runtime"
ONIRO_SUPPORT_REF += " grep"
ONIRO_SUPPORT_REF += " grub"
ONIRO_SUPPORT_REF += " grub-efi"
ONIRO_SUPPORT_REF += " icu"
ONIRO_SUPPORT_REF += " iperf3"
ONIRO_SUPPORT_REF += " iproute2"
ONIRO_SUPPORT_REF += " iptables"
ONIRO_SUPPORT_REF += " iw"
ONIRO_SUPPORT_REF += " json-glib"
ONIRO_SUPPORT_REF += " kbd"
ONIRO_SUPPORT_REF += " kmod"
ONIRO_SUPPORT_REF += " libarchive"
ONIRO_SUPPORT_REF += " libcap"
ONIRO_SUPPORT_REF += " libcap-ng"
ONIRO_SUPPORT_REF += " libcheck"
ONIRO_SUPPORT_REF += " libdaemon"
ONIRO_SUPPORT_REF += " liberror-perl"
ONIRO_SUPPORT_REF += " libffi"
ONIRO_SUPPORT_REF += " libgcc"
ONIRO_SUPPORT_REF += " libgcrypt"
ONIRO_SUPPORT_REF += " libgpg-error"
ONIRO_SUPPORT_REF += " libical"
ONIRO_SUPPORT_REF += " libidn2"
ONIRO_SUPPORT_REF += " libmicrohttpd"
ONIRO_SUPPORT_REF += " libmnl"
ONIRO_SUPPORT_REF += " libndp"
ONIRO_SUPPORT_REF += " libnewt"
ONIRO_SUPPORT_REF += " libnl"
ONIRO_SUPPORT_REF += " libnsl2"
ONIRO_SUPPORT_REF += " libpam"
ONIRO_SUPPORT_REF += " libpcre"
ONIRO_SUPPORT_REF += " libpng"
ONIRO_SUPPORT_REF += " libseccomp"
ONIRO_SUPPORT_REF += " libssp-nonshared"
ONIRO_SUPPORT_REF += " libtirpc"
ONIRO_SUPPORT_REF += " libunistring"
ONIRO_SUPPORT_REF += " libuv"
ONIRO_SUPPORT_REF += " libxml2"
ONIRO_SUPPORT_REF += " linux-libc-headers"
ONIRO_SUPPORT_REF += " linux-oniro"
ONIRO_SUPPORT_REF += " lz4"
ONIRO_SUPPORT_REF += " lzo"
ONIRO_SUPPORT_REF += " m4"
ONIRO_SUPPORT_REF += " make"
ONIRO_SUPPORT_REF += " mdadm"
ONIRO_SUPPORT_REF += " musl"
ONIRO_SUPPORT_REF += " musl-obstack"
ONIRO_SUPPORT_REF += " ncurses"
ONIRO_SUPPORT_REF += " netbase"
ONIRO_SUPPORT_REF += " nettle"
ONIRO_SUPPORT_REF += " networkmanager"
ONIRO_SUPPORT_REF += " nspr"
ONIRO_SUPPORT_REF += " nss"
ONIRO_SUPPORT_REF += " oniro-grub-bootconf"
ONIRO_SUPPORT_REF += " oniro-modprobe"
ONIRO_SUPPORT_REF += " oniro-mounts"
ONIRO_SUPPORT_REF += " oniro-sysctl"
ONIRO_SUPPORT_REF += " openssl"
ONIRO_SUPPORT_REF += " opkg-utils"
ONIRO_SUPPORT_REF += " os-release"
ONIRO_SUPPORT_REF += " ovmf"
ONIRO_SUPPORT_REF += " packagegroup-base"
ONIRO_SUPPORT_REF += " packagegroup-connectivity"
ONIRO_SUPPORT_REF += " packagegroup-core-boot"
ONIRO_SUPPORT_REF += " packagegroup-oniro-core"
ONIRO_SUPPORT_REF += " perl"
ONIRO_SUPPORT_REF += " pixman"
ONIRO_SUPPORT_REF += " popt"
ONIRO_SUPPORT_REF += " procps"
ONIRO_SUPPORT_REF += " psmisc"
ONIRO_SUPPORT_REF += " psplash"
ONIRO_SUPPORT_REF += " ptest-runner"
ONIRO_SUPPORT_REF += " python3"
ONIRO_SUPPORT_REF += " python3-dbus"
ONIRO_SUPPORT_REF += " python3-pycairo"
ONIRO_SUPPORT_REF += " python3-pygobject"
ONIRO_SUPPORT_REF += " qemuwrapper-cross"
ONIRO_SUPPORT_REF += " rauc"
ONIRO_SUPPORT_REF += " rauc-hawkbit-updater"
ONIRO_SUPPORT_REF += " readline"
ONIRO_SUPPORT_REF += " run-postinsts"
ONIRO_SUPPORT_REF += " sed"
ONIRO_SUPPORT_REF += " shadow"
ONIRO_SUPPORT_REF += " shadow-securetty"
ONIRO_SUPPORT_REF += " shared-mime-info"
ONIRO_SUPPORT_REF += " slang"
ONIRO_SUPPORT_REF += " socat"
ONIRO_SUPPORT_REF += " sqlite3"
ONIRO_SUPPORT_REF += " squashfs-tools"
ONIRO_SUPPORT_REF += " strace"
ONIRO_SUPPORT_REF += " sysota"
ONIRO_SUPPORT_REF += " systemd"
ONIRO_SUPPORT_REF += " systemd-compat-units"
ONIRO_SUPPORT_REF += " systemd-conf"
ONIRO_SUPPORT_REF += " systemd-serialgetty"
ONIRO_SUPPORT_REF += " tar"
ONIRO_SUPPORT_REF += " tcp-wrappers"
ONIRO_SUPPORT_REF += " tzdata"
ONIRO_SUPPORT_REF += " unzip"
ONIRO_SUPPORT_REF += " update-rc.d"
ONIRO_SUPPORT_REF += " util-linux"
ONIRO_SUPPORT_REF += " util-linux-libuuid"
ONIRO_SUPPORT_REF += " v86d"
ONIRO_SUPPORT_REF += " vala"
ONIRO_SUPPORT_REF += " volatile-binds"
ONIRO_SUPPORT_REF += " which"
ONIRO_SUPPORT_REF += " wireless-regdb"
ONIRO_SUPPORT_REF += " wpa-supplicant"
ONIRO_SUPPORT_REF += " xz"
ONIRO_SUPPORT_REF += " zip"
ONIRO_SUPPORT_REF += " zlib"
ONIRO_SUPPORT_REF += " zstd"
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment