Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
Oniro
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Model registry
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Eclipse Projects
Oniro Core
Oniro
Merge requests
!86
Add supportability class and configuration
Code
Review changes
Check out branch
Download
Patches
Plain diff
Open
Add supportability class and configuration
landgraf/oniro:supportability_single_conf
into
kirkstone
Overview
42
Commits
1
Pipelines
0
Changes
3
Open
Pavel Zhukov
requested to merge
landgraf/oniro:supportability_single_conf
into
kirkstone
3 years ago
Overview
13
Commits
1
Pipelines
0
Changes
3
Expand
Signed-off-by: Pavel Zhukov
pavel.zhukov@huawei.com
Edited
2 years ago
by
Pavel Zhukov
0
0
Merge request reports
Compare
kirkstone
version 12
427a0ca0
2 years ago
version 11
66d1c47f
2 years ago
version 10
75816611
3 years ago
version 9
79da20ff
3 years ago
version 8
b7a8aff4
3 years ago
version 7
7c336bc1
3 years ago
version 6
f9b22c0f
3 years ago
version 5
11866994
3 years ago
version 4
cfd155b8
3 years ago
version 3
59889ee6
3 years ago
version 2
b2efbc84
3 years ago
version 1
dac06b13
3 years ago
kirkstone (HEAD)
and
latest version
latest version
427a0ca0
1 commit,
2 years ago
version 12
427a0ca0
1 commit,
2 years ago
version 11
66d1c47f
1 commit,
2 years ago
version 10
75816611
1 commit,
3 years ago
version 9
79da20ff
1 commit,
3 years ago
version 8
b7a8aff4
1 commit,
3 years ago
version 7
7c336bc1
1 commit,
3 years ago
version 6
f9b22c0f
1 commit,
3 years ago
version 5
11866994
1 commit,
3 years ago
version 4
cfd155b8
1 commit,
3 years ago
version 3
59889ee6
1 commit,
3 years ago
version 2
b2efbc84
1 commit,
3 years ago
version 1
dac06b13
1 commit,
3 years ago
3 files
+
269
−
0
Side-by-side
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
3
Search (e.g. *.vue) (Ctrl+P)
meta-oniro-core/classes/supportability.bbclass
0 → 100644
+
98
−
0
Options
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; "
Loading