Openembedded Core Discussions
 help / color / mirror / Atom feed
* [jethro][PATCH] license.bbclass: fix host contamination warnings for license files
@ 2015-11-25  6:54 Jagadeesh Krishnanjanappa
  2015-11-25  8:42 ` Robert Yang
  0 siblings, 1 reply; 11+ messages in thread
From: Jagadeesh Krishnanjanappa @ 2015-11-25  6:54 UTC (permalink / raw)
  To: openembedded-core

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@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:
-- 
1.9.1



^ permalink raw reply related	[flat|nested] 11+ messages in thread

* Re: [jethro][PATCH] license.bbclass: fix host contamination warnings for license files
  2015-11-25  6:54 [jethro][PATCH] license.bbclass: fix host contamination warnings for license files Jagadeesh Krishnanjanappa
@ 2015-11-25  8:42 ` Robert Yang
  2015-11-25 10:34   ` Martin Jansa
  0 siblings, 1 reply; 11+ messages in thread
From: Robert Yang @ 2015-11-25  8:42 UTC (permalink / raw)
  To: Jagadeesh Krishnanjanappa, openembedded-core


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.

// 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@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:
>


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [jethro][PATCH] license.bbclass: fix host contamination warnings for license files
  2015-11-25  8:42 ` Robert Yang
@ 2015-11-25 10:34   ` Martin Jansa
  2015-11-25 10:55     ` Jagadeesh Krishnanjanappa
  0 siblings, 1 reply; 11+ messages in thread
From: Martin Jansa @ 2015-11-25 10:34 UTC (permalink / raw)
  To: Robert Yang; +Cc: openembedded-core

[-- Attachment #1: Type: text/plain, Size: 3588 bytes --]

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@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@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@lists.openembedded.org
> http://lists.openembedded.org/mailman/listinfo/openembedded-core

-- 
Martin 'JaMa' Jansa     jabber: Martin.Jansa@gmail.com

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 188 bytes --]

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [jethro][PATCH] license.bbclass: fix host contamination warnings for license files
  2015-11-25 10:34   ` Martin Jansa
@ 2015-11-25 10:55     ` Jagadeesh Krishnanjanappa
  2015-11-25 12:41       ` Martin Jansa
  2015-11-25 14:15       ` Robert Yang
  0 siblings, 2 replies; 11+ messages in thread
From: Jagadeesh Krishnanjanappa @ 2015-11-25 10:55 UTC (permalink / raw)
  To: Robert Yang; +Cc: OE-core

[-- Attachment #1: Type: text/plain, Size: 4257 bytes --]

Hi Robert,

I understand. Though LICENSE_CREATE_PACKAGE is disabled by default in
OE-core, if some users want to create ${PN}-lic package for each recipe
via LICENSE_CREATE_PACKAGE = "1", then they are going to have host
contamination  warnings for each recipe.

The above commit indicated by Martin does create ${PN}-lic package when
LICENSE_CREATE_PACKAGE = "1".

Regards,
Jagadeesh

On Wed, Nov 25, 2015 at 4:04 PM, Martin Jansa <martin.jansa@gmail.com>
wrote:

> 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@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@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@lists.openembedded.org
> > http://lists.openembedded.org/mailman/listinfo/openembedded-core
>
> --
> Martin 'JaMa' Jansa     jabber: Martin.Jansa@gmail.com
>

[-- Attachment #2: Type: text/html, Size: 5616 bytes --]

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [jethro][PATCH] license.bbclass: fix host contamination warnings for license files
  2015-11-25 10:55     ` Jagadeesh Krishnanjanappa
@ 2015-11-25 12:41       ` Martin Jansa
  2015-11-25 14:58         ` Jagadeesh Krishnanjanappa
  2015-11-25 14:15       ` Robert Yang
  1 sibling, 1 reply; 11+ messages in thread
From: Martin Jansa @ 2015-11-25 12:41 UTC (permalink / raw)
  To: Jagadeesh Krishnanjanappa; +Cc: OE-core

[-- Attachment #1: Type: text/plain, Size: 4708 bytes --]

On Wed, Nov 25, 2015 at 04:25:56PM +0530, Jagadeesh Krishnanjanappa wrote:
> Hi Robert,
> 
> I understand. Though LICENSE_CREATE_PACKAGE is disabled by default in
> OE-core, if some users want to create ${PN}-lic package for each recipe
> via LICENSE_CREATE_PACKAGE = "1", then they are going to have host
> contamination  warnings for each recipe.
> 
> The above commit indicated by Martin does create ${PN}-lic package when
> LICENSE_CREATE_PACKAGE = "1".
> 
> Regards,
> Jagadeesh
> 
> On Wed, Nov 25, 2015 at 4:04 PM, Martin Jansa <martin.jansa@gmail.com>
> wrote:
> 
> > 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@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@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())

is os.getuid() and os.getgid() the correct value you want to use? I
would expect root:root.

> > > >               else:
> > > >                   shutil.copyfile(src, dst)
> > > >           except Exception as e:
> > > >
> > > --
> > > _______________________________________________
> > > Openembedded-core mailing list
> > > Openembedded-core@lists.openembedded.org
> > > http://lists.openembedded.org/mailman/listinfo/openembedded-core
> >
> > --
> > Martin 'JaMa' Jansa     jabber: Martin.Jansa@gmail.com
> >

-- 
Martin 'JaMa' Jansa     jabber: Martin.Jansa@gmail.com

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 188 bytes --]

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [jethro][PATCH] license.bbclass: fix host contamination warnings for license files
  2015-11-25 10:55     ` Jagadeesh Krishnanjanappa
  2015-11-25 12:41       ` Martin Jansa
@ 2015-11-25 14:15       ` Robert Yang
  1 sibling, 0 replies; 11+ messages in thread
From: Robert Yang @ 2015-11-25 14:15 UTC (permalink / raw)
  To: Jagadeesh Krishnanjanappa; +Cc: OE-core



On 11/25/2015 06:55 PM, Jagadeesh Krishnanjanappa wrote:
> Hi Robert,
>
> I understand. Though LICENSE_CREATE_PACKAGE is disabled by default in OE-core,
> if some users want to create ${PN}-lic package for each recipe
> via LICENSE_CREATE_PACKAGE = "1", then they are going to have host contamination
>   warnings for each recipe.
>
> The above commit indicated by Martin does create ${PN}-lic package when
> LICENSE_CREATE_PACKAGE = "1".

Sorry, I missed this. So if master merges the patch, I will pick it
for jethro.

// Robert

>
> Regards,
> Jagadeesh
>
> On Wed, Nov 25, 2015 at 4:04 PM, Martin Jansa <martin.jansa@gmail.com
> <mailto:martin.jansa@gmail.com>> wrote:
>
>     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@gmail.com <mailto:martin.jansa@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@mvista.com
>     <mailto:jkrishnanjanappa@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@lists.openembedded.org
>     <mailto:Openembedded-core@lists.openembedded.org>
>     >http://lists.openembedded.org/mailman/listinfo/openembedded-core
>
>     --
>     Martin 'JaMa' Jansa     jabber: Martin.Jansa@gmail.com
>     <mailto:Martin.Jansa@gmail.com>
>
>


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [jethro][PATCH] license.bbclass: fix host contamination warnings for license files
  2015-11-25 12:41       ` Martin Jansa
@ 2015-11-25 14:58         ` Jagadeesh Krishnanjanappa
  2015-11-25 21:28           ` Burton, Ross
  0 siblings, 1 reply; 11+ messages in thread
From: Jagadeesh Krishnanjanappa @ 2015-11-25 14:58 UTC (permalink / raw)
  To: Martin Jansa; +Cc: OE-core

[-- Attachment #1: Type: text/plain, Size: 916 bytes --]

>
>
> is os.getuid() and os.getgid() the correct value you want to use? I
> would expect root:root.
>
>
Yes, since copy_license_files() function is executed within the pseudo
environement (fakeroot), both os.getuid() and os.getgid() return 0, which
resembles to uid and gid of root user. Also, os.chown accepts integer
values for 2nd and 3rd arguments.

Regards,
Jagadeesh

> > > >               else:
> > > > >                   shutil.copyfile(src, dst)
> > > > >           except Exception as e:
> > > > >
> > > > --
> > > > _______________________________________________
> > > > Openembedded-core mailing list
> > > > Openembedded-core@lists.openembedded.org
> > > > http://lists.openembedded.org/mailman/listinfo/openembedded-core
> > >
> > > --
> > > Martin 'JaMa' Jansa     jabber: Martin.Jansa@gmail.com
> > >
>
> --
> Martin 'JaMa' Jansa     jabber: Martin.Jansa@gmail.com
>

[-- Attachment #2: Type: text/html, Size: 2059 bytes --]

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [jethro][PATCH] license.bbclass: fix host contamination warnings for license files
  2015-11-25 14:58         ` Jagadeesh Krishnanjanappa
@ 2015-11-25 21:28           ` Burton, Ross
  2015-11-26  3:17             ` Jagadeesh Krishnanjanappa
  0 siblings, 1 reply; 11+ messages in thread
From: Burton, Ross @ 2015-11-25 21:28 UTC (permalink / raw)
  To: Jagadeesh Krishnanjanappa; +Cc: OE-core

[-- Attachment #1: Type: text/plain, Size: 495 bytes --]

On 25 November 2015 at 14:58, Jagadeesh Krishnanjanappa <
jkrishnanjanappa@mvista.com> wrote:

> Yes, since copy_license_files() function is executed within the pseudo
> environement (fakeroot), both os.getuid() and os.getgid() return 0, which
> resembles to uid and gid of root user. Also, os.chown accepts integer
> values for 2nd and 3rd arguments.
>

So is there any advantage to using os.getuid() over hardcoding 0:0? It's
not like root is going to have a different UID.

Ross

[-- Attachment #2: Type: text/html, Size: 914 bytes --]

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [jethro][PATCH] license.bbclass: fix host contamination warnings for license files
  2015-11-25 21:28           ` Burton, Ross
@ 2015-11-26  3:17             ` Jagadeesh Krishnanjanappa
  2015-11-26 10:44               ` Burton, Ross
  0 siblings, 1 reply; 11+ messages in thread
From: Jagadeesh Krishnanjanappa @ 2015-11-26  3:17 UTC (permalink / raw)
  To: Burton, Ross; +Cc: OE-core

[-- Attachment #1: Type: text/plain, Size: 817 bytes --]

Hi Ross,

>
> Yes, since copy_license_files() function is executed within the pseudo
>> environement (fakeroot), both os.getuid() and os.getgid() return 0,
>> which resembles to uid and gid of root user. Also, os.chown accepts integer
>> values for 2nd and 3rd arguments.
>>
>
> So is there any advantage to using os.getuid() over hardcoding 0:0? It's
> not like root is going to have a different UID.
>
> The intention of using os.getuid() is to avoid writing hardcoded value
 "0", since os.getuid() return "0" under fakeroot env; if root user is
having UID as 0.That's the advantage I can think of.

The above has been tested with Poky (Jethro version), it worked fine.
But still, if the opinion is to change os.getuid() and os.getgid() to 0, I
will send v2.

Regards,
Jagadesh


> Ross
>

[-- Attachment #2: Type: text/html, Size: 1733 bytes --]

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [jethro][PATCH] license.bbclass: fix host contamination warnings for license files
  2015-11-26  3:17             ` Jagadeesh Krishnanjanappa
@ 2015-11-26 10:44               ` Burton, Ross
  2015-11-26 11:19                 ` Jagadeesh Krishnanjanappa
  0 siblings, 1 reply; 11+ messages in thread
From: Burton, Ross @ 2015-11-26 10:44 UTC (permalink / raw)
  To: Jagadeesh Krishnanjanappa; +Cc: OE-core

[-- Attachment #1: Type: text/plain, Size: 473 bytes --]

On 26 November 2015 at 03:17, Jagadeesh Krishnanjanappa <
jkrishnanjanappa@mvista.com> wrote:

> The intention of using os.getuid() is to avoid writing hardcoded value
>  "0", since os.getuid() return "0" under fakeroot env; if root user is
> having UID as 0.That's the advantage I can think of.
>

root is *always* UID 0, and packaging always runs as root.  Can you send a
tested v2 with explicit 0 instead of assuming that you're running under
pseudo?

Ross

[-- Attachment #2: Type: text/html, Size: 868 bytes --]

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [jethro][PATCH] license.bbclass: fix host contamination warnings for license files
  2015-11-26 10:44               ` Burton, Ross
@ 2015-11-26 11:19                 ` Jagadeesh Krishnanjanappa
  0 siblings, 0 replies; 11+ messages in thread
From: Jagadeesh Krishnanjanappa @ 2015-11-26 11:19 UTC (permalink / raw)
  To: Burton, Ross; +Cc: OE-core

[-- Attachment #1: Type: text/plain, Size: 449 bytes --]

>
>
> The intention of using os.getuid() is to avoid writing hardcoded value
>>  "0", since os.getuid() return "0" under fakeroot env; if root user is
>> having UID as 0.That's the advantage I can think of.
>>
>
> root is *always* UID 0, and packaging always runs as root.
>
Can you send a tested v2 with explicit 0 instead of assuming that you're
> running under pseudo?
>

Patch v2 has been sent.

Regards,
Jagadeesh

> Ross
>

[-- Attachment #2: Type: text/html, Size: 1362 bytes --]

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2015-11-26 11:19 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-11-25  6:54 [jethro][PATCH] license.bbclass: fix host contamination warnings for license files Jagadeesh Krishnanjanappa
2015-11-25  8:42 ` Robert Yang
2015-11-25 10:34   ` Martin Jansa
2015-11-25 10:55     ` Jagadeesh Krishnanjanappa
2015-11-25 12:41       ` Martin Jansa
2015-11-25 14:58         ` Jagadeesh Krishnanjanappa
2015-11-25 21:28           ` Burton, Ross
2015-11-26  3:17             ` Jagadeesh Krishnanjanappa
2015-11-26 10:44               ` Burton, Ross
2015-11-26 11:19                 ` Jagadeesh Krishnanjanappa
2015-11-25 14:15       ` Robert Yang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox