Bug 5572

Summary: Enalbe COPY_LIC_MANIFEST and COPY_LIC_DIRS: No kernel license is installed in image
Product: [Build System, Metadata & Runtime] OE-Core Reporter: Hongxu Jia <hongxu.jia>
Component: coreAssignee: Hongxu Jia <hongxu.jia>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: Medium CC: hongxu.jia, liezhi.yang, mark.hatle, meta.mr.watcher, meta.watcher, sgw, yi.zhao
Version: 1.6   
Target Milestone: 1.6 M1   
Hardware: x86   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: Don't know

Description Hongxu Jia 2013-11-20 10:34:33 UTC
Enalbe COPY_LIC_MANIFEST and COPY_LIC_DIRS: No kernel license is installed in image

*env
Add COPY_LIC_MANIFEST = "1" and COPY_LIC_DIRS = "1" to local.conf

*problem

Build image and no kernel license in ${IMAGE_ROOTFS}/usr/share/common-licenses/${pkg}/${lic};

jiahongxu:1.0-r0$bitbake core-image-minimal
jiahongxu:1.0-r0$ ls rootfs/usr/share/common-licenses/kernel-3.10.17-yocto-standard
jiahongxu:1.0-r0$ 

*analysis
For each recipe, it populated license files to ${LICENSE_DIRECTORY}/${PN},
such as kernel's license dir was ${LICENSE_DIRECTORY}/kernel-3.10.17-yocto-standard;

In do_rootfs task, it copied license directories from ${LICENSE_DIRECTORY}/
${pkg}, and ${pkg} was listed in ${INSTALLED_PKGS};

We got ${INSTALLED_PKGS} by rpm query, such as the kernel were 'kernel-*',
but the kernel's PN was linux-yocto, so searching ${LICENSE_DIRECTORY}/
kernel-* failed.

*solution
Copied license directories from ${LICENSE_DIRECTORY}/${PN} fixed this issue.