Bug 10597 - license_create_manifest fails when linux-dummy is used to create own kernel
Summary: license_create_manifest fails when linux-dummy is used to create own kernel
Status: RESOLVED OBSOLETE
Alias: None
Product: OE-Core
Classification: Build System, Metadata & Runtime
Component: core (show other bugs)
Version: 2.3
Hardware: x86 Multiple
: Medium+ normal
Target Milestone: 4.99
Assignee: Richard Purdie
QA Contact:
URL:
Whiteboard:
Depends on:
Blocks:
 
Reported: 2016-11-03 18:33 UTC by Jose Perez C
Modified: 2023-02-07 11:09 UTC (History)
7 users (show)

See Also:
OS type for building Yocto: ---
Type of Regression: ---
Verified:
Documentation change: No (bug/feature does not impact docs)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jose Perez C 2016-11-03 18:33:37 UTC
Currently the kernel.py test is failing when running selftest on autobuilder due license_create_manifest function is locking for "kernel-4.8.3-yocto-standard" when PREFERRED_PROVIDER_virtual/kernel = "linux-dummy" is set. 


Autobuilder log :

https://autobuilder.yoctoproject.org/main/builders/nightly-oe-selftest/builds/719/steps/Running%20oe-selftest/logs/stdio 

---- Steps -----

1. Run nightly-oe-selftest on AB
Comment 1 Ross Burton 2016-11-04 13:00:23 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'
Comment 2 Mikko Ylinen 2017-03-01 13:10:54 UTC
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).
Comment 3 Wenzong.Fan 2017-03-08 02:30:22 UTC
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.
Comment 4 Richard Purdie 2023-02-07 11:09:40 UTC
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.