diff options
Diffstat (limited to 'meta/classes/license_image.bbclass')
-rw-r--r-- | meta/classes/license_image.bbclass | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/meta/classes/license_image.bbclass b/meta/classes/license_image.bbclass index f0fbb763f1..6515ee8278 100644 --- a/meta/classes/license_image.bbclass +++ b/meta/classes/license_image.bbclass | |||
@@ -32,10 +32,10 @@ python license_create_manifest() { | |||
32 | 32 | ||
33 | rootfs_license_manifest = os.path.join(d.getVar('LICENSE_DIRECTORY'), | 33 | rootfs_license_manifest = os.path.join(d.getVar('LICENSE_DIRECTORY'), |
34 | d.getVar('IMAGE_NAME'), 'license.manifest') | 34 | d.getVar('IMAGE_NAME'), 'license.manifest') |
35 | write_license_files(d, rootfs_license_manifest, pkg_dic) | 35 | write_license_files(d, rootfs_license_manifest, pkg_dic, rootfs=True) |
36 | } | 36 | } |
37 | 37 | ||
38 | def write_license_files(d, license_manifest, pkg_dic): | 38 | def write_license_files(d, license_manifest, pkg_dic, rootfs=True): |
39 | import re | 39 | import re |
40 | 40 | ||
41 | bad_licenses = (d.getVar("INCOMPATIBLE_LICENSE") or "").split() | 41 | bad_licenses = (d.getVar("INCOMPATIBLE_LICENSE") or "").split() |
@@ -94,7 +94,7 @@ def write_license_files(d, license_manifest, pkg_dic): | |||
94 | # With both options set we see a .5 M increase in core-image-minimal | 94 | # With both options set we see a .5 M increase in core-image-minimal |
95 | copy_lic_manifest = d.getVar('COPY_LIC_MANIFEST') | 95 | copy_lic_manifest = d.getVar('COPY_LIC_MANIFEST') |
96 | copy_lic_dirs = d.getVar('COPY_LIC_DIRS') | 96 | copy_lic_dirs = d.getVar('COPY_LIC_DIRS') |
97 | if copy_lic_manifest == "1": | 97 | if rootfs and copy_lic_manifest == "1": |
98 | rootfs_license_dir = os.path.join(d.getVar('IMAGE_ROOTFS'), | 98 | rootfs_license_dir = os.path.join(d.getVar('IMAGE_ROOTFS'), |
99 | 'usr', 'share', 'common-licenses') | 99 | 'usr', 'share', 'common-licenses') |
100 | bb.utils.mkdirhier(rootfs_license_dir) | 100 | bb.utils.mkdirhier(rootfs_license_dir) |
@@ -146,6 +146,13 @@ def write_license_files(d, license_manifest, pkg_dic): | |||
146 | continue | 146 | continue |
147 | 147 | ||
148 | os.link(pkg_license, pkg_rootfs_license) | 148 | os.link(pkg_license, pkg_rootfs_license) |
149 | # Fixup file ownership | ||
150 | for walkroot, dirs, files in os.walk(rootfs_license_dir): | ||
151 | for f in files: | ||
152 | os.lchown(os.path.join(walkroot, f), 0, 0) | ||
153 | for dir in dirs: | ||
154 | os.lchown(os.path.join(walkroot, dir), 0, 0) | ||
155 | |||
149 | 156 | ||
150 | 157 | ||
151 | def license_deployed_manifest(d): | 158 | def license_deployed_manifest(d): |
@@ -176,7 +183,7 @@ def license_deployed_manifest(d): | |||
176 | d.getVar('IMAGE_NAME')) | 183 | d.getVar('IMAGE_NAME')) |
177 | bb.utils.mkdirhier(lic_manifest_dir) | 184 | bb.utils.mkdirhier(lic_manifest_dir) |
178 | image_license_manifest = os.path.join(lic_manifest_dir, 'image_license.manifest') | 185 | image_license_manifest = os.path.join(lic_manifest_dir, 'image_license.manifest') |
179 | write_license_files(d, image_license_manifest, man_dic) | 186 | write_license_files(d, image_license_manifest, man_dic, rootfs=False) |
180 | 187 | ||
181 | def get_deployed_dependencies(d): | 188 | def get_deployed_dependencies(d): |
182 | """ | 189 | """ |