diff options
| -rw-r--r-- | meta/classes/license_image.bbclass | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/meta/classes/license_image.bbclass b/meta/classes/license_image.bbclass index c96b032ebd..b9a0f2359b 100644 --- a/meta/classes/license_image.bbclass +++ b/meta/classes/license_image.bbclass | |||
| @@ -1,3 +1,5 @@ | |||
| 1 | ROOTFS_LICENSE_DIR = "${IMAGE_ROOTFS}/usr/share/common-licenses" | ||
| 2 | |||
| 1 | python write_package_manifest() { | 3 | python write_package_manifest() { |
| 2 | # Get list of installed packages | 4 | # Get list of installed packages |
| 3 | license_image_dir = d.expand('${LICENSE_DIRECTORY}/${IMAGE_NAME}') | 5 | license_image_dir = d.expand('${LICENSE_DIRECTORY}/${IMAGE_NAME}') |
| @@ -104,8 +106,7 @@ def write_license_files(d, license_manifest, pkg_dic, rootfs=True): | |||
| 104 | copy_lic_manifest = d.getVar('COPY_LIC_MANIFEST') | 106 | copy_lic_manifest = d.getVar('COPY_LIC_MANIFEST') |
| 105 | copy_lic_dirs = d.getVar('COPY_LIC_DIRS') | 107 | copy_lic_dirs = d.getVar('COPY_LIC_DIRS') |
| 106 | if rootfs and copy_lic_manifest == "1": | 108 | if rootfs and copy_lic_manifest == "1": |
| 107 | rootfs_license_dir = os.path.join(d.getVar('IMAGE_ROOTFS'), | 109 | rootfs_license_dir = d.getVar('ROOTFS_LICENSE_DIR') |
| 108 | 'usr', 'share', 'common-licenses') | ||
| 109 | bb.utils.mkdirhier(rootfs_license_dir) | 110 | bb.utils.mkdirhier(rootfs_license_dir) |
| 110 | rootfs_license_manifest = os.path.join(rootfs_license_dir, | 111 | rootfs_license_manifest = os.path.join(rootfs_license_dir, |
| 111 | os.path.split(license_manifest)[1]) | 112 | os.path.split(license_manifest)[1]) |
| @@ -267,3 +268,13 @@ python do_populate_lic_deploy() { | |||
| 267 | addtask populate_lic_deploy before do_build after do_image_complete | 268 | addtask populate_lic_deploy before do_build after do_image_complete |
| 268 | do_populate_lic_deploy[recrdeptask] += "do_populate_lic do_deploy" | 269 | do_populate_lic_deploy[recrdeptask] += "do_populate_lic do_deploy" |
| 269 | 270 | ||
| 271 | python license_qa_dead_symlink() { | ||
| 272 | import os | ||
| 273 | |||
| 274 | for root, dirs, files in os.walk(d.getVar('ROOTFS_LICENSE_DIR')): | ||
| 275 | for file in files: | ||
| 276 | full_path = root + "/" + file | ||
| 277 | if os.path.islink(full_path) and not os.path.exists(full_path): | ||
| 278 | bb.error("broken symlink: " + full_path) | ||
| 279 | } | ||
| 280 | IMAGE_QA_COMMANDS += "license_qa_dead_symlink" | ||
