| Summary: | license_create_manifest fails when linux-dummy is used to create own kernel | ||
|---|---|---|---|
| Product: | [Build System, Metadata & Runtime] OE-Core | Reporter: | Jose Perez C <jose.perez.carranza> |
| Component: | core | Assignee: | Richard Purdie <richard.purdie> |
| Status: | RESOLVED OBSOLETE | QA Contact: | |
| Severity: | normal | ||
| Priority: | Medium+ | CC: | bluelightning, meta.mr.watcher, meta.watcher, mikko.ylinen, richard.purdie, tom.zanussi, wenzong.fan |
| Version: | 2.3 | ||
| Target Milestone: | 4.99 | ||
| Hardware: | x86 | ||
| OS: | Multiple | ||
| Whiteboard: | |||
| OS type for building Yocto: | --- | Type of Regression: | --- |
| Verified: | Documentation change: | No (bug/feature does not impact docs) | |
|
Description
Jose Perez C
2016-11-03 18:33:37 UTC
The stack trace of python calls that resulted in this exception/failure was:
File: 'exec_python_func() autogenerated', lineno: 2, function: <module>
0001:
*** 0002:license_create_manifest(d)
0003:
File: '/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-oe-selftest/build/meta/classes/license.bbclass', lineno: 48, function: license_create_manifest
0044: pkg_dic = {}
0045: for pkg in sorted(image_list_installed_packages(d)):
0046: pkg_info = os.path.join(d.getVar('PKGDATA_DIR', True),
0047: 'runtime-reverse', pkg)
*** 0048: pkg_name = os.path.basename(os.readlink(pkg_info))
0049:
0050: pkg_dic[pkg_name] = oe.packagedata.read_pkgdatafile(pkg_info)
0051: if not "LICENSE" in pkg_dic[pkg_name].keys():
0052: pkg_lic_name = "LICENSE_" + pkg_name
Exception: FileNotFoundError: [Errno 2] No such file or directory: '/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-oe-selftest/build/build/tmp/sysroots/qemux86-64/pkgdata/runtime-reverse/kernel-4.8.3-yocto-standard'
I accidentally ran into this too and looked into it a bit. There are two kernels in the package feed which Provides: the same functionality. The one that's built afterwards is tracked in pkgdata as runtime-reverse but the package manager has installed the other (returned by image_list_installed_packages). One more case about the failure.
I got the similar errors while I building meta-selinux and changed the refpolicy provider by setting 'PREFERRED_PROVIDER_virtual/refpolicy = "refpolicy-minimum"' in local.conf.
Steps to reproduce it:
1) Setup a build with meta-selinux layer included, and update local.conf:
+ DISTRO ?= "poky-selinux"
+ PREFERRED_VERSION_refpolicy-mls ?= "2.20161023"
+ PREFERRED_VERSION_refpolicy-standard ?= "2.20161023"
+ PREFERRED_VERSION_refpolicy-mcs ?= "2.20161023"
+ PREFERRED_VERSION_refpolicy-minimum ?= "2.20161023"
+ PREFERRED_VERSION_refpolicy-targeted ?= "2.20161023"
2) Run build with "bitbake core-image-selinux"
3) Change refpolicy provider with:
+ PREFERRED_PROVIDER_virtual/refpolicy = "refpolicy-minimum"
4) Run "bitbake core-image-selinux" again, then below error occurs:
ERROR: core-image-selinux-1.0-r0 do_rootfs: Error executing a python function in exec_python_func() autogenerated:
The stack trace of python calls that resulted in this exception/failure was:
File: 'exec_python_func() autogenerated', lineno: 2, function: <module>
0001:
*** 0002:license_create_manifest(d)
0003:
File: '/.../poky/meta/classes/license.bbclass', lineno: 48, function: license_create_manifest
0044: pkg_dic = {}
0045: for pkg in sorted(image_list_installed_packages(d)):
0046: pkg_info = os.path.join(d.getVar('PKGDATA_DIR'),
0047: 'runtime-reverse', pkg)
*** 0048: pkg_name = os.path.basename(os.readlink(pkg_info))
0049:
0050: pkg_dic[pkg_name] = oe.packagedata.read_pkgdatafile(pkg_info)
0051: if not "LICENSE" in pkg_dic[pkg_name].keys():
0052: pkg_lic_name = "LICENSE_" + pkg_name
Exception: FileNotFoundError: [Errno 2] No such file or directory: '/.../tmp/pkgdata/qemux86-64/runtime-reverse/refpolicy-mls'
ERROR: core-image-selinux-1.0-r0 do_rootfs: Function failed: license_create_manifest
I have changed the package provider as B, but it still search files from A.
In the years since 2017, the code has changed a lot and we now clean up sysroots much more carefully in circumstances where providers change. I don't believe this error can occur any more. |