From 193236933b0f4ab91b1625b64e2187e2db4e0e8f Mon Sep 17 00:00:00 2001 From: Brad Bishop Date: Fri, 5 Apr 2019 15:28:33 -0400 Subject: reset upstream subtrees to HEAD Reset the following subtrees on HEAD: poky: 8217b477a1(master) meta-xilinx: 64aa3d35ae(master) meta-openembedded: 0435c9e193(master) meta-raspberrypi: 490a4441ac(master) meta-security: cb6d1c85ee(master) Squashed patches: meta-phosphor: drop systemd 239 patches meta-phosphor: mrw-api: use correct install path Change-Id: I268e2646d9174ad305630c6bbd3fbc1a6105f43d Signed-off-by: Brad Bishop --- poky/meta/classes/license_image.bbclass | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) (limited to 'poky/meta/classes/license_image.bbclass') diff --git a/poky/meta/classes/license_image.bbclass b/poky/meta/classes/license_image.bbclass index b65ff56f7..67500386b 100644 --- a/poky/meta/classes/license_image.bbclass +++ b/poky/meta/classes/license_image.bbclass @@ -32,11 +32,12 @@ python license_create_manifest() { rootfs_license_manifest = os.path.join(d.getVar('LICENSE_DIRECTORY'), d.getVar('IMAGE_NAME'), 'license.manifest') - write_license_files(d, rootfs_license_manifest, pkg_dic) + write_license_files(d, rootfs_license_manifest, pkg_dic, rootfs=True) } -def write_license_files(d, license_manifest, pkg_dic): +def write_license_files(d, license_manifest, pkg_dic, rootfs=True): import re + import stat bad_licenses = (d.getVar("INCOMPATIBLE_LICENSE") or "").split() bad_licenses = map(lambda l: canonical_license(d, l), bad_licenses) @@ -94,7 +95,7 @@ def write_license_files(d, license_manifest, pkg_dic): # With both options set we see a .5 M increase in core-image-minimal copy_lic_manifest = d.getVar('COPY_LIC_MANIFEST') copy_lic_dirs = d.getVar('COPY_LIC_DIRS') - if copy_lic_manifest == "1": + if rootfs and copy_lic_manifest == "1": rootfs_license_dir = os.path.join(d.getVar('IMAGE_ROOTFS'), 'usr', 'share', 'common-licenses') bb.utils.mkdirhier(rootfs_license_dir) @@ -146,6 +147,18 @@ def write_license_files(d, license_manifest, pkg_dic): continue os.link(pkg_license, pkg_rootfs_license) + # Fixup file ownership and permissions + for walkroot, dirs, files in os.walk(rootfs_license_dir): + for f in files: + p = os.path.join(walkroot, f) + os.lchown(p, 0, 0) + if not os.path.islink(p): + os.chmod(p, stat.S_IRUSR | stat.S_IWUSR | stat.S_IRGRP | stat.S_IROTH) + for dir in dirs: + p = os.path.join(walkroot, dir) + os.lchown(p, 0, 0) + os.chmod(p, stat.S_IRWXU | stat.S_IRGRP | stat.S_IXGRP | stat.S_IROTH | stat.S_IXOTH) + def license_deployed_manifest(d): @@ -176,7 +189,7 @@ def license_deployed_manifest(d): d.getVar('IMAGE_NAME')) bb.utils.mkdirhier(lic_manifest_dir) image_license_manifest = os.path.join(lic_manifest_dir, 'image_license.manifest') - write_license_files(d, image_license_manifest, man_dic) + write_license_files(d, image_license_manifest, man_dic, rootfs=False) def get_deployed_dependencies(d): """ -- cgit v1.2.3