[OE-core] [jethro][PATCH] license.bbclass: fix host contamination warnings for license files

Martin Jansa martin.jansa at gmail.com
Wed Nov 25 10:34:53 UTC 2015


On Wed, Nov 25, 2015 at 04:42:57PM +0800, Robert Yang wrote:
> 
> Hi Jagadeesh,
> 
> Thanks, usually, patch should go into master branch before go into stable
> branch such as jethro. IMHO, jethro branch may not take this fix even if
> master merges it. The problem is that oe-core doesn't create package for
> ${PN}-lic atm, this patch is treated as part of the enhancement which is
> used for working with creating ${PN}-lic.

Why do you think it isn't able to create ${PN}-lic when configured to do
so?

commit dc78ef91a2bf01efb8028c9afbe69e506e016265
Author: Martin Jansa <martin.jansa at gmail.com>
Date:   Thu Jan 17 12:49:44 2013 +0100

    license.bbclass: package license texts to PN-lic when
LICENSE_CREATE_PACKAGE is enabled

is already in dylan release.

> // Robert
> 
> On 11/25/2015 02:54 PM, Jagadeesh Krishnanjanappa wrote:
> > We get below host contamination warnings of license files for
> > each recipe, when we try to create a separate ${PN}-lic package (which
> > contains license files), by setting LICENSE_CREATE_PACKAGE equal to "1"
> > in local.conf.
> >
> > -- snip --
> > 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]
> > 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]
> > 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]
> > -- CUT --
> >
> > Since the license files from source and OE-core, are populated in a normal
> > shell environment rather in pseudo environment (fakeroot); the ownership of
> > these files will be same as host user running bitbake. During the do_package
> > task (which runs in pseudo environment (fakeroot)), os.link preserves the
> > ownership of these license files as host user instead of root user.
> > This causes license files to have UID same as host user id and resulting in
> > above warnings during do_package_qa task.
> >
> > Changing ownership of license files to root user under fakeroot environment
> > will solve above warnings, and on exiting fakeroot environment the license
> > files will continue to be owned by host user.
> >
> > Signed-off-by: Jagadeesh Krishnanjanappa <jkrishnanjanappa at mvista.com>
> > ---
> >   meta/classes/license.bbclass | 1 +
> >   1 file changed, 1 insertion(+)
> >
> > diff --git a/meta/classes/license.bbclass b/meta/classes/license.bbclass
> > index c616a20..d400ac0 100644
> > --- a/meta/classes/license.bbclass
> > +++ b/meta/classes/license.bbclass
> > @@ -185,6 +185,7 @@ def copy_license_files(lic_files_paths, destdir):
> >                   os.remove(dst)
> >               if os.access(src, os.W_OK) and (os.stat(src).st_dev == os.stat(destdir).st_dev):
> >                   os.link(src, dst)
> > +                os.chown(dst,os.getuid(),os.getgid())
> >               else:
> >                   shutil.copyfile(src, dst)
> >           except Exception as e:
> >
> -- 
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core at lists.openembedded.org
> http://lists.openembedded.org/mailman/listinfo/openembedded-core

-- 
Martin 'JaMa' Jansa     jabber: Martin.Jansa at gmail.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: Digital signature
URL: <http://lists.openembedded.org/pipermail/openembedded-core/attachments/20151125/f420df3d/attachment-0002.sig>


More information about the Openembedded-core mailing list