Bug 10325 - license.bbclass should only copy licenses for packages actually installed
Summary: license.bbclass should only copy licenses for packages actually installed
Status: RESOLVED FIXED
Alias: None
Product: OE-Core
Classification: Build System, Metadata & Runtime
Component: core (show other bugs)
Version: 2.2
Hardware: x86 Multiple
: Medium enhancement
Target Milestone: 2.3 M3
Assignee: Aníbal Limón
QA Contact:
URL:
Whiteboard:
Depends on:
Blocks:
 
Reported: 2016-09-23 03:32 UTC by Saul Wold
Modified: 2017-03-02 17:27 UTC (History)
6 users (show)

See Also:
OS type for building Yocto: ---
Type of Regression: ---
Verified:
Documentation change: Yes (doc changes required)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Saul Wold 2016-09-23 03:32:16 UTC
The license.bbclass has 2 options, COPY_LIC_MANIFEST and COPY_LIC_DIRS.  The MANIFEST option will correctly collect the licenses from the packages installed on the target rootfs.

The LIC_DIRS copies all of the recipe's licenses regardless of whether that installed packages use those licenses or not.  This is most noticed with the linux-firmware recipe and related packages where there are many licenses for the firmware, but only the installed packages with specific licenses should be included.

One solution would be to modify the COPY_LIC_DIRS to always create the manifest, which is based on the installed packages and only copy those licenses to the common-licenses directory.
Comment 1 Saul Wold 2017-01-03 23:35:29 UTC
I started to do some investigation on this and I think it can be accomplished by tracking in an array which licenses are listed in the manifest.

There seems to be an additional behavior that I am not sure is correct or not, this is also copying additional files like recipeinfo from the license deploy dir to the rootfs.
Comment 2 Aníbal Limón 2017-02-13 20:36:23 UTC
The current implementation takes into account packages at time of copy licenses to the rootfs.

The problem seems to be at do_populate_lic [1], that is copying all the licenses associated with a recipe in every package.

[1] http://git.yoctoproject.org/cgit/cgit.cgi/poky/tree/meta/classes/license.bbclass#n291