<div dir="ltr">Ping.<div>Any updates regarding this patch?</div><div><br></div><div>Regards,</div><div>Jagadeesh<br><div><br></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Sat, Nov 28, 2015 at 1:39 PM, Jagadeesh Krishnanjanappa <span dir="ltr">&lt;<a href="mailto:jkrishnanjanappa@mvista.com" target="_blank">jkrishnanjanappa@mvista.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">We get below host contamination warnings of license files for<br>
each recipe, when we try to create a separate ${PN}-lic package (which<br>
contains license files), by setting LICENSE_CREATE_PACKAGE equal to &quot;1&quot;<br>
in local.conf.<br>
<br>
-- snip --<br>
WARNING: QA Issue: libcgroup: /libcgroup-lic/usr/share/licenses/libcgroup/generic_LGPLv2.1 is owned by uid 5001, which is the same as the user running bitbake. This may be due to host contamination [host-user-contaminated]<br>
WARNING: QA Issue: attr: /attr-lic/usr/share/licenses/attr/libattr.c is owned by uid 5001, which is the same as the user running bitbake. This may be due to host contamination [host-user-contaminated]<br>
WARNING: QA Issue: bash: /bash-lic/usr/share/licenses/bash/COPYING is owned by uid 5001, which is the same as the user running bitbake. This may be due to host contamination [host-user-contaminated]<br>
-- CUT --<br>
<br>
Since the license files from source and OE-core, are populated in a normal<br>
shell environment rather in pseudo environment (fakeroot); the ownership of<br>
these files will be same as host user running bitbake. During the do_package<br>
task (which runs in pseudo environment (fakeroot)), os.link preserves the<br>
ownership of these license files as host user instead of root user.<br>
This causes license files to have UID same as host user id and resulting in<br>
above warnings during do_package_qa task.<br>
<br>
Changing ownership of license files to root user (which has UID and GID as 0)<br>
under pseudo environment will solve above warnings, and on exiting pseudo<br>
environment the license files will continue to be owned by host user. Perform<br>
this manipulation within try/except statements, as tasks which are not exected<br>
under pseudo (such as do_populate_lic) result in OSError when trying to<br>
change ownership of license files.<br>
<br>
Signed-off-by: Jagadeesh Krishnanjanappa &lt;<a href="mailto:jkrishnanjanappa@mvista.com">jkrishnanjanappa@mvista.com</a>&gt;<br>
---<br>
 meta/classes/license.bbclass | 9 +++++++++<br>
 1 file changed, 9 insertions(+)<br>
<br>
diff --git a/meta/classes/license.bbclass b/meta/classes/license.bbclass<br>
index c616a20..8fff156 100644<br>
--- a/meta/classes/license.bbclass<br>
+++ b/meta/classes/license.bbclass<br>
@@ -185,6 +185,15 @@ def copy_license_files(lic_files_paths, destdir):<br>
                 os.remove(dst)<br>
             if os.access(src, os.W_OK) and (os.stat(src).st_dev == os.stat(destdir).st_dev):<br>
                 os.link(src, dst)<br>
+                try:<br>
+                    os.chown(dst,0,0)<br>
+                except OSError as err:<br>
+                    if err.errno == 1:<br>
+                        # suppress &quot;Operation not permitted&quot; error, as<br>
+                        # sometimes this function is not executed under pseudo<br>
+                        pass<br>
+                    else:<br>
+                        raise<br>
             else:<br>
                 shutil.copyfile(src, dst)<br>
         except Exception as e:<br>
<span class="HOEnZb"><font color="#888888">--<br>
1.9.1<br>
<br>
</font></span></blockquote></div><br></div>